137 G1StringDedupQueue::unlink_or_oops_do(&_cl);
138
139 double table_fixup_start = os::elapsedTime();
140 G1StringDedupTable::unlink_or_oops_do(&_cl, worker_id);
141
142 double queue_fixup_time_ms = (table_fixup_start - queue_fixup_start) * 1000.0;
143 double table_fixup_time_ms = (os::elapsedTime() - table_fixup_start) * 1000.0;
144 G1CollectorPolicy* g1p = G1CollectedHeap::heap()->g1_policy();
145 g1p->phase_times()->record_string_dedup_queue_fixup_worker_time(worker_id, queue_fixup_time_ms);
146 g1p->phase_times()->record_string_dedup_table_fixup_worker_time(worker_id, table_fixup_time_ms);
147 }
148 };
149
150 void G1StringDedup::unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* keep_alive, bool allow_resize_and_rehash) {
151 assert(is_enabled(), "String deduplication not enabled");
152 G1CollectorPolicy* g1p = G1CollectedHeap::heap()->g1_policy();
153 g1p->phase_times()->note_string_dedup_fixup_start();
154 double fixup_start = os::elapsedTime();
155
156 G1StringDedupUnlinkOrOopsDoTask task(is_alive, keep_alive, allow_resize_and_rehash);
157 if (G1CollectedHeap::use_parallel_gc_threads()) {
158 G1CollectedHeap* g1h = G1CollectedHeap::heap();
159 g1h->set_par_threads();
160 g1h->workers()->run_task(&task);
161 g1h->set_par_threads(0);
162 } else {
163 task.work(0);
164 }
165
166 double fixup_time_ms = (os::elapsedTime() - fixup_start) * 1000.0;
167 g1p->phase_times()->record_string_dedup_fixup_time(fixup_time_ms);
168 g1p->phase_times()->note_string_dedup_fixup_end();
169 }
170
171 void G1StringDedup::threads_do(ThreadClosure* tc) {
172 assert(is_enabled(), "String deduplication not enabled");
173 tc->do_thread(G1StringDedupThread::thread());
174 }
175
176 void G1StringDedup::print_worker_threads_on(outputStream* st) {
177 assert(is_enabled(), "String deduplication not enabled");
178 G1StringDedupThread::thread()->print_on(st);
179 st->cr();
180 }
181
182 void G1StringDedup::verify() {
183 assert(is_enabled(), "String deduplication not enabled");
184 G1StringDedupQueue::verify();
|
137 G1StringDedupQueue::unlink_or_oops_do(&_cl);
138
139 double table_fixup_start = os::elapsedTime();
140 G1StringDedupTable::unlink_or_oops_do(&_cl, worker_id);
141
142 double queue_fixup_time_ms = (table_fixup_start - queue_fixup_start) * 1000.0;
143 double table_fixup_time_ms = (os::elapsedTime() - table_fixup_start) * 1000.0;
144 G1CollectorPolicy* g1p = G1CollectedHeap::heap()->g1_policy();
145 g1p->phase_times()->record_string_dedup_queue_fixup_worker_time(worker_id, queue_fixup_time_ms);
146 g1p->phase_times()->record_string_dedup_table_fixup_worker_time(worker_id, table_fixup_time_ms);
147 }
148 };
149
150 void G1StringDedup::unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* keep_alive, bool allow_resize_and_rehash) {
151 assert(is_enabled(), "String deduplication not enabled");
152 G1CollectorPolicy* g1p = G1CollectedHeap::heap()->g1_policy();
153 g1p->phase_times()->note_string_dedup_fixup_start();
154 double fixup_start = os::elapsedTime();
155
156 G1StringDedupUnlinkOrOopsDoTask task(is_alive, keep_alive, allow_resize_and_rehash);
157 G1CollectedHeap* g1h = G1CollectedHeap::heap();
158 g1h->set_par_threads();
159 g1h->workers()->run_task(&task);
160 g1h->set_par_threads(0);
161
162 double fixup_time_ms = (os::elapsedTime() - fixup_start) * 1000.0;
163 g1p->phase_times()->record_string_dedup_fixup_time(fixup_time_ms);
164 g1p->phase_times()->note_string_dedup_fixup_end();
165 }
166
167 void G1StringDedup::threads_do(ThreadClosure* tc) {
168 assert(is_enabled(), "String deduplication not enabled");
169 tc->do_thread(G1StringDedupThread::thread());
170 }
171
172 void G1StringDedup::print_worker_threads_on(outputStream* st) {
173 assert(is_enabled(), "String deduplication not enabled");
174 G1StringDedupThread::thread()->print_on(st);
175 st->cr();
176 }
177
178 void G1StringDedup::verify() {
179 assert(is_enabled(), "String deduplication not enabled");
180 G1StringDedupQueue::verify();
|