weixin_39926311
weixin_39926311
2021-01-06 13:00

Why are monexit trees anchored to a treetop?

Just grabbed a log of java/lang/StringBuffer.length()I and I see the following:


n13n      monent  jitMethodMonitorEntry[#178  helper Method]
n18n        ==>aRegLoad
...
n10n      treetop
n9n         monexit  jitMethodMonitorExit[#33  helper Method]
n18n          ==>aRegLoad

Is there a reason for this asymmetry between monent and monexit? Are there cases where monexit is not under a treetop?

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

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

5条回答

  • weixin_39600400 weixin_39600400 4月前

    monexit is not required to be under a treetop - it can be at the top level and a moment can be under a treetop I believe.

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

    Is there a reason why one may choose to anchor such nodes under a treetop as opposed to the nodes themselves being TreeTop nodes?

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

    Both monent and monexit can themselves be treetops as far as I know. Maybe your monexit used to be under a nullchk that was later removed and replaced with that treetop node?

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

    Maybe your monexit used to be under a nullchk that was later removed and replaced with that treetop node?

    Bingo. This was the case exactly. Interesting that we have a NULLCHK on the monexit rather than the monent though. Here is what the ILGen trees looked like:

    
    n1n       BBStart <block_2>
    n15n      astore  <temp slot holds monitoredobject syncmethod>
    n14n        aload  this
    n13n      monent  jitMethodMonitorEntry[#178  helper Method] [flags 0x400 0x0 ] (syncMethodMonitor )
    n12n        aload  this
    n6n       compressedRefs                                                     
    n4n         aloadi  com/ibm/jtc/test/jltf/logging/LoggingSystem$ConfigurationNodeImpl.configuration [Lcom/ibm/jtc/test/jltf/logging/LoggingConfiguration;
    n3n           aload  this
    n5n         lconst 0                                                               
    n8n       monexitfence                                                             
    n10n      NULLCHK on n7n [#30]                                                     
    n9n         monexit  jitMethodMonitorExit[#33  helper Method] [flags 0x400 0x0 ] (syncMethodMonitor )
    n7n           aload  this
    n11n      areturn                                                                      
    n4n         ==>aloadi
    n2n       BBEnd </temp></block_2>                                                     
    
    点赞 评论 复制链接分享
  • weixin_39647458 weixin_39647458 4月前

    There's some great information here which I've tried to capture in PR #512. It's a very rough start at an FAQ for these kinds of questions.

    As this question appears to have been answered, I'm closing this issue.

    点赞 评论 复制链接分享

相关推荐