8201171: Cleanup in g1CollectedHeap, change CamelCase to snake_case Reviewed-by:
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
119 return;
120 }
121
122 // Two-fingered compaction toward the end.
123 void** src = &buf[index()];
124 void** dst = &buf[capacity()];
|
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->is_marked_next((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
119 return;
120 }
121
122 // Two-fingered compaction toward the end.
123 void** src = &buf[index()];
124 void** dst = &buf[capacity()];
|