Integrated: 8345826: Do not automatically resolve jdk.internal.vm.ci when libgraal is used
Doug Simon
dnsimon at openjdk.org
Wed May 21 19:24:01 UTC 2025
On Wed, 14 May 2025 22:00:30 GMT, Doug Simon <dnsimon at openjdk.org> wrote:
> 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 when libgraal is enabled, `-XX:+EnableJVMCI` must be explicitly specified to the launcher (as opposed to being true as a result of [`-XX:+UseJVMCICompiler`](https://github.com/openjdk/jdk/blob/76570c627db527f856f2394fb9ead02939eca621/src/hotspot/share/jvmci/jvmci_globals.cpp#L88) or [`-XX:+EnableJVMCIProduct`](https://github.com/openjdk/jdk/blob/76570c627db527f856f2394fb9ead02939eca621/src/hotspot/share/jvmci/jvmci_globals.cpp#L64)). Alternatively, `--add-modules=jdk.internal.vm.ci` can be specified - it has the same semantics as `-XX:+EnableJVMCI`.
> If libgraal is not enabled, +EnableJVMCI will continue to add `jdk.internal.vm.ci` to the root module set.
>
> The primary motivation is to make use of libgraal compatible with `-XX:+AOTClassLinking`. This flag relies on the root module set archive created in a training run. If the root module set is different in the production run, the AOTClassLinking [optimizations](https://bugs.openjdk.org/browse/JDK-8342279) are disabled. As `jdk.internal.vm.ci` is not resolved in the training run, it must not be resolved in production run. As such, `-XX:+EnableJVMCI` must not cause resolution of `jdk.internal.vm.ci`, otherwise libgraal will not have the startup advantages of AOTClassLinking.
>
> Graal adaption PR: https://github.com/oracle/graal/pull/11212
This pull request has now been integrated.
Changeset: 81536830
Author: Doug Simon <dnsimon at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/81536830ed096005c4f09ab446238ce50989cea9
Stats: 54 lines in 8 files changed: 31 ins; 15 del; 8 mod
8345826: Do not automatically resolve jdk.internal.vm.ci when libgraal is used
Reviewed-by: iklam, never, kvn
-------------
PR: https://git.openjdk.org/jdk/pull/25240
More information about the graal-dev
mailing list