< prev index next >

src/share/vm/gc/g1/satbQueue.cpp

Print this page
rev 8961 : [mq]: diff-shenandoah.patch

@@ -72,34 +72,17 @@
 // The stale reference cases are implicitly handled by the NTAMS
 // comparison. Because of the possibility of stale references, buffer
 // processing must be somewhat circumspect and not assume entries
 // in an unfiltered buffer refer to valid objects.
 
-inline bool requires_marking(const void* entry, G1CollectedHeap* heap) {
-  // Includes rejection of NULL pointers.
-  assert(heap->is_in_reserved(entry),
-         err_msg("Non-heap pointer in SATB buffer: " PTR_FORMAT, p2i(entry)));
-
-  HeapRegion* region = heap->heap_region_containing_raw(entry);
-  assert(region != NULL, err_msg("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 */),
-         err_msg("Invalid oop in SATB buffer: " PTR_FORMAT, p2i(entry)));
-
-  return true;
-}
-
 // This method removes entries from a SATB buffer that will not be
 // useful to the concurrent marking threads.  Entries are retained if
 // they require marking and are not already marked. Retained entries
 // are compacted toward the top of the buffer.
 
 void ObjPtrQueue::filter() {
-  G1CollectedHeap* g1h = G1CollectedHeap::heap();
+  CollectedHeap* heap = Universe::heap();
   void** buf = _buf;
   size_t sz = _sz;
 
   if (buf == NULL) {
     // nothing to do

@@ -122,11 +105,12 @@
     // at the end. If we are going to retain it we will copy it to its
     // final place. If we have retained all entries we have visited so
     // far, we'll just end up copying it to the same place.
     *p = NULL;
 
-    if (requires_marking(entry, g1h) && !g1h->isMarkedNext((oop)entry)) {
+    bool retain = heap->is_obj_ill(oop(entry));
+    if (retain) {
       assert(new_index > 0, "we should not have already filled up the buffer");
       new_index -= oopSize;
       assert(new_index >= i,
              "new_index should never be below i, as we always compact 'up'");
       void** new_p = &buf[byte_index_to_index((int) new_index)];
< prev index next >