42 public:
43 GetRSThreadVTimeClosure(G1RemSetSummary * summary) : ThreadClosure(), _summary(summary), _counter(0) {
44 assert(_summary != NULL, "just checking");
45 }
46
47 virtual void do_thread(Thread* t) {
48 G1ConcurrentRefineThread* crt = (G1ConcurrentRefineThread*) t;
49 _summary->set_rs_thread_vtime(_counter, crt->vtime_accum());
50 _counter++;
51 }
52 };
53
54 void G1RemSetSummary::update() {
55 _num_conc_refined_cards = _rem_set->num_conc_refined_cards();
56 DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set();
57 _num_processed_buf_mutator = dcqs.processed_buffers_mut();
58 _num_processed_buf_rs_threads = dcqs.processed_buffers_rs_thread();
59
60 _num_coarsenings = HeapRegionRemSet::n_coarsenings();
61
62 G1ConcurrentRefine * cg1r = G1CollectedHeap::heap()->concurrent_g1_refine();
63 if (_rs_threads_vtimes != NULL) {
64 GetRSThreadVTimeClosure p(this);
65 cg1r->worker_threads_do(&p);
66 }
67 set_sampling_thread_vtime(cg1r->sampling_thread()->vtime_accum());
68 }
69
70 void G1RemSetSummary::set_rs_thread_vtime(uint thread, double value) {
71 assert(_rs_threads_vtimes != NULL, "just checking");
72 assert(thread < _num_vtimes, "just checking");
73 _rs_threads_vtimes[thread] = value;
74 }
75
76 double G1RemSetSummary::rs_thread_vtime(uint thread) const {
77 assert(_rs_threads_vtimes != NULL, "just checking");
78 assert(thread < _num_vtimes, "just checking");
79 return _rs_threads_vtimes[thread];
80 }
81
82 G1RemSetSummary::G1RemSetSummary() :
83 _rem_set(NULL),
84 _num_conc_refined_cards(0),
85 _num_processed_buf_mutator(0),
86 _num_processed_buf_rs_threads(0),
87 _num_coarsenings(0),
|
42 public:
43 GetRSThreadVTimeClosure(G1RemSetSummary * summary) : ThreadClosure(), _summary(summary), _counter(0) {
44 assert(_summary != NULL, "just checking");
45 }
46
47 virtual void do_thread(Thread* t) {
48 G1ConcurrentRefineThread* crt = (G1ConcurrentRefineThread*) t;
49 _summary->set_rs_thread_vtime(_counter, crt->vtime_accum());
50 _counter++;
51 }
52 };
53
54 void G1RemSetSummary::update() {
55 _num_conc_refined_cards = _rem_set->num_conc_refined_cards();
56 DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set();
57 _num_processed_buf_mutator = dcqs.processed_buffers_mut();
58 _num_processed_buf_rs_threads = dcqs.processed_buffers_rs_thread();
59
60 _num_coarsenings = HeapRegionRemSet::n_coarsenings();
61
62 G1ConcurrentRefine * cr = G1CollectedHeap::heap()->concurrent_refine();
63 if (_rs_threads_vtimes != NULL) {
64 GetRSThreadVTimeClosure p(this);
65 cr->worker_threads_do(&p);
66 }
67 set_sampling_thread_vtime(cr->sampling_thread()->vtime_accum());
68 }
69
70 void G1RemSetSummary::set_rs_thread_vtime(uint thread, double value) {
71 assert(_rs_threads_vtimes != NULL, "just checking");
72 assert(thread < _num_vtimes, "just checking");
73 _rs_threads_vtimes[thread] = value;
74 }
75
76 double G1RemSetSummary::rs_thread_vtime(uint thread) const {
77 assert(_rs_threads_vtimes != NULL, "just checking");
78 assert(thread < _num_vtimes, "just checking");
79 return _rs_threads_vtimes[thread];
80 }
81
82 G1RemSetSummary::G1RemSetSummary() :
83 _rem_set(NULL),
84 _num_conc_refined_cards(0),
85 _num_processed_buf_mutator(0),
86 _num_processed_buf_rs_threads(0),
87 _num_coarsenings(0),
|