On Mon, 5 Jun 2023 18:58:36 GMT, Tom Rodriguez <ne...@openjdk.org> wrote:

> I don't really love the hard code parsing of the HashMap. What properties are 
> actually required for JVMCI? It seems to me that the contents of 
> Arguments::system_properties() should contain all the properties we want to 
> advertise to JVMCI. That would have avoid having to decode them after they've 
> been converted into Java objects.

I tired this but unfortunately, Graal relies on some properties that are only 
initialized in Java:

Caused by: java.lang.NullPointerException: Cannot invoke 
"String.compareTo(String)" because "this.javaSpecVersion" is null
        at 
jdk.internal.vm.compiler/org.graalvm.compiler.hotspot.JVMCIVersionCheck.run(JVMCIVersionCheck.java:181)
        at 
jdk.internal.vm.compiler/org.graalvm.compiler.hotspot.JVMCIVersionCheck.check(JVMCIVersionCheck.java:166)
        at 
jdk.internal.vm.compiler/org.graalvm.compiler.hotspot.HotSpotGraalCompilerFactory.initialize(HotSpotGraalCompilerFactory.java:117)
        at 
jdk.internal.vm.compiler/org.graalvm.compiler.hotspot.HotSpotGraalCompilerFactory.ensureInitialized(HotSpotGraalCompilerFactory.java:90)
        at 
jdk.internal.vm.compiler/org.graalvm.compiler.hotspot.HotSpotGraalCompilerFactory.createCompiler(HotSpotGraalCompilerFactory.java:180)
        at 
jdk.internal.vm.compiler/org.graalvm.compiler.hotspot.HotSpotGraalCompilerFactory.createCompiler(HotSpotGraalCompilerFactory.java:53)
        at 
jdk.internal.vm.ci/jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.getCompiler(HotSpotJVMCIRuntime.java:810)
        at 
org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.GraalAccess.<clinit>(GraalAccess.java:50)


That code is reading the "java.specification.version" property which is 
initialized in `java.lang.VersionProps#init`.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/14291#issuecomment-1579573072

Reply via email to