src/hotspot/share/gc/g1/g1RemSet.cpp
changeset 52897 495c05ee2a9a
parent 52716 877dd2b0f36c
child 53747 13acc8e38a29
equal deleted inserted replaced
52896:98408c7c0b73 52897:495c05ee2a9a
   309 }
   309 }
   310 
   310 
   311 G1ScanRSForRegionClosure::G1ScanRSForRegionClosure(G1RemSetScanState* scan_state,
   311 G1ScanRSForRegionClosure::G1ScanRSForRegionClosure(G1RemSetScanState* scan_state,
   312                                                    G1ScanObjsDuringScanRSClosure* scan_obj_on_card,
   312                                                    G1ScanObjsDuringScanRSClosure* scan_obj_on_card,
   313                                                    G1ParScanThreadState* pss,
   313                                                    G1ParScanThreadState* pss,
       
   314                                                    G1GCPhaseTimes::GCParPhases phase,
   314                                                    uint worker_i) :
   315                                                    uint worker_i) :
   315   _g1h(G1CollectedHeap::heap()),
   316   _g1h(G1CollectedHeap::heap()),
   316   _ct(_g1h->card_table()),
   317   _ct(_g1h->card_table()),
   317   _pss(pss),
   318   _pss(pss),
   318   _scan_objs_on_card_cl(scan_obj_on_card),
   319   _scan_objs_on_card_cl(scan_obj_on_card),
   319   _scan_state(scan_state),
   320   _scan_state(scan_state),
       
   321   _phase(phase),
   320   _worker_i(worker_i),
   322   _worker_i(worker_i),
   321   _cards_scanned(0),
   323   _cards_scanned(0),
   322   _cards_claimed(0),
   324   _cards_claimed(0),
   323   _cards_skipped(0),
   325   _cards_skipped(0),
   324   _rem_set_root_scan_time(),
   326   _rem_set_root_scan_time(),
   400 
   402 
   401     MemRegion const mr(card_start, MIN2(card_start + BOTConstants::N_words, top));
   403     MemRegion const mr(card_start, MIN2(card_start + BOTConstants::N_words, top));
   402 
   404 
   403     scan_card(mr, region_idx_for_card);
   405     scan_card(mr, region_idx_for_card);
   404   }
   406   }
   405   event.commit(GCId::current(), _worker_i, G1GCPhaseTimes::phase_name(G1GCPhaseTimes::ScanRS));
   407   event.commit(GCId::current(), _worker_i, G1GCPhaseTimes::phase_name(_phase));
   406 }
   408 }
   407 
   409 
   408 void G1ScanRSForRegionClosure::scan_strong_code_roots(HeapRegion* r) {
   410 void G1ScanRSForRegionClosure::scan_strong_code_roots(HeapRegion* r) {
   409   EventGCPhaseParallel event;
   411   EventGCPhaseParallel event;
   410   r->strong_code_roots_do(_pss->closures()->weak_codeblobs());
   412   r->strong_code_roots_do(_pss->closures()->weak_codeblobs());
   435   return false;
   437   return false;
   436 }
   438 }
   437 
   439 
   438 void G1RemSet::scan_rem_set(G1ParScanThreadState* pss, uint worker_i) {
   440 void G1RemSet::scan_rem_set(G1ParScanThreadState* pss, uint worker_i) {
   439   G1ScanObjsDuringScanRSClosure scan_cl(_g1h, pss);
   441   G1ScanObjsDuringScanRSClosure scan_cl(_g1h, pss);
   440   G1ScanRSForRegionClosure cl(_scan_state, &scan_cl, pss, worker_i);
   442   G1ScanRSForRegionClosure cl(_scan_state, &scan_cl, pss, G1GCPhaseTimes::ScanRS, worker_i);
   441   _g1h->collection_set_iterate_from(&cl, worker_i);
   443   _g1h->collection_set_iterate_from(&cl, worker_i);
   442 
   444 
   443   G1GCPhaseTimes* p = _g1p->phase_times();
   445   G1GCPhaseTimes* p = _g1p->phase_times();
   444 
   446 
   445   p->record_time_secs(G1GCPhaseTimes::ScanRS, worker_i, cl.rem_set_root_scan_time().seconds());
   447   p->record_time_secs(G1GCPhaseTimes::ScanRS, worker_i, cl.rem_set_root_scan_time().seconds());