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

David Holmes dholmes at openjdk.org
Thu Jun 1 03:08:07 UTC 2023


On Wed, 31 May 2023 23:26:17 GMT, Doug Simon <dnsimon at openjdk.org> wrote:

>> Use of the Graal-based JIT in OpenJDK currently requires the following flag: `-XX:+EnableJVMCIProduct`
>> 
>> This has no direct association with Graal. If the JDK image happens to include a non-Graal JVMCI implementation, it will be automatically selected. This would come as a surprise to users who equate JVMCI with Graal.
>> 
>> This PR introduces a new flag, `-XX:+UseGraalJIT` to address these shortcomings. It is an alias for `-XX:+EnableJVMCIProduct -Djvmci.Compiler=graal`. 
>> 
>> When `-XX:+UseGraalJIT` is specified, the VM fails fast at startup if there is a non-Graal JVMCI implementation or no JVMCI implementation in the JDK image.
>
> Doug Simon has updated the pull request incrementally with five additional commits since the last revision:
> 
>  - improve error message when UseGraalJIT is used without -XX:+UnlockExperimentalVMOptions
>  - use strncmp instead of strcmp
>  - fix date in copyright header
>  - set UseGraalJIT value in enable_jvmci_product_mode
>  - added missing test of UseJVMCICompiler when adjusting JVMCI flags under -Xint

The changes here seem fine, but I remain concerned about the compiler detection logic that presently exists. I can run trivial "programs" using `-XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCIProduct -Djvmci.Compiler=graal` and there is no error. That means that JIT compilation is not kicking in during VM init and that application code is being executed prior to the VM aborting! That is very wrong behaviour IMO, but it is pre-existing so would need to be addressed in separate bug.

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

Marked as reviewed by dholmes (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/14231#pullrequestreview-1454472386


More information about the hotspot-dev mailing list