java PrintCompilation输出:“make not entrant”的含义是什么?和“制作僵尸” [英] java PrintCompilation output: what's the meaning of "made not entrant" and "made zombie"

查看:839
本文介绍了java PrintCompilation输出:“make not entrant”的含义是什么?和“制作僵尸”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

When running a Java 1.6 (1.6.0_03-b05) app I've added the -XX:+PrintCompilation flag. On the output for some methods, in particular some of those that I know are getting called a lot, I see the text made not entrant and made zombie.

这是什么意思?最好的猜测是,在重新编译该方法或具有更高优化的依赖项之前,它是一个反编译步骤。真的吗?为什么僵尸和参赛者?

What do these mean? Best guess is that it's a decompilation step before recompiling either that method or a dependency with greater optimisation. Is that true? Why "zombie" and "entrant"?

示例,其中一些行之间有相当长的时间:

Example, with quite a bit of time between some of these lines:

[... 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]


推荐答案

我在我的博客。我发现Cliff Click评论说:

I've pulled together some info on this on my blog. A Cliff Click comment I found says:


Zombie方法是通过类加载使代码无效的方法。通常,服务器编译器会对非最终方法做出积极的内联决策。只要内联方法永远不会被覆盖,代码就是正确的。当加载子类并重写方法时,编译的代码将被中断,以便将来调用它。代码被声明为不是参与者(破解代码的未来呼叫者没有),但有时现有的呼叫者可以继续使用代码。在内联的情况下,这不够好;当现有调用者的堆栈帧从嵌套调用返回代码时(或者只是它们在代码中运行时)被去优化。当没有更多的堆栈帧将PC保存到损坏的代码中时,它被声明为僵尸 - 一旦GC到达它就可以移除。

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输出:“make not entrant”的含义是什么?和“制作僵尸”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆