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

View File

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

View File

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