RFR: 8351871: Disable JIT compiler when dumping AOT cache with -XX:+AOTClassLinking
Vladimir Kozlov
kvn at openjdk.org
Wed Mar 12 20:34:52 UTC 2025
On Wed, 12 Mar 2025 20:06:15 GMT, Ioi Lam <iklam at openjdk.org> wrote:
> Since [JDK-8348426](https://bugs.openjdk.org/browse/JDK-8348426), when creating the AOT cache with -XX:AOTMode=create, at the very end of normal Java execution, right before we enter the safepoint VM_PopulateDumpSharedSpace, we reset the states of a few Java objects.
>
> Such reset operations can cause the JIT to observe inconsistent states.
>
> While working on a proper fix, this PR is a work-around that disable the JIT during AOT cache creation.
I am okay with this temporary fix.
We will need compiler in assembly phase to generate AOT code but we should not trigger normal JIT compilation and profiling.
This situation looks similar to what @shipilev did in leyden repo: https://github.com/openjdk/leyden/pull/44
Instead of checking `PreloadOnly` we can check AOTMode+AOTClassLinking state.
-------------
Marked as reviewed by kvn (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/24019#pullrequestreview-2679794390
More information about the hotspot-runtime-dev
mailing list