As part project Galahad, the Graal module will be renamed from jdk.internal.vm.compiler to jdk.compiler.graal. This presents a few issues:
1. There are qualified exports from JVMCI to jdk.internal.vm.compiler[1]. Qualified exports from a boot module require the target module to be upgradeable which is indeed the case for jdk.internal.vm.compiler[2].
2. Graal provides an implementation of jdk.vm.ci.services.JVMCIServiceLocator which requires the above qualified export. Exporting JVMCI with --add-exports on the java command line does not work as service binding for the boot modules[3] is done before processing of --add-exports[4]. This results in:
Error occurred during initialization of boot layer
java.lang.module.ResolutionException: Module jdk.compiler.graal does not read a module that exports jdk.vm.ci.services
3. Even if the above use of --add-exports worked with the java launcher, there is no equivalent option for jlink. This means the GraalVM image cannot be created from an existing JDK binary with jlink.
These problems need to be addressed before any name other than jdk.internal.vm.compiler can be used for the Graal compiler module.
[1] https://github.com/openjdk/jdk/blob/c1f698d38bb251941598af5a82a1a230282b718d/src/jdk.internal.vm.ci/share/classes/module-info.java#L30-L35
[2] https://github.com/openjdk/jdk/blob/c1f698d38bb251941598af5a82a1a230282b718d/make/conf/module-loader-map.conf#L63
[3] https://github.com/openjdk/jdk/blob/c1f698d38bb251941598af5a82a1a230282b718d/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java#L383
[4] https://github.com/openjdk/jdk/blob/c1f698d38bb251941598af5a82a1a230282b718d/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java#L458
1. There are qualified exports from JVMCI to jdk.internal.vm.compiler[1]. Qualified exports from a boot module require the target module to be upgradeable which is indeed the case for jdk.internal.vm.compiler[2].
2. Graal provides an implementation of jdk.vm.ci.services.JVMCIServiceLocator which requires the above qualified export. Exporting JVMCI with --add-exports on the java command line does not work as service binding for the boot modules[3] is done before processing of --add-exports[4]. This results in:
Error occurred during initialization of boot layer
java.lang.module.ResolutionException: Module jdk.compiler.graal does not read a module that exports jdk.vm.ci.services
3. Even if the above use of --add-exports worked with the java launcher, there is no equivalent option for jlink. This means the GraalVM image cannot be created from an existing JDK binary with jlink.
These problems need to be addressed before any name other than jdk.internal.vm.compiler can be used for the Graal compiler module.
[1] https://github.com/openjdk/jdk/blob/c1f698d38bb251941598af5a82a1a230282b718d/src/jdk.internal.vm.ci/share/classes/module-info.java#L30-L35
[2] https://github.com/openjdk/jdk/blob/c1f698d38bb251941598af5a82a1a230282b718d/make/conf/module-loader-map.conf#L63
[3] https://github.com/openjdk/jdk/blob/c1f698d38bb251941598af5a82a1a230282b718d/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java#L383
[4] https://github.com/openjdk/jdk/blob/c1f698d38bb251941598af5a82a1a230282b718d/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java#L458
- csr for
-
JDK-8318654 Support alternative name to jdk.internal.vm.compiler
- Closed
- duplicates
-
JDK-8315694 [JVMCI] add exports to new Graal module name
- Closed
- links to
-
Commit openjdk/jdk/bd22d238
-
Review(master) openjdk/jdk/16189
There are no Sub-Tasks for this issue.