3612 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()); |
3613 } else { |
3612 } else { |
3614 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()); |
3615 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()); |
3616 } |
3615 } |
|
3616 assert(pss->trim_ticks().seconds() == 0.0, "Unexpected partial trimming during evacuation"); |
3617 } |
3617 } |
3618 |
3618 |
3619 virtual void start_work(uint worker_id) { } |
3619 virtual void start_work(uint worker_id) { } |
3620 |
3620 |
3621 virtual void end_work(uint worker_id) { } |
3621 virtual void end_work(uint worker_id) { } |
3653 }; |
3653 }; |
3654 |
3654 |
3655 class G1EvacuateRegionsTask : public G1EvacuateRegionsBaseTask { |
3655 class G1EvacuateRegionsTask : public G1EvacuateRegionsBaseTask { |
3656 G1RootProcessor* _root_processor; |
3656 G1RootProcessor* _root_processor; |
3657 |
3657 |
3658 void verify_trim_ticks(G1ParScanThreadState* pss, const char* location) { |
|
3659 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()); |
|
3660 } |
|
3661 |
|
3662 void scan_roots(G1ParScanThreadState* pss, uint worker_id) { |
3658 void scan_roots(G1ParScanThreadState* pss, uint worker_id) { |
3663 _root_processor->evacuate_roots(pss, worker_id); |
3659 _root_processor->evacuate_roots(pss, worker_id); |
3664 verify_trim_ticks(pss, "roots"); |
|
3665 _g1h->rem_set()->scan_heap_roots(pss, worker_id, G1GCPhaseTimes::ScanHR, G1GCPhaseTimes::ObjCopy); |
3660 _g1h->rem_set()->scan_heap_roots(pss, worker_id, G1GCPhaseTimes::ScanHR, G1GCPhaseTimes::ObjCopy); |
3666 verify_trim_ticks(pss, "heap roots"); |
|
3667 _g1h->rem_set()->scan_collection_set_regions(pss, worker_id, G1GCPhaseTimes::ScanHR, G1GCPhaseTimes::CodeRoots, G1GCPhaseTimes::ObjCopy); |
3661 _g1h->rem_set()->scan_collection_set_regions(pss, worker_id, G1GCPhaseTimes::ScanHR, G1GCPhaseTimes::CodeRoots, G1GCPhaseTimes::ObjCopy); |
3668 verify_trim_ticks(pss, "scan cset"); |
|
3669 } |
3662 } |
3670 |
3663 |
3671 void evacuate_live_objects(G1ParScanThreadState* pss, uint worker_id) { |
3664 void evacuate_live_objects(G1ParScanThreadState* pss, uint worker_id) { |
3672 G1EvacuateRegionsBaseTask::evacuate_live_objects(pss, worker_id, G1GCPhaseTimes::ObjCopy, G1GCPhaseTimes::Termination); |
3665 G1EvacuateRegionsBaseTask::evacuate_live_objects(pss, worker_id, G1GCPhaseTimes::ObjCopy, G1GCPhaseTimes::Termination); |
3673 verify_trim_ticks(pss, "evac live"); |
|
3674 } |
3666 } |
3675 |
3667 |
3676 void start_work(uint worker_id) { |
3668 void start_work(uint worker_id) { |
3677 _g1h->phase_times()->record_time_secs(G1GCPhaseTimes::GCWorkerStart, worker_id, Ticks::now().seconds()); |
3669 _g1h->phase_times()->record_time_secs(G1GCPhaseTimes::GCWorkerStart, worker_id, Ticks::now().seconds()); |
3678 } |
3670 } |
4104 |
4096 |
4105 void complete_work() { |
4097 void complete_work() { |
4106 _cl.complete_work(); |
4098 _cl.complete_work(); |
4107 |
4099 |
4108 G1Policy* policy = G1CollectedHeap::heap()->policy(); |
4100 G1Policy* policy = G1CollectedHeap::heap()->policy(); |
4109 policy->record_max_rs_length(_rs_length); |
4101 policy->record_rs_length(_rs_length); |
4110 policy->cset_regions_freed(); |
4102 policy->cset_regions_freed(); |
4111 } |
4103 } |
4112 public: |
4104 public: |
4113 G1FreeCollectionSetTask(G1CollectionSet* collection_set, G1EvacuationInfo* evacuation_info, const size_t* surviving_young_words) : |
4105 G1FreeCollectionSetTask(G1CollectionSet* collection_set, G1EvacuationInfo* evacuation_info, const size_t* surviving_young_words) : |
4114 AbstractGangTask("G1 Free Collection Set"), |
4106 AbstractGangTask("G1 Free Collection Set"), |