目前OpenJDK公开的文档中只是对Compiler1和Compiler2做了解释,对Core并没有太多的解释。
先看官方的解释
C1 compiler
Fast, lightly optimizing bytecode compiler.
Performs some value numbering, inlining, and class analysis.
Uses a simple CFG-oriented SSA "high" IR, a machine-oriented "low" IR,
a linear scan register allocation, and a template-style code generator.
C2 compiler
Highly optimizing bytecode compiler, also known as 'opto'.
Uses a "sea of nodes" SSA "ideal" IR, which lowers to a machine-specific IR of the same kind. Has a graph-coloring register allocator; colors all machine state, including local, global, and argument registers and stack.
Optimizations include global value numbering, conditional constant type propagation,
constant folding, global code motion, algebraic identities, method inlining (aggressive, optimistic, and/or multi-morphic), intrinsic replacement, loop transformations (unswitching, unrolling), array range check elimination.
简单地说就是,
Compiler1对应于client JVM(\jre\bin\client\jvm.dll),
Compiler2对应于server JVM(\jre\bin\server\jvm.dll)。
关于Core
因为没有找到官方的资料,我只能凭我阅读代码的印象讲讲了。
看一处典型的代码
\hotspot\src\share\vm\runtime\thread.cpp Line 3196 (Threads::create_vm)
#ifndef CORE
// initialize compiler(s)
CompileBroker::compilation_init();
#endif // CORE
也就是说在Core模式下JIT编译器不会被启用。