Skip to content

Commit 286a26c

Browse files
author
Hamlin Li
committedDec 6, 2021
8278277: G1: Simplify implementation of G1GCPhaseTimes::record_or_add_time_secs
Reviewed-by: iwalulya, sjohanss, tschatzl
1 parent d14f06a commit 286a26c

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed
 

‎src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp

+1-5
Original file line numberDiff line numberDiff line change
@@ -266,11 +266,7 @@ void G1GCPhaseTimes::add_time_secs(GCParPhases phase, uint worker_id, double sec
266266
}
267267

268268
void G1GCPhaseTimes::record_or_add_time_secs(GCParPhases phase, uint worker_id, double secs) {
269-
if (_gc_par_phases[phase]->get(worker_id) == _gc_par_phases[phase]->uninitialized()) {
270-
record_time_secs(phase, worker_id, secs);
271-
} else {
272-
add_time_secs(phase, worker_id, secs);
273-
}
269+
_gc_par_phases[phase]->set_or_add(worker_id, secs);
274270
}
275271

276272
double G1GCPhaseTimes::get_time_secs(GCParPhases phase, uint worker_id) {

0 commit comments

Comments
 (0)
Please sign in to comment.