< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahUtils.cpp

Print this page
rev 59104 : 8244243: Shenandoah: Cleanup Shenandoah phase timing tracking and JFR event supporting

@@ -33,11 +33,11 @@
 #include "gc/shenandoah/shenandoahHeap.hpp"
 #include "gc/shenandoah/shenandoahHeuristics.hpp"
 #include "gc/shenandoah/shenandoahUtils.hpp"
 #include "utilities/debug.hpp"
 
-ShenandoahPhaseTimings::Phase ShenandoahGCPhase::_current_phase = ShenandoahPhaseTimings::_invalid_phase;
+ShenandoahPhaseTimings::Phase ShenandoahGCPhaseTiming::_current_phase = ShenandoahPhaseTimings::_invalid_phase;
 
 ShenandoahGCSession::ShenandoahGCSession(GCCause::Cause cause) :
   _heap(ShenandoahHeap::heap()),
   _timer(_heap->gc_timer()),
   _tracer(_heap->tracer()) {

@@ -83,57 +83,59 @@
           /* recordGCEndTime = */         true,
           /* countCollection = */         true
   );
 }
 
-ShenandoahPausePhase::ShenandoahPausePhase(const char* title, bool log_heap_usage) :
+ShenandoahPausePhase::ShenandoahPausePhase(const char* title, ShenandoahPhaseTimings::Phase phase, bool log_heap_usage) :
+  ShenandoahGCPhaseTiming(phase),
   _tracer(title, NULL, GCCause::_no_gc, log_heap_usage),
   _timer(ShenandoahHeap::heap()->gc_timer()) {
   _timer->register_gc_pause_start(title);
 }
 
 ShenandoahPausePhase::~ShenandoahPausePhase() {
   _timer->register_gc_pause_end();
 }
 
-ShenandoahConcurrentPhase::ShenandoahConcurrentPhase(const char* title, bool log_heap_usage) :
+ShenandoahConcurrentPhase::ShenandoahConcurrentPhase(const char* title, ShenandoahPhaseTimings::Phase phase, bool log_heap_usage) :
+  ShenandoahGCPhaseTiming(phase),
   _tracer(title, NULL, GCCause::_no_gc, log_heap_usage),
   _timer(ShenandoahHeap::heap()->gc_timer()) {
   _timer->register_gc_concurrent_start(title);
 }
 
 ShenandoahConcurrentPhase::~ShenandoahConcurrentPhase() {
   _timer->register_gc_concurrent_end();
 }
 
-ShenandoahGCPhase::ShenandoahGCPhase(ShenandoahPhaseTimings::Phase phase) :
+ShenandoahGCPhaseTiming::ShenandoahGCPhaseTiming(ShenandoahPhaseTimings::Phase phase) :
   _timings(ShenandoahHeap::heap()->phase_timings()), _phase(phase) {
   assert(!Thread::current()->is_Worker_thread() &&
               (Thread::current()->is_VM_thread() ||
                Thread::current()->is_ConcurrentGC_thread()),
           "Must be set by these threads");
   _parent_phase = _current_phase;
   _current_phase = phase;
   _start = os::elapsedTime();
 }
 
-ShenandoahGCPhase::~ShenandoahGCPhase() {
+ShenandoahGCPhaseTiming::~ShenandoahGCPhaseTiming() {
   _timings->record_phase_time(_phase, os::elapsedTime() - _start);
   _current_phase = _parent_phase;
 }
 
-bool ShenandoahGCPhase::is_current_phase_valid() {
+bool ShenandoahGCPhaseTiming::is_current_phase_valid() {
   return _current_phase < ShenandoahPhaseTimings::_num_phases;
 }
 
-ShenandoahGCSubPhase::ShenandoahGCSubPhase(ShenandoahPhaseTimings::Phase phase) :
-  ShenandoahGCPhase(phase),
+ShenandoahGCPhase::ShenandoahGCPhase(ShenandoahPhaseTimings::Phase phase) :
+  ShenandoahGCPhaseTiming(phase),
   _timer(ShenandoahHeap::heap()->gc_timer()) {
   _timer->register_gc_phase_start(ShenandoahPhaseTimings::phase_name(phase), Ticks::now());
 }
 
-ShenandoahGCSubPhase::~ShenandoahGCSubPhase() {
+ShenandoahGCPhase::~ShenandoahGCPhase() {
   _timer->register_gc_phase_end(Ticks::now());
 }
 
 ShenandoahGCWorkerPhase::ShenandoahGCWorkerPhase(const ShenandoahPhaseTimings::Phase phase) :
     _timings(ShenandoahHeap::heap()->phase_timings()), _phase(phase) {
< prev index next >