🔥 Burn Fat Fast. Discover How! 💪

Compilation Levels #compilation #jvm #jit Even though the JVM | Java Tech News

Compilation Levels
#compilation #jvm #jit
Even though the JVM works with only one interpreter and two JIT compilers, there are five possible levels of compilation:
0. Interpreted Code
1. Simple C1 Compiled Code —
no profiling, trivial method compilation
2. Limited C1 Compiled Code — C1 compiler with light profiling
3. Full C1 Compiled Code — default compilation path with full profiling
4. C2 Compiled Code — compiled code is considered fully optimized, the JVM stops collecting profiling information

In summary, the JVM initially interprets a method during Tier0 until its invocations reach the Tier3. Then, it compiles the method using the C1 compiler while profiling information continues to be collected. Finally, the JVM compiles the method using the C2 compiler when its invocations reach the Tier4. Eventually, the JVM may decide to deoptimize the C2 compiled code. That means that the complete process will repeat from Tier0
https://www.baeldung.com/jvm-tiered-compilation