--- old/src/hotspot/share/gc/g1/g1GCPhaseTimes.hpp 2018-04-13 11:50:00.103258337 +0200 +++ new/src/hotspot/share/gc/g1/g1GCPhaseTimes.hpp 2018-04-13 11:49:59.659244729 +0200 @@ -31,6 +31,7 @@ #include "utilities/macros.hpp" class LineBuffer; +class G1ParScanThreadState; class STWGCTimer; template class WorkerDataArray; @@ -196,8 +197,7 @@ // add a number of seconds to a phase void add_time_secs(GCParPhases phase, uint worker_i, double secs); - // Move a number of seconds from one phase to another. - void move_time_secs(GCParPhases from, GCParPhases to, uint worker_i, double secs); + void record_or_add_objcopy_time_secs(uint worker_i, double secs); void record_thread_work_item(GCParPhases phase, uint worker_i, size_t count, uint index = 0); @@ -366,14 +366,36 @@ ReferenceProcessorPhaseTimes* ref_phase_times() { return &_ref_phase_times; } }; -class G1GCParPhaseTimesTracker : public StackObj { +class G1EvacPhaseWithTrimTimeTracker : public StackObj { + G1ParScanThreadState* _pss; + Ticks _start; + + Tickspan& _total_time; + Tickspan& _trim_time; +public: + G1EvacPhaseWithTrimTimeTracker(G1ParScanThreadState* pss, Tickspan& total_time, Tickspan& trim_time); + ~G1EvacPhaseWithTrimTimeTracker(); +}; + +class G1GCParPhaseTimesTracker : public CHeapObj { +protected: double _start_time; G1GCPhaseTimes::GCParPhases _phase; G1GCPhaseTimes* _phase_times; uint _worker_id; public: G1GCParPhaseTimesTracker(G1GCPhaseTimes* phase_times, G1GCPhaseTimes::GCParPhases phase, uint worker_id); - ~G1GCParPhaseTimesTracker(); + virtual ~G1GCParPhaseTimesTracker(); +}; + +class G1EvacPhaseTimesTracker : public G1GCParPhaseTimesTracker { + Tickspan _total_time; + Tickspan _trim_time; + + G1EvacPhaseWithTrimTimeTracker _trim_tracker; +public: + G1EvacPhaseTimesTracker(G1GCPhaseTimes* phase_times, G1ParScanThreadState* pss, G1GCPhaseTimes::GCParPhases phase, uint worker_id); + virtual ~G1EvacPhaseTimesTracker(); }; #endif // SHARE_VM_GC_G1_G1GCPHASETIMES_HPP