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

Ioi Lam iklam at openjdk.org
Sat Jan 28 21:23:57 UTC 2023


> 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 pull request now contains seven commits:

 - fixed merge
 - Merge branch 'master' into 8298612-refactor-archiving-of-java-string-objects
 - 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

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

Changes: https://git.openjdk.org/jdk/pull/12173/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=12173&range=02
  Stats: 75 lines in 4 files changed: 27 ins; 30 del; 18 mod
  Patch: https://git.openjdk.org/jdk/pull/12173.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/12173/head:pull/12173

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


More information about the hotspot-runtime-dev mailing list