RFR: 8345826: Do not automatically resolve jdk.internal.vm.ci when libgraal is used
Doug Simon
dnsimon at openjdk.org
Thu May 15 21:54:17 UTC 2025
The `EnableJVMCI` flag currently serves 2 purposes:
* Guards VM code ([example](https://github.com/openjdk/jdk/blob/b1e778d9d2ad13ee5f1ed629a8805008580f86c0/src/hotspot/share/runtime/sharedRuntime.cpp#L652)).
* [Adds](https://github.com/openjdk/jdk/blob/b1e778d9d2ad13ee5f1ed629a8805008580f86c0/src/hotspot/share/runtime/arguments.cpp#L1804) `jdk.internal.vm.ci` to the root module set.
This PR changes nothing about the first point.
On the second point, to use the `jdk.internal.vm.ci` module, it must now be explicitly added with `--add-modules=jdk.internal.vm.ci`, which will also set `EnableJVMCI` as a side-effect.
The primary motivation is to make use of libgraal compatible with `-XX:+AOTClassLinking`. This flag relies on an archive of the root module set created in a separate JVM execution. If the root module set is different than what's in the archive at runtime, the AOTClassLinking [optimizations](https://bugs.openjdk.org/browse/JDK-8342279) are disabled. As `jdk.internal.vm.ci` is not resolved when creating the archive, it must not be resolved in the runtime using the archive. As such, `-XX:+EnableJVMCI` must not cause resolution of `jdk.internal.vm.ci` for libgraal to have the startup advantages of AOTClassLinking.
-------------
Commit messages:
- added comment in check_vm_args_consistency
- --add-modules=jdk.internal.vm.ci implies -XX:+EnableJVMCI
Changes: https://git.openjdk.org/jdk/pull/25240/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25240&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8345826
Stats: 63 lines in 10 files changed: 45 ins; 5 del; 13 mod
Patch: https://git.openjdk.org/jdk/pull/25240.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/25240/head:pull/25240
PR: https://git.openjdk.org/jdk/pull/25240
More information about the graal-dev
mailing list