RFR: 8345826: Do not automatically resolve jdk.internal.vm.ci when libgraal is used [v3]

Ioi Lam iklam at openjdk.org
Fri May 16 15:18:51 UTC 2025


On Fri, 16 May 2025 13:49:26 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> I've pushed a commit that implements your suggestion and reduces the size of the overall change nicely. More importantly, I think it's a better design - thanks!
>
> I like this latest version!

I ran a recent build of Oracle JDK 25 that has libjvmcicompiler.so (not including your changes):


$ ./bin/java -XX:+UnlockExperimentalVMOptions -XX:+UseGraalJIT -XX:+PrintFlagsFinal --version | \
        egrep '(EnableJVMCI)|(UseJVMCICompiler)|(UseJVMCINativeLibrary)'
     bool EnableJVMCI           = true    {JVMCI product} {default}
     bool EnableJVMCIProduct    = true    {JVMCI product} {command line}
     bool UseJVMCICompiler      = true    {JVMCI product} {default}
     bool UseJVMCINativeLibrary = true    {JVMCI product} {default}
$ ./bin/java -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+PrintFlagsFinal --version | \
        egrep '(EnableJVMCI)|(UseJVMCICompiler)|(UseJVMCINativeLibrary)'
     bool EnableJVMCI           = true    {JVMCI experimental} {command line}
     bool EnableJVMCIProduct    = false   {JVMCI experimental} {default}
     bool UseJVMCICompiler      = false   {JVMCI experimental} {default}
     bool UseJVMCINativeLibrary = true    {JVMCI experimental} {default}


So If you specify only `-XX:+EnableJVMCI` in the command-line, `UseJVMCINativeLibrary` will be true. As a result, with your latest version, the `jdk.internal.vm.ci` module is not added.

If you have an app that wants to use the jdk.internal.vm.ci API, you must specify both `-XX:+EnableJVMCI` and `
 --add-modules=jdk.internal.vm.ci`. Is this intentional?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25240#discussion_r2093246382


More information about the graal-dev mailing list