RFR: 8309136: [JVMCI] add -XX:+UseGraalJIT flag [v2]

Doug Simon dnsimon at openjdk.org
Wed May 31 23:26:20 UTC 2023


On Wed, 31 May 2023 22:09:12 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

> Why this restriction? Usually latest specified flag wins. May be comment with explanation.

This is a pre-existing restriction on `EnableJVMCIProduct` and since `UseGraalJIT` is an alias for `EnableJVMCIProduct`, it must abide by the same restrictions. For whatever reason, the effect of `+EnableJVMCIProduct` cannot be undone and so the same must hold for `+UseGraalJIT`.

> Also you did not check for `if (UseGraalJIT)`.

This check is not necessary as `UseGraalJIT` is an alias. When `EnableJVMCIProduct` is set to true, `UseGraalJIT` will also be set to true. Stating this now, I see that I missed it: https://github.com/openjdk/jdk/pull/14231/commits/430b7a58975f49f02de0f0eeb6de5267ee461558

> What about the case -XX:+EnableJVMCIProduct -XX:-UseGraalJIT?

That results in:

-XX:-EnableJVMCIProduct or -XX:-UseGraalJIT cannot come after -XX:+EnableJVMCIProduct or -XX:+UseGraalJIT
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

which is what is expected.

> test/hotspot/jtreg/compiler/jvmci/TestEnableJVMCIProduct.java line 78:
> 
>> 76:             new Expectation("UseJVMCICompiler", "false", "default"));
>> 77:         test("-XX:+EnableJVMCIProduct",
>> 78:             new Expectation("EnableJVMCIProduct", "true", "(?:command line|jimage)"),
> 
> What "(?:command line|jimage)" means? Also `|` hard to see.

That's a standard Java regular expression and it means the value is expected have been set on the command line or by the VM options read from the jimage (see [JDK-8232080](https://bugs.openjdk.org/browse/JDK-8232080)).

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14231#discussion_r1212407808
PR Review Comment: https://git.openjdk.org/jdk/pull/14231#discussion_r1212409301


More information about the hotspot-dev mailing list