RFR: 8297313: Refactor APIs for calculating address of CDS archive heap regions [v5]

Ioi Lam iklam at openjdk.org
Thu Dec 1 19:31:28 UTC 2022


> 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.

Ioi Lam has updated the pull request incrementally with one additional commit since the last revision:

  Changed logging to work around JDK-8297975

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/11257/files
  - new: https://git.openjdk.org/jdk/pull/11257/files/9f435392..4148ceb8

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=11257&range=04
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=11257&range=03-04

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/11257.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/11257/head:pull/11257

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


More information about the hotspot-runtime-dev mailing list