RFR: 8356447: Change default for EagerJVMCI to true

Vladimir Kozlov kvn at openjdk.org
Mon May 12 20:39:51 UTC 2025


On Thu, 8 May 2025 14:44:55 GMT, Doug Simon <dnsimon at openjdk.org> wrote:

> By default, JVMCI and Graal initialization only occurs on the first top-tier (i.e. tier 4) JIT compilation request. This made sense prior to libgraal where the initialization was interpreted and so noticeably contributed to VM startup. However, with libgraal the initialization is sufficiently fast to not impact startup noticeably.
> 
> The motivation for JVMCI and Graal eager initialization by default is to make Graal command line option processing happen in the same VM phase as handling of all other VM command line flags. That is, errors in Graal options should:
> 1. Happen deterministically, not just for apps that run long enough to trigger a top tier JIT compilation. For example: `java -XX:+UnlockExperimentalVMOptions -XX:+UseGraalJIT --version`. In a JDK build that does not include Graal, this may succeed (and print out the version info) or result in a VM error ("Cannot use JVMCI compiler: No JVMCI compiler found").
> 2. Stop the VM before any application code can be executed. This is just good hygiene.
> 
> This PR makes JVMCI initialization eager by default if `UseJVMCICompiler` is true.
> This is done for both libgraal and jargraal so that the behavior is uniform. Since jargraal is now a development configuration, VM startup costs are not critical.

src/hotspot/share/jvmci/jvmci_globals.cpp line 91:

> 89:     if (FLAG_IS_DEFAULT(EagerJVMCI) && !EagerJVMCI) {
> 90:       FLAG_SET_DEFAULT(EagerJVMCI, true);
> 91:     }

The default value is `false` - I don't think you need check it.
You can use `FLAG_SET_ERGO_IF_DEFAULT(EagerJVMCI, true);`

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25121#discussion_r2085425314


More information about the graal-dev mailing list