RFR: 8362657: Make tables used in AOT assembly phase GC-safe

Ioi Lam iklam at openjdk.org
Wed Sep 17 05:04:33 UTC 2025


On Wed, 17 Sep 2025 01:14:41 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Upstreaming from the Leyden prototype in anticipation of AOT code compilation ([JDK-8335368](https://bugs.openjdk.org/browse/JDK-8335368)).
>> 
>> We have a few tables that are currently consulted only inside the CDS safepoint. With AOT code compilation, these tables may be consulted after we leave the CDS safepoint. For GC safety, this PR uses `OopHandle` instead of `oop` in hashtables.
>
> src/hotspot/share/cds/heapShared.cpp line 2130:
> 
>> 2128: // These tables should be used only within the CDS safepoint, so
>> 2129: // delete them before we exit the safepoint. Otherwise the table will
>> 2130: // contain bad oops after a GC.
> 
> So is this just for good code hygiene? I don't see any changes that involve checking these table pointers for null, so presumably no code actually tries to access them outside the safepoint?

Yes, this code is just for code hygiene for now.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27323#discussion_r2354304184


More information about the hotspot-runtime-dev mailing list