61 62 static IntHistogram card_repeat_count(10, 10); 63 64 void ct_freq_update_histo_and_reset() { 65 for (size_t j = 0; j < ct_freq_sz; j++) { 66 card_repeat_count.add_entry(ct_freq[j]); 67 ct_freq[j] = 0; 68 } 69 70 } 71 #endif 72 73 G1RemSet::G1RemSet(G1CollectedHeap* g1, CardTableModRefBS* ct_bs) 74 : _g1(g1), _conc_refine_cards(0), 75 _ct_bs(ct_bs), _g1p(_g1->g1_policy()), 76 _cg1r(g1->concurrent_g1_refine()), 77 _cset_rs_update_cl(NULL), 78 _cards_scanned(NULL), _total_cards_scanned(0), 79 _prev_period_summary() 80 { 81 _seq_task = new SubTasksDone(NumSeqTasks); 82 guarantee(n_workers() > 0, "There should be some workers"); 83 _cset_rs_update_cl = NEW_C_HEAP_ARRAY(OopsInHeapRegionClosure*, n_workers(), mtGC); 84 for (uint i = 0; i < n_workers(); i++) { 85 _cset_rs_update_cl[i] = NULL; 86 } 87 if (G1SummarizeRSetStats) { 88 _prev_period_summary.initialize(this); 89 } 90 } 91 92 G1RemSet::~G1RemSet() { 93 delete _seq_task; 94 for (uint i = 0; i < n_workers(); i++) { 95 assert(_cset_rs_update_cl[i] == NULL, "it should be"); 96 } 97 FREE_C_HEAP_ARRAY(OopsInHeapRegionClosure*, _cset_rs_update_cl, mtGC); 98 } 99 100 void CountNonCleanMemRegionClosure::do_MemRegion(MemRegion mr) { 101 if (_g1->is_in_g1_reserved(mr.start())) { 102 _n += (int) ((mr.byte_size() / CardTableModRefBS::card_size)); 103 if (_start_first == NULL) _start_first = mr.start(); 104 } 105 } 106 107 class ScanRSClosure : public HeapRegionClosure { 108 size_t _cards_done, _cards; 109 G1CollectedHeap* _g1h; 110 111 OopsInHeapRegionClosure* _oc; 112 CodeBlobClosure* _code_root_cl; 113 | 61 62 static IntHistogram card_repeat_count(10, 10); 63 64 void ct_freq_update_histo_and_reset() { 65 for (size_t j = 0; j < ct_freq_sz; j++) { 66 card_repeat_count.add_entry(ct_freq[j]); 67 ct_freq[j] = 0; 68 } 69 70 } 71 #endif 72 73 G1RemSet::G1RemSet(G1CollectedHeap* g1, CardTableModRefBS* ct_bs) 74 : _g1(g1), _conc_refine_cards(0), 75 _ct_bs(ct_bs), _g1p(_g1->g1_policy()), 76 _cg1r(g1->concurrent_g1_refine()), 77 _cset_rs_update_cl(NULL), 78 _cards_scanned(NULL), _total_cards_scanned(0), 79 _prev_period_summary() 80 { 81 guarantee(n_workers() > 0, "There should be some workers"); 82 _cset_rs_update_cl = NEW_C_HEAP_ARRAY(OopsInHeapRegionClosure*, n_workers(), mtGC); 83 for (uint i = 0; i < n_workers(); i++) { 84 _cset_rs_update_cl[i] = NULL; 85 } 86 if (G1SummarizeRSetStats) { 87 _prev_period_summary.initialize(this); 88 } 89 } 90 91 G1RemSet::~G1RemSet() { 92 for (uint i = 0; i < n_workers(); i++) { 93 assert(_cset_rs_update_cl[i] == NULL, "it should be"); 94 } 95 FREE_C_HEAP_ARRAY(OopsInHeapRegionClosure*, _cset_rs_update_cl, mtGC); 96 } 97 98 void CountNonCleanMemRegionClosure::do_MemRegion(MemRegion mr) { 99 if (_g1->is_in_g1_reserved(mr.start())) { 100 _n += (int) ((mr.byte_size() / CardTableModRefBS::card_size)); 101 if (_start_first == NULL) _start_first = mr.start(); 102 } 103 } 104 105 class ScanRSClosure : public HeapRegionClosure { 106 size_t _cards_done, _cards; 107 G1CollectedHeap* _g1h; 108 109 OopsInHeapRegionClosure* _oc; 110 CodeBlobClosure* _code_root_cl; 111 |