Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GraalVM as JIT compiler for ARM JRE

Tags:

java

graalvm

Is someone know if GraalVM can be used as a JIT Compiler in an OpenJDK distribution for ARM architecture ?

The releases available on graalVM github precise AMD architecture and github ARM related issues are related to native image creation (so AOT compiler for ARM). Maybe an additional question : If they succeed in native Image creation for arm, does it mean that GraalVM will also be available as JIT compiler for arm ? Or the 2 things are independants ? I begin in compiler ecosystem :)

Thx a lot for your answer.

like image 527
colin aygalinc Avatar asked Feb 15 '19 08:02

colin aygalinc


People also ask

Why GraalVM?

Why GraalVM? GraalVM is a high-performance runtime that provides significant improvements in application performance and efficiency which is ideal for microservices. It is designed for applications written in Java, JavaScript, LLVM-based languages such as C and C++, and other dynamic languages.

Is GraalVM a compiler?

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.

Is GraalVM production ready?

GraalVM is production-ready software, available as Community Edition for an open-source license and as Oracle GraalVM Enterprise Edition accessible by accepting the OTN License Agreement Oracle GraalVM Enterprise Edition Including License for Early Adopter Versions.


2 Answers

Edit: I forgot, see Jorn Vernees answer, OpenJDK 11 already contains Graal JIT.

The Graal JIT compiler works on ARM as well and can be used with OpenJDK. It does not work with OpenJDK 8. OpenJDK 9 and 10 may work. I would recommend to use it with OpenJDK 11 (e.g adoptopenjdk). Truffle languages (Javascript, Python, ...) are untested on this architecture. The easiest way to get graal JIT running on AArch64 to build it from source:

See also README

export JAVA_HOME=/path/to/jdk-11
git clone https://github.com/oracle/graal.git
git clone https://github.com/graalvm/mx.git
export PATH=$(pwd)/mx:$PATH
cd graal/compiler
mx build
mx vm -cp test.jar org.something.Main

In order to see the full commandline required for running java with graal JIT, you may run the mx -v vm -cp test.jar org.something.Main.

Regarding your second question: It is exactly the other way around. The JIT compiler is already there and now we are working on getting the native-image feature available for AArch64.

I hope this answers your questions.

Stefan

like image 118
Stefan Anzinger Avatar answered Oct 02 '22 13:10

Stefan Anzinger


The Graal JIT compiler (not the VM) is also include in OpenJDK 11 as an experimental feature, I think for ARM as well. The version in OpenJDK will be a little behind the one in the github/oracle/graal repo, as it only gets updated periodically, but the advantage is that it only takes a few command line flags to use. It can be turned on by passing the following VM flags when running an application:

-XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+UseJVMCICompiler
like image 21
Jorn Vernee Avatar answered Oct 02 '22 13:10

Jorn Vernee