Integrated: 8297313: Refactor APIs for calculating address of CDS archive heap regions

Ioi Lam iklam at openjdk.org
Thu Dec 1 20:03:21 UTC 2022


On Mon, 21 Nov 2022 06:22:49 GMT, Ioi Lam <iklam at openjdk.org> wrote:

> In anticipation of the following RFEs:
> 
> - [JDK-8296263](https://bugs.openjdk.org/browse/JDK-8296263): Uniform APIs for using archived heap regions
> - [JDK-8296344](https://bugs.openjdk.org/browse/JDK-8296344): Remove dependency on G1 for writing the CDS archive heap
> 
> We need to clean up the APIs for calculating the addresses of CDS archive heap regions.  The current APIs have confusing names and the implementation is convoluted.
> 
> The proposal is to change the above to three APIs with easy-to-understand semantics:
> 
> // The actual address of this region during dump time.
> address heap_region_dumptime_address(FileMapRegion* r)
> 
> // The address where this region can be mapped into the runtime heap without
> // patching any of the pointers that are embedded in this region.
> address heap_region_requested_address(FileMapRegion* r)
> 
> // The address where this shared heap region is actually mapped at runtime.
> address heap_region_mapped_address(FileMapRegion* r)
> 
> 
> The meaning of the `CDSFileMapRegion::_mapping_offset` field is changed slightly to simplify the implementation of the above 3 functions. Comments are improved explain what's going on.
> 
> With the above changes, `FileMapInfo::map_heap_regions_impl()` can also be simplified significantly.
> 
> ****
> Testing: tiers 1-4
> ****
> Misc changes:
> - added more assertions about exactly which combinations of collector and oop encoding mode are supported
>   - Specifically, uncompressed oops for non-G1 collectors are currently not supported;
>   - Change error message accordingly when the user selects an unsupported combination.

This pull request has now been integrated.

Changeset: 391599bc
Author:    Ioi Lam <iklam at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/391599bc9d6b28a88e86d37464bb76e1e5314ce3
Stats:     332 lines in 11 files changed: 179 ins; 104 del; 49 mod

8297313: Refactor APIs for calculating address of CDS archive heap regions

Reviewed-by: matsaave, ccheung

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

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


More information about the hotspot-runtime-dev mailing list