< prev index next >

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

Print this page




  78 // * A stale reference to an eagerly reclaimed humongous object.  If a
  79 //   humongous object is recorded and then reclaimed, the reference
  80 //   becomes stale.
  81 //
  82 // The stale reference cases are implicitly handled by the NTAMS
  83 // comparison. Because of the possibility of stale references, buffer
  84 // processing must be somewhat circumspect and not assume entries
  85 // in an unfiltered buffer refer to valid objects.
  86 
  87 inline bool requires_marking(const void* entry, G1CollectedHeap* heap) {
  88   // Includes rejection of NULL pointers.
  89   assert(heap->is_in_reserved(entry),
  90          "Non-heap pointer in SATB buffer: " PTR_FORMAT, p2i(entry));
  91 
  92   HeapRegion* region = heap->heap_region_containing(entry);
  93   assert(region != NULL, "No region for " PTR_FORMAT, p2i(entry));
  94   if (entry >= region->next_top_at_mark_start()) {
  95     return false;
  96   }
  97 
  98   assert(((oop)entry)->is_oop(true /* ignore mark word */),
  99          "Invalid oop in SATB buffer: " PTR_FORMAT, p2i(entry));
 100 
 101   return true;
 102 }
 103 
 104 inline bool retain_entry(const void* entry, G1CollectedHeap* heap) {
 105   return requires_marking(entry, heap) && !heap->isMarkedNext((oop)entry);
 106 }
 107 
 108 // This method removes entries from a SATB buffer that will not be
 109 // useful to the concurrent marking threads.  Entries are retained if
 110 // they require marking and are not already marked. Retained entries
 111 // are compacted toward the top of the buffer.
 112 
 113 void SATBMarkQueue::filter() {
 114   G1CollectedHeap* g1h = G1CollectedHeap::heap();
 115   void** buf = _buf;
 116 
 117   if (buf == NULL) {
 118     // nothing to do




  78 // * A stale reference to an eagerly reclaimed humongous object.  If a
  79 //   humongous object is recorded and then reclaimed, the reference
  80 //   becomes stale.
  81 //
  82 // The stale reference cases are implicitly handled by the NTAMS
  83 // comparison. Because of the possibility of stale references, buffer
  84 // processing must be somewhat circumspect and not assume entries
  85 // in an unfiltered buffer refer to valid objects.
  86 
  87 inline bool requires_marking(const void* entry, G1CollectedHeap* heap) {
  88   // Includes rejection of NULL pointers.
  89   assert(heap->is_in_reserved(entry),
  90          "Non-heap pointer in SATB buffer: " PTR_FORMAT, p2i(entry));
  91 
  92   HeapRegion* region = heap->heap_region_containing(entry);
  93   assert(region != NULL, "No region for " PTR_FORMAT, p2i(entry));
  94   if (entry >= region->next_top_at_mark_start()) {
  95     return false;
  96   }
  97 
  98   assert((oopDesc::is_oop(oop(entry)), true /* ignore mark word */),
  99          "Invalid oop in SATB buffer: " PTR_FORMAT, p2i(entry));
 100 
 101   return true;
 102 }
 103 
 104 inline bool retain_entry(const void* entry, G1CollectedHeap* heap) {
 105   return requires_marking(entry, heap) && !heap->isMarkedNext((oop)entry);
 106 }
 107 
 108 // This method removes entries from a SATB buffer that will not be
 109 // useful to the concurrent marking threads.  Entries are retained if
 110 // they require marking and are not already marked. Retained entries
 111 // are compacted toward the top of the buffer.
 112 
 113 void SATBMarkQueue::filter() {
 114   G1CollectedHeap* g1h = G1CollectedHeap::heap();
 115   void** buf = _buf;
 116 
 117   if (buf == NULL) {
 118     // nothing to do


< prev index next >