RFR: 8356447: Change default for EagerJVMCI to true

Doug Simon dnsimon at openjdk.org
Mon May 12 20:17:02 UTC 2025


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.

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

Commit messages:
 - only fail-fast for a missing JVMCI compiler on a HotSpot JIT thread
 - default EagerJVMCI to true if UseJVMCICompiler is true

Changes: https://git.openjdk.org/jdk/pull/25121/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25121&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8356447
  Stats: 34 lines in 6 files changed: 31 ins; 0 del; 3 mod
  Patch: https://git.openjdk.org/jdk/pull/25121.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/25121/head:pull/25121

PR: https://git.openjdk.org/jdk/pull/25121


More information about the graal-dev mailing list