RFR: 8298612: Refactor archiving of java String objects [v2]

Calvin Cheung ccheung at openjdk.org
Wed Jan 25 17:50:45 UTC 2023


On Wed, 25 Jan 2023 05:15:11 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> This is the last prerequisite PR for [JDK-8296344](https://bugs.openjdk.org/browse/JDK-8296344) (Remove dependency on G1 for writing the CDS archive heap).
>> 
>> The old `StringTable::write_to_archive()` violates requirements [1] and [2] as stated in [JDK-8298600](https://bugs.openjdk.org/browse/JDK-8298600).
>> 
>> In the new implementation, copying of strings into the archive has been moved inside of heapShared.cpp. Now we no longer expose the `HeapShared::archive_object()` API. This addresses requirement [1].
>> 
>> Also, we no longer hand-assemble the String object and its internal `value` array. Instead, we use `HeapShared::archive_reachable_objects_from` to recursively copy the `value`.  This addresses requirement [2].
>> 
>> Test: tiers 1-4.
>
> 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 five additional commits since the last revision:
> 
>  - Merge branch 'master' into 8298612-refactor-archiving-of-java-string-objects
>  - added set_deduplication_forbidden back
>  - renamed functions
>  - changed NULL to nullptr
>  - refactored the writing of interned strings

LGTM

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

Marked as reviewed by ccheung (Reviewer).

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


More information about the hotspot-runtime-dev mailing list