src/hotspot/share/gc/g1/g1RemSet.cpp
changeset 54934 39814e0a8964
parent 54844 571732021d59
child 54977 ab96027e99ed
equal deleted inserted replaced
54933:24c0eeb3ebe7 54934:39814e0a8964
   186   }
   186   }
   187 
   187 
   188   void reset() {
   188   void reset() {
   189     for (uint i = 0; i < _max_regions; i++) {
   189     for (uint i = 0; i < _max_regions; i++) {
   190       _iter_states[i] = Unclaimed;
   190       _iter_states[i] = Unclaimed;
   191       _scan_top[i] = NULL;
   191       clear_scan_top(i);
   192     }
   192     }
   193 
   193 
   194     G1ResetScanTopClosure cl(_scan_top);
   194     G1ResetScanTopClosure cl(_scan_top);
   195     G1CollectedHeap::heap()->heap_region_iterate(&cl);
   195     G1CollectedHeap::heap()->heap_region_iterate(&cl);
   196 
   196 
   249     }
   249     }
   250   }
   250   }
   251 
   251 
   252   HeapWord* scan_top(uint region_idx) const {
   252   HeapWord* scan_top(uint region_idx) const {
   253     return _scan_top[region_idx];
   253     return _scan_top[region_idx];
       
   254   }
       
   255 
       
   256   void clear_scan_top(uint region_idx) {
       
   257     _scan_top[region_idx] = NULL;
   254   }
   258   }
   255 
   259 
   256   // Clear the card table of "dirty" regions.
   260   // Clear the card table of "dirty" regions.
   257   void clear_card_table(WorkGang* workers) {
   261   void clear_card_table(WorkGang* workers) {
   258     if (_cur_dirty_region == 0) {
   262     if (_cur_dirty_region == 0) {
   344   EventGCPhaseParallel event;
   348   EventGCPhaseParallel event;
   345 
   349 
   346   G1OopStarChunkedList* opt_rem_set_list = _pss->oops_into_optional_region(r);
   350   G1OopStarChunkedList* opt_rem_set_list = _pss->oops_into_optional_region(r);
   347 
   351 
   348   G1ScanCardClosure scan_cl(_g1h, _pss);
   352   G1ScanCardClosure scan_cl(_g1h, _pss);
   349   G1ScanRSForOptionalClosure cl(&scan_cl);
   353   G1ScanRSForOptionalClosure cl(_g1h, &scan_cl);
   350   _opt_refs_scanned += opt_rem_set_list->oops_do(&cl, _pss->closures()->raw_strong_oops());
   354   _opt_refs_scanned += opt_rem_set_list->oops_do(&cl, _pss->closures()->raw_strong_oops());
   351   _opt_refs_memory_used += opt_rem_set_list->used_memory();
   355   _opt_refs_memory_used += opt_rem_set_list->used_memory();
   352 
   356 
   353   event.commit(GCId::current(), _worker_i, G1GCPhaseTimes::phase_name(_phase));
   357   event.commit(GCId::current(), _worker_i, G1GCPhaseTimes::phase_name(_phase));
   354 }
   358 }
   546 }
   550 }
   547 
   551 
   548 void G1RemSet::prepare_for_scan_rem_set() {
   552 void G1RemSet::prepare_for_scan_rem_set() {
   549   G1BarrierSet::dirty_card_queue_set().concatenate_logs();
   553   G1BarrierSet::dirty_card_queue_set().concatenate_logs();
   550   _scan_state->reset();
   554   _scan_state->reset();
       
   555 }
       
   556 
       
   557 void G1RemSet::prepare_for_scan_rem_set(uint region_idx) {
       
   558   _scan_state->clear_scan_top(region_idx);
   551 }
   559 }
   552 
   560 
   553 void G1RemSet::cleanup_after_scan_rem_set() {
   561 void G1RemSet::cleanup_after_scan_rem_set() {
   554   G1GCPhaseTimes* phase_times = _g1h->phase_times();
   562   G1GCPhaseTimes* phase_times = _g1h->phase_times();
   555 
   563