231 }; 232 233 void G1RemSet::scanRS(G1ParPushHeapRSClosure* oc, 234 CodeBlobClosure* code_root_cl, 235 uint worker_i) { 236 double rs_time_start = os::elapsedTime(); 237 HeapRegion *startRegion = _g1->start_cset_region_for_worker(worker_i); 238 239 ScanRSClosure scanRScl(oc, code_root_cl, worker_i); 240 241 _g1->collection_set_iterate_from(startRegion, &scanRScl); 242 scanRScl.set_try_claimed(); 243 _g1->collection_set_iterate_from(startRegion, &scanRScl); 244 245 double scan_rs_time_sec = (os::elapsedTime() - rs_time_start) 246 - scanRScl.strong_code_root_scan_time_sec(); 247 248 assert(_cards_scanned != NULL, "invariant"); 249 _cards_scanned[worker_i] = scanRScl.cards_done(); 250 251 _g1p->phase_times()->record_time(G1GCPhaseTimes::ScanRS, worker_i, scan_rs_time_sec); 252 _g1p->phase_times()->record_time(G1GCPhaseTimes::CodeRoots, worker_i, scanRScl.strong_code_root_scan_time_sec()); 253 } 254 255 // Closure used for updating RSets and recording references that 256 // point into the collection set. Only called during an 257 // evacuation pause. 258 259 class RefineRecordRefsIntoCSCardTableEntryClosure: public CardTableEntryClosure { 260 G1RemSet* _g1rs; 261 DirtyCardQueue* _into_cset_dcq; 262 public: 263 RefineRecordRefsIntoCSCardTableEntryClosure(G1CollectedHeap* g1h, 264 DirtyCardQueue* into_cset_dcq) : 265 _g1rs(g1h->g1_rem_set()), _into_cset_dcq(into_cset_dcq) 266 {} 267 bool do_card_ptr(jbyte* card_ptr, uint worker_i) { 268 // The only time we care about recording cards that 269 // contain references that point into the collection set 270 // is during RSet updating within an evacuation pause. 271 // In this case worker_i should be the id of a GC worker thread. 272 assert(SafepointSynchronize::is_at_safepoint(), "not during an evacuation pause"); | 231 }; 232 233 void G1RemSet::scanRS(G1ParPushHeapRSClosure* oc, 234 CodeBlobClosure* code_root_cl, 235 uint worker_i) { 236 double rs_time_start = os::elapsedTime(); 237 HeapRegion *startRegion = _g1->start_cset_region_for_worker(worker_i); 238 239 ScanRSClosure scanRScl(oc, code_root_cl, worker_i); 240 241 _g1->collection_set_iterate_from(startRegion, &scanRScl); 242 scanRScl.set_try_claimed(); 243 _g1->collection_set_iterate_from(startRegion, &scanRScl); 244 245 double scan_rs_time_sec = (os::elapsedTime() - rs_time_start) 246 - scanRScl.strong_code_root_scan_time_sec(); 247 248 assert(_cards_scanned != NULL, "invariant"); 249 _cards_scanned[worker_i] = scanRScl.cards_done(); 250 251 _g1p->phase_times()->record_time_secs(G1GCPhaseTimes::ScanRS, worker_i, scan_rs_time_sec); 252 _g1p->phase_times()->record_time_secs(G1GCPhaseTimes::CodeRoots, worker_i, scanRScl.strong_code_root_scan_time_sec()); 253 } 254 255 // Closure used for updating RSets and recording references that 256 // point into the collection set. Only called during an 257 // evacuation pause. 258 259 class RefineRecordRefsIntoCSCardTableEntryClosure: public CardTableEntryClosure { 260 G1RemSet* _g1rs; 261 DirtyCardQueue* _into_cset_dcq; 262 public: 263 RefineRecordRefsIntoCSCardTableEntryClosure(G1CollectedHeap* g1h, 264 DirtyCardQueue* into_cset_dcq) : 265 _g1rs(g1h->g1_rem_set()), _into_cset_dcq(into_cset_dcq) 266 {} 267 bool do_card_ptr(jbyte* card_ptr, uint worker_i) { 268 // The only time we care about recording cards that 269 // contain references that point into the collection set 270 // is during RSet updating within an evacuation pause. 271 // In this case worker_i should be the id of a GC worker thread. 272 assert(SafepointSynchronize::is_at_safepoint(), "not during an evacuation pause"); |