What new column in -XX: + PrintCompilation is output?

When using -XX:+PrintCompilation recently (JDK 8r111) to study the compilation of the method, I noticed a new column that does not appear in the documentation , I can find on the topic:

  this column | | v 600 1 s 3 java.util.Hashtable::get (69 bytes) 601 4 3 java.lang.Character::toLowerCase (6 bytes) 601 8 3 java.io.UnixFileSystem::normalize (75 bytes) 602 12 3 java.lang.ThreadLocal::get (38 bytes) 602 14 3 java.lang.ThreadLocal$ThreadLocalMap::getEntry (42 bytes) 602 18 2 java.lang.String::startsWith (72 bytes) 602 10 4 java.lang.String::equals (81 bytes) 602 2 % 4 java.lang.String::hashCode @ 24 (55 bytes) 602 16 s! 3 sun.misc.URLClassPath::getLoader (197 bytes) 603 23 n 0 java.lang.System::arraycopy (native) (static) 604 27 n 0 sun.misc.Unsafe::getObjectVolatile (native) 

Any sense what that means? It seems to range from 0 to 3, with native methods always 0 and other methods always non-zero.

+5
source share
1 answer

This level is in multi-level compilation mode.

  • At levels 1, 2, 3, the code is compiled C1 with a different amount of additional profiling. This may seem counterintuitive, but the most optimized of them is level 1, since it does not have a profile overhead (and there is no possibility for further optimization).
  • At level 4, the code is compiled C2. Highly optimized C2 code requires execution statistics collected at level 3 or during interpretation.

This is what a layered compilation stream looks like. You can find an explanation in this answer .

HotSpot Layered Compilation

More information can be found in the commentary on the HotSpot source code , which defines the levels as follows:

  • level 0 - interpreter
  • level 1 - C1 with full optimization (no profiling)
  • level 2 - C1 with invocation and backedge counters
  • level 3 - C1 with full profiling (level 2 + MDO)
  • level 4 - C2
+7
source

Source: https://habr.com/ru/post/1261236/


All Articles