60 // * A reference to a young generation object. Young objects are 61 // handled separately and are not marked by concurrent marking. 62 // 63 // * A stale reference to a young generation object. If a young 64 // generation object reference is recorded and not filtered out 65 // before being moved by a young collection, the reference becomes 66 // stale. 67 // 68 // * A stale reference to an eagerly reclaimed humongous object. If a 69 // humongous object is recorded and then reclaimed, the reference 70 // becomes stale. 71 // 72 // The stale reference cases are implicitly handled by the NTAMS 73 // comparison. Because of the possibility of stale references, buffer 74 // processing must be somewhat circumspect and not assume entries 75 // in an unfiltered buffer refer to valid objects. 76 77 inline bool requires_marking(const void* entry, G1CollectedHeap* heap) { 78 // Includes rejection of NULL pointers. 79 assert(heap->is_in_reserved(entry), 80 err_msg("Non-heap pointer in SATB buffer: " PTR_FORMAT, p2i(entry))); 81 82 HeapRegion* region = heap->heap_region_containing_raw(entry); 83 assert(region != NULL, err_msg("No region for " PTR_FORMAT, p2i(entry))); 84 if (entry >= region->next_top_at_mark_start()) { 85 return false; 86 } 87 88 assert(((oop)entry)->is_oop(true /* ignore mark word */), 89 err_msg("Invalid oop in SATB buffer: " PTR_FORMAT, p2i(entry))); 90 91 return true; 92 } 93 94 // This method removes entries from a SATB buffer that will not be 95 // useful to the concurrent marking threads. Entries are retained if 96 // they require marking and are not already marked. Retained entries 97 // are compacted toward the top of the buffer. 98 99 void ObjPtrQueue::filter() { 100 G1CollectedHeap* g1h = G1CollectedHeap::heap(); 101 void** buf = _buf; 102 size_t sz = _sz; 103 104 if (buf == NULL) { 105 // nothing to do 106 return; 107 } 108 109 // Used for sanity checking at the end of the loop. | 60 // * A reference to a young generation object. Young objects are 61 // handled separately and are not marked by concurrent marking. 62 // 63 // * A stale reference to a young generation object. If a young 64 // generation object reference is recorded and not filtered out 65 // before being moved by a young collection, the reference becomes 66 // stale. 67 // 68 // * A stale reference to an eagerly reclaimed humongous object. If a 69 // humongous object is recorded and then reclaimed, the reference 70 // becomes stale. 71 // 72 // The stale reference cases are implicitly handled by the NTAMS 73 // comparison. Because of the possibility of stale references, buffer 74 // processing must be somewhat circumspect and not assume entries 75 // in an unfiltered buffer refer to valid objects. 76 77 inline bool requires_marking(const void* entry, G1CollectedHeap* heap) { 78 // Includes rejection of NULL pointers. 79 assert(heap->is_in_reserved(entry), 80 "Non-heap pointer in SATB buffer: " PTR_FORMAT, p2i(entry)); 81 82 HeapRegion* region = heap->heap_region_containing_raw(entry); 83 assert(region != NULL, "No region for " PTR_FORMAT, p2i(entry)); 84 if (entry >= region->next_top_at_mark_start()) { 85 return false; 86 } 87 88 assert(((oop)entry)->is_oop(true /* ignore mark word */), 89 "Invalid oop in SATB buffer: " PTR_FORMAT, p2i(entry)); 90 91 return true; 92 } 93 94 // This method removes entries from a SATB buffer that will not be 95 // useful to the concurrent marking threads. Entries are retained if 96 // they require marking and are not already marked. Retained entries 97 // are compacted toward the top of the buffer. 98 99 void ObjPtrQueue::filter() { 100 G1CollectedHeap* g1h = G1CollectedHeap::heap(); 101 void** buf = _buf; 102 size_t sz = _sz; 103 104 if (buf == NULL) { 105 // nothing to do 106 return; 107 } 108 109 // Used for sanity checking at the end of the loop. |