105 { }
106
107 DirtyCardQueue::~DirtyCardQueue() {
108 if (!is_permanent()) {
109 flush();
110 }
111 }
112
113 DirtyCardQueueSet::DirtyCardQueueSet(bool notify_when_complete) :
114 PtrQueueSet(notify_when_complete),
115 _mut_process_closure(NULL),
116 _shared_dirty_card_queue(this, true /* permanent */),
117 _free_ids(NULL),
118 _processed_buffers_mut(0), _processed_buffers_rs_thread(0)
119 {
120 _all_active = true;
121 }
122
123 // Determines how many mutator threads can process the buffers in parallel.
124 uint DirtyCardQueueSet::num_par_ids() {
125 return (uint)os::processor_count();
126 }
127
128 void DirtyCardQueueSet::initialize(CardTableEntryClosure* cl,
129 Monitor* cbl_mon,
130 Mutex* fl_lock,
131 int process_completed_threshold,
132 int max_completed_queue,
133 Mutex* lock,
134 DirtyCardQueueSet* fl_owner,
135 bool init_free_ids) {
136 _mut_process_closure = cl;
137 PtrQueueSet::initialize(cbl_mon,
138 fl_lock,
139 process_completed_threshold,
140 max_completed_queue,
141 fl_owner);
142 set_buffer_size(G1UpdateBufferSize);
143 _shared_dirty_card_queue.set_lock(lock);
144 if (init_free_ids) {
145 _free_ids = new FreeIdSet(num_par_ids(), _cbl_mon);
|
105 { }
106
107 DirtyCardQueue::~DirtyCardQueue() {
108 if (!is_permanent()) {
109 flush();
110 }
111 }
112
113 DirtyCardQueueSet::DirtyCardQueueSet(bool notify_when_complete) :
114 PtrQueueSet(notify_when_complete),
115 _mut_process_closure(NULL),
116 _shared_dirty_card_queue(this, true /* permanent */),
117 _free_ids(NULL),
118 _processed_buffers_mut(0), _processed_buffers_rs_thread(0)
119 {
120 _all_active = true;
121 }
122
123 // Determines how many mutator threads can process the buffers in parallel.
124 uint DirtyCardQueueSet::num_par_ids() {
125 return (uint)os::initial_active_processor_count();
126 }
127
128 void DirtyCardQueueSet::initialize(CardTableEntryClosure* cl,
129 Monitor* cbl_mon,
130 Mutex* fl_lock,
131 int process_completed_threshold,
132 int max_completed_queue,
133 Mutex* lock,
134 DirtyCardQueueSet* fl_owner,
135 bool init_free_ids) {
136 _mut_process_closure = cl;
137 PtrQueueSet::initialize(cbl_mon,
138 fl_lock,
139 process_completed_threshold,
140 max_completed_queue,
141 fl_owner);
142 set_buffer_size(G1UpdateBufferSize);
143 _shared_dirty_card_queue.set_lock(lock);
144 if (init_free_ids) {
145 _free_ids = new FreeIdSet(num_par_ids(), _cbl_mon);
|