RFR: 8296155: Simplify CDS heap region address calculation

Coleen Phillimore coleenp at openjdk.org
Tue Nov 1 21:54:10 UTC 2022


On Mon, 31 Oct 2022 22:54:24 GMT, Ioi Lam <iklam at openjdk.org> wrote:

> Rewrite and simplify the convoluted logic used to calculate the runtime location of a CDS heap region. Now it's as simple as:
> 
> 
> FileMapRegion::dumptime_base() + ArchiveHeapLoader::runtime_delta();
> 
> 
> See `FileMapInfo::heap_region_runtime_start_address` for an example.
> 
> Also removed dead code:
> 
> - `FileMapInfo::is_in_shared_region`
> - `MetaspaceShared::is_in_shared_region`
> - `FileMapInfo::stop_sharing_and_unmap`

This looks like a simplification.  is_in_shared_metaspace() is the query for whether something is in shared region now?

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

> 1556:   _is_bitmap_region = (region_index == MetaspaceShared::bm);
> 1557: 
> 1558:   if (_is_heap_region) {

Explain please.  Only heap region has a non-null dumptime base?

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

> 1642:     assert(!DynamicDumpSharedSpaces, "must be");
> 1643:     requested_base = base;
> 1644:     dumptime_base = base; // This is the rumtime address of the base (lower end) of this heap region.

typo: rumtime.

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

Marked as reviewed by coleenp (Reviewer).

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


More information about the hotspot-runtime-dev mailing list