RFR: 8311604: Simplify NOCOOPS requested addresses for archived heap objects

Ashutosh Mehra duke at openjdk.org
Fri Jul 7 15:14:55 UTC 2023


On Thu, 6 Jul 2023 23:39:34 GMT, Ioi Lam <iklam at openjdk.org> wrote:

> This PR attempts to clean up some of the cruds in the existing code:
> 
> - Simplified the calculation of "requested address" when `UseCompressedOops` is disabled -- the archived heap objects are always written starting from 0x10000000
> - Removed `HeapShared::to_requested_address()` so we don't have two kinds of "requested address"
> - Updated the comments about "source" vs "buffered" vs "requested" addresses in archiveHeapWriter.hpp
> - Removed `SerializeClosure::oop()` as the only oop we need to store into the archive header is `HeapShared::roots()`, which can be handled more easily with `FileMapHeader::_heap_roots_offset`
> - Removed some unnecessary dependencies on `G1CollectedHeap::heap()->reserved()`
> 
> Also:
> - Moved SerializeClosure to its own header file to improve build time.
> - Fixed DeterministicDump.java, which wasn't archiving Java objects when  `UseCompressedOops` was disabled.

Marked as reviewed by ashu-mehra at github.com (no known OpenJDK username).

minor nitpicks, otherwise looks good!

src/hotspot/share/cds/archiveHeapWriter.hpp line 80:

> 78:   //
> 79:   // - "buffered objects" are copies of the "source objects", and are stored in into
> 80:   //   ArchiveHeapWriter::_buffer, which is a GrowableArray that sites outside of

s/sites/sits

src/hotspot/share/cds/filemap.cpp line 2072:

> 2070:     // We can avoid relocation if each region is mapped into the exact same address
> 2071:     // where it was at dump time.
> 2072:     return (address)ArchiveHeapWriter::NOCOOPS_REQUESTED_BASE;

Can you please update the comment above this line as well to remove `each region` as we only have single heap region now.

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

PR Review: https://git.openjdk.org/jdk/pull/14792#pullrequestreview-1519128072
PR Comment: https://git.openjdk.org/jdk/pull/14792#issuecomment-1625561347
PR Review Comment: https://git.openjdk.org/jdk/pull/14792#discussion_r1255974422
PR Review Comment: https://git.openjdk.org/jdk/pull/14792#discussion_r1255981846


More information about the hotspot-dev mailing list