< prev index next >

src/hotspot/share/gc/g1/g1Allocator.inline.hpp

Print this page
rev 51611 : 8214118: HeapRegions marked as archive even if CDS mapping fails
Reviewed-by: tschatzl, jiangli

@@ -107,17 +107,35 @@
 }
 
 // Set the regions containing the specified address range as archive.
 inline void G1ArchiveAllocator::set_range_archive(MemRegion range, bool open) {
   assert(_archive_check_enabled, "archive range check not enabled");
+  log_info(gc, cds)("Mark %s archive regions in map: [" PTR_FORMAT ", " PTR_FORMAT "]",
+                     open ? "open" : "closed",
+                     p2i(range.start()),
+                     p2i(range.last()));
   if (open) {
     _open_archive_region_map.set_by_address(range, true);
   } else {
     _closed_archive_region_map.set_by_address(range, true);
   }
 }
 
+// Clear the archive regions map containing the specified address range.
+inline void G1ArchiveAllocator::clear_range_archive(MemRegion range, bool open) {
+  assert(_archive_check_enabled, "archive range check not enabled");
+  log_info(gc, cds)("Clear %s archive regions in map: [" PTR_FORMAT ", " PTR_FORMAT "]",
+                    open ? "open" : "closed",
+                    p2i(range.start()),
+                    p2i(range.last()));
+  if (open) {
+    _open_archive_region_map.set_by_address(range, false);
+  } else {
+    _closed_archive_region_map.set_by_address(range, false);
+  }
+}
+
 // Check if an object is in a closed archive region using the _archive_region_map.
 inline bool G1ArchiveAllocator::in_closed_archive_range(oop object) {
   // This is the out-of-line part of is_closed_archive_object test, done separately
   // to avoid additional performance impact when the check is not enabled.
   return _closed_archive_region_map.get_by_address((HeapWord*)object);
< prev index next >