172 G1CollectedHeap* _g1h;
173 ConcurrentMark* _cm;
174 uint _worker_id;
175 HeapRegionClaimer* _hrclaimer;
176
177 DirtyCardQueue _dcq;
178 UpdateRSetDeferred _update_rset_cl;
179
180 public:
181 RemoveSelfForwardPtrHRClosure(G1CollectedHeap* g1h,
182 uint worker_id,
183 HeapRegionClaimer* hrclaimer) :
184 _g1h(g1h), _dcq(&g1h->dirty_card_queue_set()), _update_rset_cl(g1h, &_dcq),
185 _worker_id(worker_id), _cm(_g1h->concurrent_mark()), _hrclaimer(hrclaimer) {
186 }
187
188 bool doHeapRegion(HeapRegion *hr) {
189 bool during_initial_mark = _g1h->g1_policy()->during_initial_mark_pause();
190 bool during_conc_mark = _g1h->mark_in_progress();
191
192 assert(!hr->is_humongous(), "sanity");
193 assert(hr->in_collection_set(), "bad CS");
194
195 if (_hrclaimer->claim_region(hr->hrm_index())) {
196 if (hr->evacuation_failed()) {
197 RemoveSelfForwardPtrObjClosure rspc(_g1h, _cm, hr, &_update_rset_cl,
198 during_initial_mark,
199 during_conc_mark,
200 _worker_id);
201
202 hr->note_self_forwarding_removal_start(during_initial_mark,
203 during_conc_mark);
204 _g1h->check_bitmaps("Self-Forwarding Ptr Removal", hr);
205
206 // In the common case (i.e. when there is no evacuation
207 // failure) we make sure that the following is done when
208 // the region is freed so that it is "ready-to-go" when it's
209 // re-allocated. However, when evacuation failure happens, a
210 // region will remain in the heap and might ultimately be added
211 // to a CSet in the future. So we have to be careful here and
212 // make sure the region's RSet is ready for parallel iteration
|
172 G1CollectedHeap* _g1h;
173 ConcurrentMark* _cm;
174 uint _worker_id;
175 HeapRegionClaimer* _hrclaimer;
176
177 DirtyCardQueue _dcq;
178 UpdateRSetDeferred _update_rset_cl;
179
180 public:
181 RemoveSelfForwardPtrHRClosure(G1CollectedHeap* g1h,
182 uint worker_id,
183 HeapRegionClaimer* hrclaimer) :
184 _g1h(g1h), _dcq(&g1h->dirty_card_queue_set()), _update_rset_cl(g1h, &_dcq),
185 _worker_id(worker_id), _cm(_g1h->concurrent_mark()), _hrclaimer(hrclaimer) {
186 }
187
188 bool doHeapRegion(HeapRegion *hr) {
189 bool during_initial_mark = _g1h->g1_policy()->during_initial_mark_pause();
190 bool during_conc_mark = _g1h->mark_in_progress();
191
192 assert(!hr->is_pinned(), "sanity");
193 assert(hr->in_collection_set(), "bad CS");
194
195 if (_hrclaimer->claim_region(hr->hrm_index())) {
196 if (hr->evacuation_failed()) {
197 RemoveSelfForwardPtrObjClosure rspc(_g1h, _cm, hr, &_update_rset_cl,
198 during_initial_mark,
199 during_conc_mark,
200 _worker_id);
201
202 hr->note_self_forwarding_removal_start(during_initial_mark,
203 during_conc_mark);
204 _g1h->check_bitmaps("Self-Forwarding Ptr Removal", hr);
205
206 // In the common case (i.e. when there is no evacuation
207 // failure) we make sure that the following is done when
208 // the region is freed so that it is "ready-to-go" when it's
209 // re-allocated. However, when evacuation failure happens, a
210 // region will remain in the heap and might ultimately be added
211 // to a CSet in the future. So we have to be careful here and
212 // make sure the region's RSet is ready for parallel iteration
|