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

Ioi Lam iklam at openjdk.org
Tue Jul 22 15:54:58 UTC 2025


> This fixes crashes when using `-Xlog:aot+map=trace,aot+map+oops=trace:file=aot.oops.txt:none:filesize=0` during the assembly phase.
> 
> I basically changed a few raw `oop` pointers to `OopHandle`. I also simplified `ArchiveHeapWriter::is_marked_as_native_pointer()`.
> 
> Note that for `HeapShared::archived_object_cache()`, I calculate the hashcode using the raw oop. This way, we can avoid calling `oopDesc::identity_hash()` for every archived oops. As a result, when we use this table after exiting the CDS safepoint, we must rehash it. See changes in `ArchiveBuilder::CDSMapLogger::log()`.
> 
> - It might be alright to pre-calculate the identity hash of the archived oops in the assembly phase, but I think we should do that only if we find a reason to do so. We shouldn't do it just because it's convenient for implementing an internal table,

Ioi Lam has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision:

 - Fixed crash in runtime/cds/CDSMapTest.java with -XX:+UseZGC
 - Merge branch 'premain' into 8362657-make-aot-assembly-tables-gc-safe
 - Fixed 32-bit builds
 - Merge branch 'premain' into 8362657-make-aot-assembly-tables-gc-safe
 - Fixed white spaces
 - 8362657: Make tables used in AOT assembly phase GC-safe

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

Changes:
  - all: https://git.openjdk.org/leyden/pull/86/files
  - new: https://git.openjdk.org/leyden/pull/86/files/dbfdba9c..017d1085

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=leyden&pr=86&range=02
 - incr: https://webrevs.openjdk.org/?repo=leyden&pr=86&range=01-02

  Stats: 15 lines in 3 files changed: 12 ins; 1 del; 2 mod
  Patch: https://git.openjdk.org/leyden/pull/86.diff
  Fetch: git fetch https://git.openjdk.org/leyden.git pull/86/head:pull/86

PR: https://git.openjdk.org/leyden/pull/86


More information about the leyden-dev mailing list