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