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

Ioi Lam iklam at openjdk.org
Fri Aug 22 04:03:19 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 incrementally with one additional commit since the last revision:

  @vnkozlov comments -- added AOTMapTest.java

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/26514/files
  - new: https://git.openjdk.org/jdk/pull/26514/files/4cc90093..cc42967c

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

  Stats: 123 lines in 1 file changed: 123 ins; 0 del; 0 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