Graal JIT and the JVM Compiler Interface (JVMCI)
In the previous sections, as we walked through the various features and advancements that JIT compilers underwent, it is very clear that C2 is very sophisticated. However, C2 compiler implementation has its downsides. C2 is implemented in the C/C++ language. While C/C++ is fast, it is not type-safe and it does not have garbage collection. Hence, the code becomes very complex. C2 implementation is very complex, as it has become more and more complex to change the code for new enhancements and bug fixes.
In the meantime, Java has matured to run as fast as C/C++ in many cases. Java is type-safe with garbage collection. Java is simpler and easier to manage than C/C++. The key advantages of Java are its exception handling capabilities, memory management, better IDE/profiling, and tooling support. The JIT compiler is nothing but a program that takes in a bytecode, byte[]
, optimizes it, compiles it, and returns an array of machine code,...