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

Vladimir Ivanov vlivanov at openjdk.org
Wed Aug 27 04:29:57 UTC 2025


On Wed, 27 Aug 2025 02:20:35 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> 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/8a26ec52...223771b5

Marked as reviewed by vlivanov (Reviewer).

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

PR Review: https://git.openjdk.org/jdk/pull/26514#pullrequestreview-3158218513


More information about the hotspot-dev mailing list