问题
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.
回答1:
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
回答2:
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
来源:https://stackoverflow.com/questions/54705341/graalvm-as-jit-compiler-for-arm-jre