I am trying to experiment with the JVMCI and its existence in the JDK using the following from a mailing list-
private static void JVMCIQueries() {
// Check if the JDK used supports JVMCI?
String vm_version = System.getProperty("java.vm.version");
System.out.printf("java.vm.version = %s%n", vm_version);
HotSpotDiagnosticMXBean bean = ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class);
// Is JVMCI enabled by default?
VMOption enableJVMCI = bean.getVMOption("EnableJVMCI");
System.out.println(enableJVMCI);
// Is the system using the JVMCI compiler for normal compilations?
VMOption useJVMCICompiler = bean.getVMOption("UseJVMCICompiler");
System.out.println(useJVMCICompiler);
// What compiler is selected?
String compiler = System.getProperty("jvmci.Compiler");
System.out.printf("jvmci.Compiler = %s%n", compiler);
}
(edit) With VM arguments as :
-XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+UseJVMCICompiler
Java 10(2018-03-20) Result
java.vm.version = 10+46 VM option: EnableJVMCI value: true origin: VM_CREATION (read-only) VM option: UseJVMCICompiler value: true origin: VM_CREATION (read-only) jvmci.Compiler = null
Java 9.0.4 Result
java.vm.version = 9.0.4+11 VM option: EnableJVMCI value: true origin: VM_CREATION (read-only) VM option: UseJVMCICompiler value: true origin: VM_CREATION (read-only) jvmci.Compiler = null
but this is accompanied by logs which complains
jdk.vm.ci.common.JVMCIError: no JVMCI compiler selected at jdk.internal.vm.ci/jdk.vm.ci.hotspot.HotSpotJVMCICompilerConfig$DummyCompilerFactory.compileMethod(HotSpotJVMCICompilerConfig.java:45) at jdk.internal.vm.ci/jdk.vm.ci.hotspot.HotSpotJVMCICompilerConfig$DummyCompilerFactory.compileMethod(HotSpotJVMCICompilerConfig.java:42) at jdk.internal.vm.ci/jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.compileMethod(HotSpotJVMCIRuntime.java:433)
When with both the versions the jvmci.Compiler
value is null
, what does no JVMCI compiler selected exactly mean here for 9.0.4(why not in 10)?
This might sound silly or unrelated, but am I falling back to the part where I should be aware of Does Java 9 include Graal? ? Since I thought, even if 9.0.4 doesn't, I haven't specified the same on Java10 either(the -Djvmci.Compiler
flag). Any default configurations that might have changed?
Note: Using MacOS(x64) for all of the above.