java PrintCompilation输出:“made not entrant”和“made zombie”的意思是什么?

当运行Java 1.6(1.6.0_03-b05)应用程序时,我添加了-XX:PrintCompilation标志。在一些方法的输出,特别是我知道的一些方法被调用了很多,我看到文本不进入和制造僵尸。

这些是什么意思?最好的猜测是,它是一个反编译步骤之前重新编译该方法或依赖与更大的优化。真的吗?为什么“僵尸”和“进入”?

例如,在这些行之间有相当长的时间:

[... near the beginning]
42       jsr166y.LinkedTransferQueue::xfer (294 bytes)

[... much later]
42    made not entrant  jsr166y.LinkedTransferQueue::xfer (294 bytes)
---   n   sun.misc.Unsafe::compareAndSwapObject
170       jsr166y.LinkedTransferQueue::xfer (294 bytes)
170   made not entrant  jsr166y.LinkedTransferQueue::xfer (294 bytes)
  4%      jsr166y.LinkedTransferQueue::xfer @ 29 (294 bytes)
171       jsr166y.LinkedTransferQueue::xfer (294 bytes)

[... even later]
42    made zombie  jsr166y.LinkedTransferQueue::xfer (294 bytes)
170   made zombie  jsr166y.LinkedTransferQueue::xfer (294 bytes)
171   made not entrant  jsr166y.LinkedTransferQueue::xfer (294 bytes)
172       jsr166y.LinkedTransferQueue::xfer (294 bytes)

[... no further logs]
最佳答案
我已经拉在一起一些信息在这上my blog.悬崖点击评论我发现说:

Zombie methods are methods whose code has been made invalid by class loading. Generally the server compiler makes aggressive inlining decisions of non-final methods. As long as the inlined method is never overridden the code is correct. When a subclass is loaded and the method overridden, the compiled code is broken for all future calls to it. The code gets declared “not entrant” (no future callers to the broken code), but sometimes existing callers can keep using the code. In the case of inlining, that’s not good enough; existing callers’ stack frames are “deoptimized” when they return to the code from nested calls (or just if they are running in the code). When no more stack frames hold PC’s into the broken code it’s declared a “zombie” – ready for removal once the GC gets around to it.

转载注明原文:java PrintCompilation输出:“made not entrant”和“made zombie”的意思是什么? - 代码日志