What's this new column in -XX:+PrintCompilation output?
Asked Answered
B

1

9

While using -XX:+PrintCompilation recently (JDK 8r111) to examine method compilation, I noticed a new column which doesn't 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 clue what it means? It seems to vary between 0 and 3, with native methods always 0, and other methods always non-zero.

Benniebenning answered 14/12, 2016 at 2:50 Comment(4)
alexandrastech.blogspot.com/2016/06/…Turman
@SotiriosDelimanolis - answered my question, so it's good enough for an answer.Benniebenning
I'm no expert on the compiler levels. I'll let someone with more experience give a more detailed answer.Turman
@SotiriosDelimanolis - fair enough. If no one does I'll write it myself. To be fair, you don't necessarily need to be an expert to write an answer, but I appreciate your comment nonetheless.Benniebenning
O
10

This is a tier in Tiered Compilation mode.

  • At tiers 1, 2, 3 the code is compiled by C1 with different amount of extra profiling. It may sound counterintuitive, but the most optimized of them is tier 1 since it has no profiling overhead (and no chance to be further optimized).
  • At tier 4 the code is compiled by C2. To produce highly optimized code C2 requires execution statistics gathered at tier 3 or during interpretation.

Here is how Tiered Compilation flow looks like. You may find the explanation in this answer.

HotSpot Tiered Compilation

More details can be found in the HotSpot source code comments, 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
Overspread answered 14/12, 2016 at 23:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.