8278277: G1: Simplify implementation of G1GCPhaseTimes::record_or_add_time_secs

Reviewed-by: iwalulya, sjohanss, tschatzl
This commit is contained in:
Hamlin Li 2021-12-06 11:50:11 +00:00
parent d14f06a963
commit 286a26c366

@ -266,11 +266,7 @@ void G1GCPhaseTimes::add_time_secs(GCParPhases phase, uint worker_id, double sec
}
void G1GCPhaseTimes::record_or_add_time_secs(GCParPhases phase, uint worker_id, double secs) {
if (_gc_par_phases[phase]->get(worker_id) == _gc_par_phases[phase]->uninitialized()) {
record_time_secs(phase, worker_id, secs);
} else {
add_time_secs(phase, worker_id, secs);
}
_gc_par_phases[phase]->set_or_add(worker_id, secs);
}
double G1GCPhaseTimes::get_time_secs(GCParPhases phase, uint worker_id) {