RFR: 8311604: Simplify NOCOOPS requested addresses for archived heap objects [v2]

Calvin Cheung ccheung at openjdk.org
Fri Jul 7 22:33:58 UTC 2023


On Fri, 7 Jul 2023 17:12:09 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.
>
> Ioi Lam has updated the pull request incrementally with one additional commit since the last revision:
> 
>   @ashu-mehra review; updated source code comments

Just couple of nits.

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

> 288:   st->print_cr("- serialized_data_offset:         " SIZE_FORMAT_X, _serialized_data_offset);
> 289:   st->print_cr("- heap_begin:                     " INTPTR_FORMAT, p2i(_heap_begin));
> 290:   st->print_cr("- heap_end:                       " INTPTR_FORMAT, p2i(_heap_end));

Maybe print the _heap_roots_offset?

src/hotspot/share/cds/serializeClosure.hpp line 26:

> 24: 
> 25: #ifndef SHARED_CDS_SERIALIZECLOSURE_HPP
> 26: #define SHARED_CDS_SERIALIZECLOSURE_HPP

Since the directory name is `share`, I think the above should be `SHARE_` instead of `SHARED_`.

src/hotspot/share/cds/serializeClosure.hpp line 68:

> 66: };
> 67: 
> 68: #endif // SHARED_CDS_SERIALIZECLOSURE_HPP

Should be `SHARE_` instead of `SHARED_`.

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

Marked as reviewed by ccheung (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/14792#pullrequestreview-1519956788
PR Review Comment: https://git.openjdk.org/jdk/pull/14792#discussion_r1256561142
PR Review Comment: https://git.openjdk.org/jdk/pull/14792#discussion_r1256526160
PR Review Comment: https://git.openjdk.org/jdk/pull/14792#discussion_r1256526970


More information about the hotspot-dev mailing list