RFR: 8309390: [JVMCI] improve copying system properties into libgraal
Doug Simon
dnsimon at openjdk.org
Tue Jun 6 23:04:55 UTC 2023
On Mon, 5 Jun 2023 18:58:36 GMT, Tom Rodriguez <never at 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
More information about the core-libs-dev
mailing list