< prev index next >

src/share/vm/gc/g1/g1CollectedHeap.inline.hpp

Print this page

        

@@ -302,6 +302,23 @@
     set_humongous_reclaim_candidate(region, false);
     _in_cset_fast_test.clear_humongous(region);
   }
 }
 
+bool G1CollectedHeap::requires_marking(const void* entry) const {
+  // Includes rejection of NULL pointers.
+  assert(is_in_reserved(entry),
+         "Non-heap pointer in SATB buffer: " PTR_FORMAT, p2i(entry));
+
+  HeapRegion* region = heap_region_containing(entry);
+  assert(region != NULL, "No region for " PTR_FORMAT, p2i(entry));
+  if (entry >= region->next_top_at_mark_start()) {
+    return false;
+  }
+
+  assert(((oop)entry)->is_oop(true /* ignore mark word */),
+         "Invalid oop in SATB buffer: " PTR_FORMAT, p2i(entry));
+
+  return ! isMarkedNext((oop) entry);
+}
+
 #endif // SHARE_VM_GC_G1_G1COLLECTEDHEAP_INLINE_HPP
< prev index next >