weixin_39818662
weixin_39818662
2021-01-06 13:07

Decouple debugging TR_PrexArgInfo from TR_InlinerTracer

Currently, TR_PrexArgInfo's tracing message is tightly coupled with TR_InlinerTracer for at least 2 purposes I noticed 1. to call dumpPrexArgInfo which is defined in TR_InlinerTracer https://github.com/eclipse/openj9/blob/010379777a34ec6a49260689b76a063e268d5cf0/runtime/compiler/optimizer/InlinerTempForJ9.cpp#L5357 This debug method should be defined on TR_PrexArgInfo itself 2. to get comp or fe https://github.com/eclipse/openj9/blob/010379777a34ec6a49260689b76a063e268d5cf0/runtime/compiler/optimizer/InlinerTempForJ9.cpp#L5360. This should be replaced with TR::comp().

We should try to avoid those unnecessary coupling as reusing the data structure for other purposes becomes difficult. A case in point is https://github.com/eclipse/openj9/pull/7785#discussion_r348539138. Because TR_PrexArgInfo is coupled with TR_InlinerTracer the new TR_IntrepreterEmulator has to be coupled with TR_InlinerTracer as well.

Fixing this issue contains the following steps: - [ ] find out all the places where TR_PrexArgInfo uses the TR_InlinerTracer - [ ] replace code usingTR_InlinerTracer with independent code - [ ] decouple TR_IntrepreterEmulator from TR_InlinerTracer as well

Notice the interfaces in omr level needs to be changed as well.

该提问来源于开源项目:eclipse/openj9

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

4条回答

  • weixin_39818662 weixin_39818662 4月前

    could you help to label this item as beginner? thanks!

    点赞 评论 复制链接分享
  • weixin_39903176 weixin_39903176 4月前

    This is the plan for staging this refactor as discussed here: https://github.com/eclipse/omr/pull/4779#issuecomment-594893313

    1. Add the following macro in OMR PreExistence.hpp #define TR_PREXARGINFO_TRACER_CLASS TR_InlinerTracer Also add the new TR_PrexArgInfo::dumpTrace method.

      https://github.com/eclipse/omr/pull/4903

    2. Update method definitions in openj9 to use that macro. Also code in the bodies of these methods to only use members from the TR_LogTracer class.

    https://github.com/eclipse/openj9/pull/8759

    1. Update OMR macro and method declarations to use TR_LogTracer

    https://github.com/eclipse/omr/pull/4965

    1. Remove macro from openj9

    https://github.com/eclipse/openj9/pull/9163

    1. Remove macro from OMR

    https://github.com/eclipse/omr/pull/5077

    点赞 评论 复制链接分享
  • weixin_39903176 weixin_39903176 4月前

    all of the PRs mentioned above have been merged. Is this issue ready to close?

    点赞 评论 复制链接分享
  • weixin_39818662 weixin_39818662 4月前

    closing as the changes have been finished.

    点赞 评论 复制链接分享

相关推荐