Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8297313

Refactor APIs for calculating address of CDS archive heap regions

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 20
    • 20
    • hotspot
    • b27

      In anticipation of the following RFEs:

      - JDK-8296263: Uniform APIs for using archived heap regions
      - 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:

        address FileMapInfo::start_address_as_decoded_from_archive()
        address
      start_address_as_decoded_with_current_oop_encoding_mode()

      and the implementation is convoluted. See

      https://github.com/openjdk/jdk/blob/544e31722528d12fae0eb19271f85886680801a6/src/hotspot/share/cds/filemap.cpp#L2070-L2116

      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 CDSFileMapRegion structure is changed slightly to simplify the implementation of the above 3 functions.

      With the above change, FileMapInfo::map_heap_regions_impl() can also be simplified significantly.

            iklam Ioi Lam
            iklam Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: