RFR: 8309240: Array classes should be stored in dynamic CDS archive [v7]
Ashutosh Mehra
duke at openjdk.org
Tue Aug 1 19:16:54 UTC 2023
On Tue, 1 Aug 2023 17:26:56 GMT, Calvin Cheung <ccheung at openjdk.org> wrote:
>> Please review this RFE for adding array classes in the dynamic CDS archive.
>>
>> During dynamic dump, only the array classes with the `element_klass` already in the static archive will be stored in the dynamic archive. See `ArchiveBuilder::gather_array_klasses()`. It is because the array classes which are in the same archive (either static or dynamic) are already "connected" together. Higher dimension primitive array classes are also stored in the dynamic archive. Note that one-dimensional primitive array classes are store in the static archive.
>>
>> During runtime, the `DynamicArchive::setup_array_klasses()` is for setting up the array classes. If only the `bottom_klass` is in the static archive, the function will point the `array_klasses` to the stored array classes in the dynamic archive. If a lower dimension array class is already in the static archive, its `higher_dimension` will be set to refer to the stored array classes in the dynamic archive.
>>
>> Some logging is added to `ObjArrayKlass::array_klass(int n, TRAPS)` to indicate an array class is being loaded from the archive.
>>
>> Passed tiers 1 - 4 testing.
>
> Calvin Cheung has updated the pull request incrementally with one additional commit since the last revision:
>
> revert changes in systemDictionaryShared.cpp; remove extra line in metaspaceShared.cpp
Marked as reviewed by ashu-mehra at github.com (no known OpenJDK username).
Just one more suggestion for adding a comment. Rest looks good!
src/hotspot/share/cds/dynamicArchive.cpp line 400:
> 398:
> 399: GrowableArray<ObjArrayKlass*>* DynamicArchive::_array_klasses = nullptr;
> 400: Array<ObjArrayKlass*>* DynamicArchive::_dynamic_archive_array_klasses = nullptr;
Perhaps a comment to clarify that `_array_klasses` and `_dynamic_archive_array_klasses` only hold the array classes which have element class in static archive would be useful when reading the code later.
-------------
PR Review: https://git.openjdk.org/jdk/pull/14959#pullrequestreview-1557660805
PR Comment: https://git.openjdk.org/jdk/pull/14959#issuecomment-1660933299
PR Review Comment: https://git.openjdk.org/jdk/pull/14959#discussion_r1281048360
More information about the hotspot-runtime-dev
mailing list