RFR: 8362566: Use -Xlog:aot+map to print contents of existing AOT cache [v8]

Ioi Lam iklam at openjdk.org
Wed Aug 27 02:20:35 UTC 2025


> Implement `-Xlog:aot+map` in the production run:
> 
> 
> $ java -cp HelloWorld.jar -XX:AOTCache=HelloWorld.aot \
>     -Xlog:aot+map=file=aot.map:none:filesize=0 \
>     HelloWorld
> 
> 
> I moved the old logging code from archiveBuilder.cpp into a new fille, aotMapLogger.cpp. I did the following to print the map in the production run:
> 
> 1. When dumping the AOT cache, `ArchiveBuilder` maintains a list of all the metaspace objects in the archive. However, there's no such list when we are loading from the AOT cache. Therefore, I added a new `RuntimeGatherArchivedMetaspaceObjs` class to discover all the metaspace objects that are stored in the AOT cache.
> 2. A significant rewrite is needed for printing the oops (see comments around `FakeOop`) because we only have an image of the oops in the AOT cache and these aren't real heap objects.

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 25 additional commits since the last revision:

 - Added test for -Xlog:aot+map with dynamic archive
 - Merge branch 'master' into 8362566-log-aot-map-for-existing-aot-cache
 - Added comment about why -Xlog:aot+map,...,filesize=0 is needed
 - @vnkozlov comments -- added AOTMapTest.java
 - Fixed crash with ZGC
 - Fixed Windows crashes
 - Fixed include order
 - make CDSMapTest.java flagless
 - Added test case for -Xlog:aot+map in production run
 - more clean up
 - ... and 15 more: https://git.openjdk.org/jdk/compare/13405606...223771b5

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/26514/files
  - new: https://git.openjdk.org/jdk/pull/26514/files/16895a2a..223771b5

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=26514&range=07
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26514&range=06-07

  Stats: 16910 lines in 642 files changed: 10104 ins; 4431 del; 2375 mod
  Patch: https://git.openjdk.org/jdk/pull/26514.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/26514/head:pull/26514

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


More information about the hotspot-dev mailing list