The Graal compiler is a replacement to HotSpot’s server-side JIT compiler, widely known as the C2 compiler. It is written in Java with the goal of better performance compared to the C2 compiler. New changes, starting with Java 9, mean that we can now plug in our own hand-written C2 compiler into the JVM thanks to JVMCI. The researchers and engineers at Oracle Labs have created a variant of JDK8 with JVMCI enabled, which can be used to build the Graal compiler. The Graal compiler is open source and is available on GitHub (along with the HotSpot JVMCI sources needed to build the Graal compiler). This gives us the ability to fork/clone it and build our own version of the Graal compiler.
In this post, we are going to build the Graal compiler with JDK8 on CircleCI. The resulting artifacts are going to be: