src/hotspot/share/gc/g1/g1CollectedHeap.cpp
branchstuefe-new-metaspace-branch
changeset 58107 69c38b90014c
parent 58063 bdf136b8ae0e
parent 58081 8b08eaf9a0eb
child 58494 54c1ba464b78
equal deleted inserted replaced
58099:5aeb07390c74 58107:69c38b90014c
  3611       p->record_thread_work_item(termination_phase, worker_id, cl.term_attempts());
  3611       p->record_thread_work_item(termination_phase, worker_id, cl.term_attempts());
  3612     } else {
  3612     } else {
  3613       p->record_or_add_time_secs(termination_phase, worker_id, cl.term_time());
  3613       p->record_or_add_time_secs(termination_phase, worker_id, cl.term_time());
  3614       p->record_or_add_thread_work_item(termination_phase, worker_id, cl.term_attempts());
  3614       p->record_or_add_thread_work_item(termination_phase, worker_id, cl.term_attempts());
  3615     }
  3615     }
  3616     assert(pss->trim_ticks().seconds() == 0.0, "Unexpected partial trimming during evacuation");
       
  3617   }
  3616   }
  3618 
  3617 
  3619   virtual void start_work(uint worker_id) { }
  3618   virtual void start_work(uint worker_id) { }
  3620 
  3619 
  3621   virtual void end_work(uint worker_id) { }
  3620   virtual void end_work(uint worker_id) { }
  3653 };
  3652 };
  3654 
  3653 
  3655 class G1EvacuateRegionsTask : public G1EvacuateRegionsBaseTask {
  3654 class G1EvacuateRegionsTask : public G1EvacuateRegionsBaseTask {
  3656   G1RootProcessor* _root_processor;
  3655   G1RootProcessor* _root_processor;
  3657 
  3656 
       
  3657   void verify_trim_ticks(G1ParScanThreadState* pss, const char* location) {
       
  3658     assert(pss->trim_ticks().seconds() == 0.0, "Unexpected partial trimming during evacuation at %s %.3lf " JLONG_FORMAT, location, pss->trim_ticks().seconds(), pss->trim_ticks().value());
       
  3659   }
       
  3660 
  3658   void scan_roots(G1ParScanThreadState* pss, uint worker_id) {
  3661   void scan_roots(G1ParScanThreadState* pss, uint worker_id) {
  3659     _root_processor->evacuate_roots(pss, worker_id);
  3662     _root_processor->evacuate_roots(pss, worker_id);
       
  3663     verify_trim_ticks(pss, "roots");
  3660     _g1h->rem_set()->scan_heap_roots(pss, worker_id, G1GCPhaseTimes::ScanHR, G1GCPhaseTimes::ObjCopy);
  3664     _g1h->rem_set()->scan_heap_roots(pss, worker_id, G1GCPhaseTimes::ScanHR, G1GCPhaseTimes::ObjCopy);
       
  3665     verify_trim_ticks(pss, "heap roots");
  3661     _g1h->rem_set()->scan_collection_set_regions(pss, worker_id, G1GCPhaseTimes::ScanHR, G1GCPhaseTimes::CodeRoots, G1GCPhaseTimes::ObjCopy);
  3666     _g1h->rem_set()->scan_collection_set_regions(pss, worker_id, G1GCPhaseTimes::ScanHR, G1GCPhaseTimes::CodeRoots, G1GCPhaseTimes::ObjCopy);
       
  3667     verify_trim_ticks(pss, "scan cset");
  3662   }
  3668   }
  3663 
  3669 
  3664   void evacuate_live_objects(G1ParScanThreadState* pss, uint worker_id) {
  3670   void evacuate_live_objects(G1ParScanThreadState* pss, uint worker_id) {
  3665     G1EvacuateRegionsBaseTask::evacuate_live_objects(pss, worker_id, G1GCPhaseTimes::ObjCopy, G1GCPhaseTimes::Termination);
  3671     G1EvacuateRegionsBaseTask::evacuate_live_objects(pss, worker_id, G1GCPhaseTimes::ObjCopy, G1GCPhaseTimes::Termination);
       
  3672     verify_trim_ticks(pss, "evac live");
  3666   }
  3673   }
  3667 
  3674 
  3668   void start_work(uint worker_id) {
  3675   void start_work(uint worker_id) {
  3669     _g1h->phase_times()->record_time_secs(G1GCPhaseTimes::GCWorkerStart, worker_id, Ticks::now().seconds());
  3676     _g1h->phase_times()->record_time_secs(G1GCPhaseTimes::GCWorkerStart, worker_id, Ticks::now().seconds());
  3670   }
  3677   }