gpt4 book ai didi

java PrintCompilation 输出 : what's the meaning of "made not entrant" and "made zombie"

转载 作者:IT老高 更新时间:2023-10-28 20:45:39 25 4
gpt4 key购买 nike

在运行 Java 1.6 (1.6.0_03-b05) 应用程序时,我添加了 -XX:+PrintCompilation 标志。在某些方法的输出中,尤其是我知道的一些方法被调用了很多,我看到文本 made not entrantmadezombie

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

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

[... 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 上收集了一些关于此的信息.我发现的一条 Cliff Click 评论说:

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 输出 : what's the meaning of "made not entrant" and "made zombie",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2930838/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com