java PrintCompilation output: what's the meaning of “made not entrant” and “made zombie”

后端 未结 4 2028
忘了有多久
忘了有多久 2021-01-30 11:06

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 g

4条回答
  •  既然无缘
    2021-01-30 11:34

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

    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.

提交回复
热议问题