199 _update_rset_cl(&_dcq),
200 _worker_id(worker_id),
201 _hrclaimer(hrclaimer) {
202 }
203
204 size_t remove_self_forward_ptr_by_walking_hr(HeapRegion* hr,
205 bool during_initial_mark) {
206 RemoveSelfForwardPtrObjClosure rspc(hr,
207 &_update_rset_cl,
208 during_initial_mark,
209 _worker_id);
210 _update_rset_cl.set_region(hr);
211 hr->object_iterate(&rspc);
212 // Need to zap the remainder area of the processed region.
213 rspc.zap_remainder();
214
215 return rspc.marked_bytes();
216 }
217
218 bool doHeapRegion(HeapRegion *hr) {
219 bool during_initial_mark = _g1h->collector_state()->during_initial_mark_pause();
220 bool during_conc_mark = _g1h->collector_state()->mark_in_progress();
221
222 assert(!hr->is_pinned(), "Unexpected pinned region at index %u", hr->hrm_index());
223 assert(hr->in_collection_set(), "bad CS");
224
225 if (_hrclaimer->claim_region(hr->hrm_index())) {
226 if (hr->evacuation_failed()) {
227 hr->note_self_forwarding_removal_start(during_initial_mark,
228 during_conc_mark);
229 _g1h->verifier()->check_bitmaps("Self-Forwarding Ptr Removal", hr);
230
231 hr->reset_bot();
232
233 size_t live_bytes = remove_self_forward_ptr_by_walking_hr(hr, during_initial_mark);
234
235 hr->rem_set()->clean_strong_code_roots(hr);
236
237 hr->note_self_forwarding_removal_end(during_initial_mark,
238 during_conc_mark,
239 live_bytes);
240 }
241 }
242 return false;
243 }
244 };
245
246 G1ParRemoveSelfForwardPtrsTask::G1ParRemoveSelfForwardPtrsTask() :
247 AbstractGangTask("G1 Remove Self-forwarding Pointers"),
248 _g1h(G1CollectedHeap::heap()),
249 _hrclaimer(_g1h->workers()->active_workers()) { }
250
251 void G1ParRemoveSelfForwardPtrsTask::work(uint worker_id) {
252 RemoveSelfForwardPtrHRClosure rsfp_cl(worker_id, &_hrclaimer);
253
254 HeapRegion* hr = _g1h->start_cset_region_for_worker(worker_id);
255 _g1h->collection_set_iterate_from(hr, &rsfp_cl);
256 }
|
199 _update_rset_cl(&_dcq),
200 _worker_id(worker_id),
201 _hrclaimer(hrclaimer) {
202 }
203
204 size_t remove_self_forward_ptr_by_walking_hr(HeapRegion* hr,
205 bool during_initial_mark) {
206 RemoveSelfForwardPtrObjClosure rspc(hr,
207 &_update_rset_cl,
208 during_initial_mark,
209 _worker_id);
210 _update_rset_cl.set_region(hr);
211 hr->object_iterate(&rspc);
212 // Need to zap the remainder area of the processed region.
213 rspc.zap_remainder();
214
215 return rspc.marked_bytes();
216 }
217
218 bool doHeapRegion(HeapRegion *hr) {
219 assert(!hr->is_pinned(), "Unexpected pinned region at index %u", hr->hrm_index());
220 assert(hr->in_collection_set(), "bad CS");
221
222 if (_hrclaimer->claim_region(hr->hrm_index())) {
223 if (hr->evacuation_failed()) {
224 bool during_initial_mark = _g1h->collector_state()->during_initial_mark_pause();
225 bool during_conc_mark = _g1h->collector_state()->mark_in_progress();
226
227 hr->note_self_forwarding_removal_start(during_initial_mark,
228 during_conc_mark);
229 _g1h->verifier()->check_bitmaps("Self-Forwarding Ptr Removal", hr);
230
231 hr->reset_bot();
232
233 size_t live_bytes = remove_self_forward_ptr_by_walking_hr(hr, during_initial_mark);
234
235 hr->rem_set()->clean_strong_code_roots(hr);
236
237 hr->note_self_forwarding_removal_end(live_bytes);
238 }
239 }
240 return false;
241 }
242 };
243
244 G1ParRemoveSelfForwardPtrsTask::G1ParRemoveSelfForwardPtrsTask() :
245 AbstractGangTask("G1 Remove Self-forwarding Pointers"),
246 _g1h(G1CollectedHeap::heap()),
247 _hrclaimer(_g1h->workers()->active_workers()) { }
248
249 void G1ParRemoveSelfForwardPtrsTask::work(uint worker_id) {
250 RemoveSelfForwardPtrHRClosure rsfp_cl(worker_id, &_hrclaimer);
251
252 HeapRegion* hr = _g1h->start_cset_region_for_worker(worker_id);
253 _g1h->collection_set_iterate_from(hr, &rsfp_cl);
254 }
|