--- old/src/share/vm/gc/g1/g1CollectedHeap.inline.hpp 2016-04-15 21:13:39.975297929 +0200 +++ new/src/share/vm/gc/g1/g1CollectedHeap.inline.hpp 2016-04-15 21:13:39.923299163 +0200 @@ -304,4 +304,21 @@ } } +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