8243487: Shenandoah: make _num_phases illegal phase type

Reviewed-by: rkennke
This commit is contained in:
Aleksey Shipilev 2020-04-23 18:37:09 +02:00
parent 8db994854f
commit 079b60c6b9
3 changed files with 11 additions and 10 deletions

View file

@ -81,18 +81,16 @@ void ShenandoahPhaseTimings::record_workers_end(Phase phase) {
phase == degen_gc_update_roots || phase == degen_gc_update_roots ||
phase == full_gc_purge_par || phase == full_gc_purge_par ||
phase == purge_par || phase == purge_par ||
phase == _num_phases, phase == heap_iteration_roots,
"Phase should accept accept per-thread phase times: %s", phase_name(phase)); "Phase should accept accept per-thread phase times: %s", phase_name(phase));
if (phase != _num_phases) { double s = 0;
double s = 0; for (uint i = 1; i < GCParPhasesSentinel; i++) {
for (uint i = 1; i < GCParPhasesSentinel; i++) { double t = _gc_par_phases[i]->sum();
double t = _gc_par_phases[i]->sum(); _timing_data[phase + i + 1].add(t); // add to each line in phase
_timing_data[phase + i + 1].add(t); // add to each line in phase s += t;
s += t;
}
_timing_data[phase + 1].add(s); // add to total for phase
} }
_timing_data[phase + 1].add(s); // add to total for phase
} }
void ShenandoahPhaseTimings::print_on(outputStream* out) const { void ShenandoahPhaseTimings::print_on(outputStream* out) const {

View file

@ -144,6 +144,9 @@ class outputStream;
f(full_gc_resize_tlabs, " Resize TLABs") \ f(full_gc_resize_tlabs, " Resize TLABs") \
\ \
f(conc_uncommit, "Concurrent Uncommit") \ f(conc_uncommit, "Concurrent Uncommit") \
\
f(heap_iteration_roots, "Heap Iteration") \
SHENANDOAH_GC_PAR_PHASE_DO(heap_iteration_roots_, " HI: ", f) \
// end // end
class ShenandoahPhaseTimings : public CHeapObj<mtGC> { class ShenandoahPhaseTimings : public CHeapObj<mtGC> {

View file

@ -248,7 +248,7 @@ void ShenandoahRootAdjuster::roots_do(uint worker_id, OopClosure* oops) {
} }
ShenandoahHeapIterationRootScanner::ShenandoahHeapIterationRootScanner() : ShenandoahHeapIterationRootScanner::ShenandoahHeapIterationRootScanner() :
ShenandoahRootProcessor(ShenandoahPhaseTimings::_num_phases), ShenandoahRootProcessor(ShenandoahPhaseTimings::heap_iteration_roots),
_thread_roots(false /*is par*/) { _thread_roots(false /*is par*/) {
} }