8274053: [BACKOUT] JDK-8270842: G1: Only young regions need to redirty outside references in remset.

Reviewed-by: sjohanss
This commit is contained in:
Thomas Schatzl 2021-09-21 09:20:21 +00:00
parent a5108a605e
commit afd218d39a

View File

@ -81,7 +81,6 @@ class RemoveSelfForwardPtrObjClosure: public ObjectClosure {
G1CollectedHeap* _g1h; G1CollectedHeap* _g1h;
G1ConcurrentMark* _cm; G1ConcurrentMark* _cm;
HeapRegion* _hr; HeapRegion* _hr;
const bool _is_young;
size_t _marked_bytes; size_t _marked_bytes;
UpdateLogBuffersDeferred* _log_buffer_cl; UpdateLogBuffersDeferred* _log_buffer_cl;
bool _during_concurrent_start; bool _during_concurrent_start;
@ -96,7 +95,6 @@ public:
_g1h(G1CollectedHeap::heap()), _g1h(G1CollectedHeap::heap()),
_cm(_g1h->concurrent_mark()), _cm(_g1h->concurrent_mark()),
_hr(hr), _hr(hr),
_is_young(hr->is_young()),
_marked_bytes(0), _marked_bytes(0),
_log_buffer_cl(log_buffer_cl), _log_buffer_cl(log_buffer_cl),
_during_concurrent_start(during_concurrent_start), _during_concurrent_start(during_concurrent_start),
@ -143,14 +141,19 @@ public:
_marked_bytes += (obj_size * HeapWordSize); _marked_bytes += (obj_size * HeapWordSize);
PreservedMarks::init_forwarded_mark(obj); PreservedMarks::init_forwarded_mark(obj);
// During evacuation failure we do not record inter-region // While we were processing RSet buffers during the collection,
// references referencing regions that need a remembered set // we actually didn't scan any cards on the collection set,
// update originating from young regions (including eden) that // since we didn't want to update remembered sets with entries
// failed evacuation. Make up for that omission now by rescanning // that point into the collection set, given that live objects
// these failed objects. // from the collection set are about to move and such entries
if (_is_young) { // will be stale very soon.
obj->oop_iterate(_log_buffer_cl); // This change also dealt with a reliability issue which
} // involved scanning a card in the collection set and coming
// across an array that was being chunked and looking malformed.
// The problem is that, if evacuation fails, we might have
// remembered set entries missing given that we skipped cards on
// the collection set. So, we'll recreate such entries now.
obj->oop_iterate(_log_buffer_cl);
HeapWord* obj_end = obj_addr + obj_size; HeapWord* obj_end = obj_addr + obj_size;
_last_forwarded_object_end = obj_end; _last_forwarded_object_end = obj_end;