< prev index next >

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

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

*** 72,105 **** // 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(); void** buf = _buf; size_t sz = _sz; if (buf == NULL) { // nothing to do --- 72,88 ---- // 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. // 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() { ! CollectedHeap* heap = Universe::heap(); void** buf = _buf; size_t sz = _sz; if (buf == NULL) { // nothing to do
*** 122,132 **** // 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)) { 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)]; --- 105,116 ---- // 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; ! 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 >