Copied from the parent task:
The new APIs would be:
HeapWord* alloc_archive_space(size_t word_size)
This would replace allocate_loaded_archive_space() and the G1's alloc_archive_region().
void fixup_archive_space(MemRegion range)
This would replace complete_loaded_archive_space() and G1's populate_archive_regions_bot_part().
void handle_archive_space_failure(MemRegion range)
This would replace ArchiveHeapLoader::fill_failed_loaded_heap() and G1's dealloc_archive_regions().
At this stage CDS code would also be updated to use Universe::heap() instead of G1CollectedHeap::heap() when calling the GC APIs for mapping the archive space.
CollectedHeap::reserved() would be added to return the reserved heap region so that the calls to G1CollectedHeap::heap()->reserved() can be replaced with Universe::heap()->reserved(). Currently only ZGC does not seem to set CollectedHeap::_reserved which can be addressed later when support for archive objects needs to be added for ZGC.
This task does not update collectors other than G1 to use the new APIs.