RFR: 8344140: Refactor the discovery of AOT cache artifacts [v3]

Ashutosh Mehra asmehra at openjdk.org
Wed Jan 8 04:08:43 UTC 2025


On Wed, 8 Jan 2025 02:41:18 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> src/hotspot/share/cds/metaspaceShared.cpp line 548:
>> 
>>> 546:     FileMapInfo::metaspace_pointers_do(it);
>>> 547:     AOTArtifactFinder::all_cached_classes_do(it);
>>> 548:     SystemDictionaryShared::dumptime_classes_do(it);
>> 
>> There is some duplicatoin of work in `AOTArtifactFinder::all_cached_classes_do()` and `SystemDictionaryShared::dumptime_classes_do()`. all_cached_classes_do() operates on `_all_cached_classes` which is built using `SystemDictionaryShared::_dumptime_table`. So the iteration over `_dumptime_table` in `SystemDictionaryShared::dumptime_classes_do()` seems redundant.
>
> The call to `SystemDictionaryShared::dumptime_classes_do()` is still necessary. It does more than just discovering the classes. It also walks the `DumpTimeClassInfo` with
> 
> 
> info.metaspace_pointers_do(it);
> 
> 
> which will walk the loader constraints, etc.

Right, missed that. Thanks for pointing that out.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22291#discussion_r1906433520


More information about the hotspot-dev mailing list