diff -r 506ccf1717fd -r 78a0fd90a70f hotspot/src/share/vm/gc/shared/gcTraceSend.cpp --- a/hotspot/src/share/vm/gc/shared/gcTraceSend.cpp Mon Dec 21 14:09:21 2015 +0000 +++ b/hotspot/src/share/vm/gc/shared/gcTraceSend.cpp Fri Dec 18 08:17:30 2015 -0800 @@ -418,30 +418,46 @@ } class PhaseSender : public PhaseVisitor { + void visit_pause(GCPhase* phase) { + assert(phase->level() < PhasesStack::PHASE_LEVELS, "Need more event types for PausePhase"); + + switch (phase->level()) { + case 0: send_phase(phase); break; + case 1: send_phase(phase); break; + case 2: send_phase(phase); break; + case 3: send_phase(phase); break; + default: /* Ignore sending this phase */ break; + } + } + + void visit_concurrent(GCPhase* phase) { + assert(phase->level() < 1, "There is only one level for ConcurrentPhase"); + + switch (phase->level()) { + case 0: send_phase(phase); break; + default: /* Ignore sending this phase */ break; + } + } + public: template - void send_phase(PausePhase* pause) { + void send_phase(GCPhase* phase) { T event(UNTIMED); if (event.should_commit()) { event.set_gcId(GCId::current()); - event.set_name(pause->name()); - event.set_starttime(pause->start()); - event.set_endtime(pause->end()); + event.set_name(phase->name()); + event.set_starttime(phase->start()); + event.set_endtime(phase->end()); event.commit(); } } - void visit(GCPhase* pause) { ShouldNotReachHere(); } - void visit(ConcurrentPhase* pause) { Unimplemented(); } - void visit(PausePhase* pause) { - assert(PhasesStack::PHASE_LEVELS == 5, "Need more event types"); - - switch (pause->level()) { - case 0: send_phase(pause); break; - case 1: send_phase(pause); break; - case 2: send_phase(pause); break; - case 3: send_phase(pause); break; - default: /* Ignore sending this phase */ break; + void visit(GCPhase* phase) { + if (phase->type() == GCPhase::PausePhaseType) { + visit_pause(phase); + } else { + assert(phase->type() == GCPhase::ConcurrentPhaseType, "Should be ConcurrentPhaseType"); + visit_concurrent(phase); } } };