--- old/src/hotspot/share/gc/g1/g1RootProcessor.cpp 2018-04-13 11:50:10.655581727 +0200 +++ new/src/hotspot/share/gc/g1/g1RootProcessor.cpp 2018-04-13 11:50:10.298570786 +0200 @@ -72,10 +72,12 @@ _lock(Mutex::leaf, "G1 Root Scanning barrier lock", false, Monitor::_safepoint_check_never), _n_workers_discovered_strong_classes(0) {} -void G1RootProcessor::evacuate_roots(G1ParScanThreadState* pss, G1EvacuationRootClosures* closures, uint worker_i) { - double ext_roots_start = os::elapsedTime(); +void G1RootProcessor::evacuate_roots(G1ParScanThreadState* pss, uint worker_i) { G1GCPhaseTimes* phase_times = _g1h->g1_policy()->phase_times(); + G1EvacPhaseTimesTracker timer(phase_times, pss, G1GCPhaseTimes::ExtRootScan, worker_i); + + G1EvacuationRootClosures* closures = pss->closures(); process_java_roots(closures, phase_times, worker_i); // This is the point where this worker thread will not find more strong CLDs/nmethods. @@ -117,14 +119,6 @@ assert(closures->second_pass_weak_clds() == NULL, "Should be null if not tracing metadata."); } - double const obj_copy_time_sec = TicksToTimeHelper::seconds(pss->trim_ticks_and_reset()); - - phase_times->record_time_secs(G1GCPhaseTimes::ObjCopy, worker_i, obj_copy_time_sec); - - double ext_root_time_sec = os::elapsedTime() - ext_roots_start - obj_copy_time_sec; - - phase_times->record_time_secs(G1GCPhaseTimes::ExtRootScan, worker_i, ext_root_time_sec); - // During conc marking we have to filter the per-thread SATB buffers // to make sure we remove any oops into the CSet (which will show up // as implicitly live).