4419
4420 void work(uint worker_id) {
4421 if (worker_id >= _n_workers) return; // no work needed this round
4422
4423 double start_sec = os::elapsedTime();
4424 _g1h->g1_policy()->phase_times()->record_time_secs(G1GCPhaseTimes::GCWorkerStart, worker_id, start_sec);
4425
4426 {
4427 ResourceMark rm;
4428 HandleMark hm;
4429
4430 ReferenceProcessor* rp = _g1h->ref_processor_stw();
4431
4432 G1ParScanThreadState* pss = _pss->state_for_worker(worker_id);
4433 pss->set_ref_processor(rp);
4434
4435 double start_strong_roots_sec = os::elapsedTime();
4436
4437 _root_processor->evacuate_roots(pss->closures(), worker_id);
4438
4439 G1ParPushHeapRSClosure push_heap_rs_cl(_g1h, pss);
4440 size_t cards_scanned = _g1h->g1_rem_set()->oops_into_collection_set_do(&push_heap_rs_cl,
4441 pss->closures()->weak_codeblobs(),
4442 worker_id);
4443
4444 _pss->add_cards_scanned(worker_id, cards_scanned);
4445
4446 double strong_roots_sec = os::elapsedTime() - start_strong_roots_sec;
4447
4448 double term_sec = 0.0;
4449 size_t evac_term_attempts = 0;
4450 {
4451 double start = os::elapsedTime();
4452 G1ParEvacuateFollowersClosure evac(_g1h, pss, _queues, &_terminator);
4453 evac.do_void();
4454
4455 evac_term_attempts = evac.term_attempts();
4456 term_sec = evac.term_time();
4457 double elapsed_sec = os::elapsedTime() - start;
4458 _g1h->g1_policy()->phase_times()->add_time_secs(G1GCPhaseTimes::ObjCopy, worker_id, elapsed_sec - term_sec);
4459 _g1h->g1_policy()->phase_times()->record_time_secs(G1GCPhaseTimes::Termination, worker_id, term_sec);
4460 _g1h->g1_policy()->phase_times()->record_thread_work_item(G1GCPhaseTimes::Termination, worker_id, evac_term_attempts);
4461 }
4462
|
4419
4420 void work(uint worker_id) {
4421 if (worker_id >= _n_workers) return; // no work needed this round
4422
4423 double start_sec = os::elapsedTime();
4424 _g1h->g1_policy()->phase_times()->record_time_secs(G1GCPhaseTimes::GCWorkerStart, worker_id, start_sec);
4425
4426 {
4427 ResourceMark rm;
4428 HandleMark hm;
4429
4430 ReferenceProcessor* rp = _g1h->ref_processor_stw();
4431
4432 G1ParScanThreadState* pss = _pss->state_for_worker(worker_id);
4433 pss->set_ref_processor(rp);
4434
4435 double start_strong_roots_sec = os::elapsedTime();
4436
4437 _root_processor->evacuate_roots(pss->closures(), worker_id);
4438
4439 size_t cards_scanned = _g1h->g1_rem_set()->oops_into_collection_set_do(pss->closures(), worker_id);
4440
4441 _pss->add_cards_scanned(worker_id, cards_scanned);
4442
4443 double strong_roots_sec = os::elapsedTime() - start_strong_roots_sec;
4444
4445 double term_sec = 0.0;
4446 size_t evac_term_attempts = 0;
4447 {
4448 double start = os::elapsedTime();
4449 G1ParEvacuateFollowersClosure evac(_g1h, pss, _queues, &_terminator);
4450 evac.do_void();
4451
4452 evac_term_attempts = evac.term_attempts();
4453 term_sec = evac.term_time();
4454 double elapsed_sec = os::elapsedTime() - start;
4455 _g1h->g1_policy()->phase_times()->add_time_secs(G1GCPhaseTimes::ObjCopy, worker_id, elapsed_sec - term_sec);
4456 _g1h->g1_policy()->phase_times()->record_time_secs(G1GCPhaseTimes::Termination, worker_id, term_sec);
4457 _g1h->g1_policy()->phase_times()->record_thread_work_item(G1GCPhaseTimes::Termination, worker_id, evac_term_attempts);
4458 }
4459
|