281
282 G1RemSet::G1RemSet(G1CollectedHeap* g1,
283 CardTableModRefBS* ct_bs,
284 G1HotCardCache* hot_card_cache) :
285 _g1(g1),
286 _scan_state(new G1RemSetScanState()),
287 _num_conc_refined_cards(0),
288 _ct_bs(ct_bs),
289 _g1p(_g1->g1_policy()),
290 _hot_card_cache(hot_card_cache),
291 _prev_period_summary() {
292 }
293
294 G1RemSet::~G1RemSet() {
295 if (_scan_state != NULL) {
296 delete _scan_state;
297 }
298 }
299
300 uint G1RemSet::num_par_rem_sets() {
301 return MAX2(DirtyCardQueueSet::num_par_ids() + G1ConcurrentRefine::thread_num(), ParallelGCThreads);
302 }
303
304 void G1RemSet::initialize(size_t capacity, uint max_regions) {
305 G1FromCardCache::initialize(num_par_rem_sets(), max_regions);
306 _scan_state->initialize(max_regions);
307 {
308 GCTraceTime(Debug, gc, marking)("Initialize Card Live Data");
309 _card_live_data.initialize(capacity, max_regions);
310 }
311 if (G1PretouchAuxiliaryMemory) {
312 GCTraceTime(Debug, gc, marking)("Pre-Touch Card Live Data");
313 _card_live_data.pretouch();
314 }
315 }
316
317 G1ScanRSForRegionClosure::G1ScanRSForRegionClosure(G1RemSetScanState* scan_state,
318 G1ScanObjsDuringScanRSClosure* scan_obj_on_card,
319 CodeBlobClosure* code_root_cl,
320 uint worker_i) :
321 _scan_state(scan_state),
|
281
282 G1RemSet::G1RemSet(G1CollectedHeap* g1,
283 CardTableModRefBS* ct_bs,
284 G1HotCardCache* hot_card_cache) :
285 _g1(g1),
286 _scan_state(new G1RemSetScanState()),
287 _num_conc_refined_cards(0),
288 _ct_bs(ct_bs),
289 _g1p(_g1->g1_policy()),
290 _hot_card_cache(hot_card_cache),
291 _prev_period_summary() {
292 }
293
294 G1RemSet::~G1RemSet() {
295 if (_scan_state != NULL) {
296 delete _scan_state;
297 }
298 }
299
300 uint G1RemSet::num_par_rem_sets() {
301 return MAX2(DirtyCardQueueSet::num_par_ids() + G1ConcurrentRefine::max_num_threads(), ParallelGCThreads);
302 }
303
304 void G1RemSet::initialize(size_t capacity, uint max_regions) {
305 G1FromCardCache::initialize(num_par_rem_sets(), max_regions);
306 _scan_state->initialize(max_regions);
307 {
308 GCTraceTime(Debug, gc, marking)("Initialize Card Live Data");
309 _card_live_data.initialize(capacity, max_regions);
310 }
311 if (G1PretouchAuxiliaryMemory) {
312 GCTraceTime(Debug, gc, marking)("Pre-Touch Card Live Data");
313 _card_live_data.pretouch();
314 }
315 }
316
317 G1ScanRSForRegionClosure::G1ScanRSForRegionClosure(G1RemSetScanState* scan_state,
318 G1ScanObjsDuringScanRSClosure* scan_obj_on_card,
319 CodeBlobClosure* code_root_cl,
320 uint worker_i) :
321 _scan_state(scan_state),
|