On Fri, 13 Mar 2026 10:03:32 GMT, Damon Fenacci <[email protected]> wrote:

>> # Issue
>> AOT‑cached c2i adapters can mis-handle inline‑buffer oops when the JVM runs 
>> with a different compressed‑oops mode than the one used when the AOT cache 
>> was created, leading to wrong object decoding and test failures/crashes.
>> 
>> # Cause
>> Adapters only need this special handling in Valhalla because inline types 
>> are flattened and require heap buffers during c2i transitions, which are 
>> decoded inside the adapter. If the runtime compressed‑oops settings 
>> (UseCompressedOops, shift, base) differ from the AOT‑creation settings, the 
>> adapter decodes those oops incorrectly (non‑Valhalla adapters don’t decode 
>> inline‑buffer oops, so they don’t hit this path).
>> 
>> # Fix
>> During AOT cache verification, if we detect any mismatch in compressed‑oops 
>> flag, shift, or base, we disable AOT adapter caching, forcing adapters to be 
>> regenerated at runtime with the correct configuration (this mirrors what the 
>> VM already does for AOT stub caching). Logging has been slightly modified 
>> for consistency.
>> 
>> # Testing
>> Tier 1-3+
>> JBS issue failing tests using `--enable-preview`
>> `test/hotspot/jtreg/runtime/cds/appcds/aotCode/AOTCodeCompressedOopsTest.java`
>>  had to be adapted to reflect the modified log
>
> Damon Fenacci has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   JDK-8377351: add InlineTypePassFieldsAsArgs condition

Looks good to me otherwise.

src/hotspot/share/code/aotCodeCache.cpp line 513:

> 511:   // The following checks do not affect AOT code, but can disable
> 512:   // AOT stub/adapters caching if they are incompatible with runtime 
> settings
> 513:   // (adapters too as they decode flattened inline types during c2i 
> transitions).

Suggestion:

  // (adapters too as they access oops when buffering scalarized value objects).

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

Marked as reviewed by thartmann (Committer).

PR Review: 
https://git.openjdk.org/valhalla/pull/2217#pullrequestreview-3944752522
PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2217#discussion_r2931839103

Reply via email to