GraalVM - New JIT Compiler and Polyglot Runtime for the JVM

Graal is a new just-in-time compiler for the JVM focused on peak performance and multi-language support. Graal offers performance advantages not only to Java code, but also to scripting languages such as JavaScript, Ruby, and R. Additionally, it enables the execution of native code on the JVM via an LLVM-based front end (project Sulong). Languages are executed by Graal via the Truffle framework, which comes with seamless interoperability and polyglot debugging and profiling functionality.

Usage

GraalVM requires the JAVA_HOME environment variable to point to a JVMCI enabled Java Development Kit or Java Runtime. Oracle Labs JDK is a JVMCI enabled version of JDK 8 which can be used to run GraalVM. Alternatively, a JVMCI enabled JDK or JRE can be placed in the folder ./jdk or ./jre to override the JAVA_HOME environment variable. Please note that JDK 9 builds are not yet compatible. The bin directory contains:
  • java - Runs the JVM with Graal as the default compiler.
  • graalvm - Runs the JVM in polyglot mode with JavaScript, Ruby, and R as available languages.
  • js - Runs a JavaScript console with Graal.js.
  • node - Drop-in replacement for node.js with Graal.js as the executing JavaScript engine.
  • ruby - Drop-in replacement for MRI Ruby with TruffleRuby as the executing Ruby engine.
  • R - Drop-in replacement for GNU R with FastR as the executing R engine.
  • aot-image - Builds an ahead-of-time compiled executable or a shared library from Java programs, and the JavaScript and Ruby languages.

 Benefits 

  • Performance - Graal incorporates our research on compiler technology, and offers better peak performance on some workloads than a traditional JVM.
  • Polyglot - Java, JavaScript, Ruby, and R are all available at competitive performance within the same execution environment.
  • Interoperability - Languages executed in Graal can call each other without overhead and libraries from other languages can be used.
  • Embeddability - Embed dynamic languages and native code with sandboxing capabilities.
  • Tooling - Graal benefits from JVM-based tooling and all languages share common tooling such as debugging and profiling.

JVMCI JDK 8

In addition to the above JDK that includes Graal and additional language runtimes, an alternative JDK is available on the downloads page that only includes JVMCI and can be used for experimenting with Graal or other JVMCI based compilers without embedding the JVMCI compiler in the JDK.