I'm reading JEP 317. It says that Graal (a new experimental Java-based JIT compiler) will be part of JDK 10, but then it says that is already available in JDK 9. So, what's the point of JEP 317 then? Does Java 9 include Graal or not?
GraalVM is a tool for developers to write and execute Java code. Specifically, GraalVM is a Java Virtual Machine (JVM) and Java Development Kit (JDK) created by Oracle. It is a high-performance runtime that provides improvements in application performance and efficiency.
Run Java Faster GraalVM takes over the compilation of Java bytecode to machine code. In particular for other JVM-based languages such as Scala, this configuration can achieve benefits, as for example experienced by Twitter running GraalVM in production.
Besides the Truffle framework, GraalVM incorporates its optimizing compiler into an advanced ahead-of-time (AOT) compilation technology – Native Image – which translates Java and JVM-based code into a native platform executable.
From one of my memos, on linux-x64 (out-of-the-box) to use Graal on JDK 9, you can enable it using :
-XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+UseJVMCICompiler
Source: Tweet from Chris.
If you're explicitly willing to make use of the org.graalvm.*
classes, they are not present in the JDK-9 build except for the Linux distribution here and the JEP-317#Experimental Java-Based JIT Compiler's status also reads something similar.
Status Integrated Scope JDK Release 10
Update:- To use Graal on JDK10, one can enable it using:-
-XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+UseJVMCICompiler -Djvmci.Compiler=graal
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With