Skip to content

Commit d9bb8dd

Browse files
Satyen SubramaniamVladimir Kozlov
Satyen Subramaniam
authored and
Vladimir Kozlov
committed
8346264: "Total compile time" counter should include time spent in failing/bailout compiles
Backport-of: 12700cb
1 parent a12f9f2 commit d9bb8dd

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/hotspot/share/compiler/compileBroker.cpp

+5-6
Original file line numberDiff line numberDiff line change
@@ -2501,6 +2501,11 @@ void CompileBroker::collect_statistics(CompilerThread* thread, elapsedTimer time
25012501
// C1 and C2 counters are counting both successful and unsuccessful compiles
25022502
_t_total_compilation.add(time);
25032503

2504+
// Update compilation times. Used by the implementation of JFR CompilerStatistics
2505+
// and java.lang.management.CompilationMXBean.
2506+
_perf_total_compilation->inc(time.ticks());
2507+
_peak_compilation_time = MAX2(time.milliseconds(), _peak_compilation_time);
2508+
25042509
if (!success) {
25052510
_total_bailout_count++;
25062511
if (UsePerfData) {
@@ -2519,12 +2524,6 @@ void CompileBroker::collect_statistics(CompilerThread* thread, elapsedTimer time
25192524
_t_invalidated_compilation.add(time);
25202525
} else {
25212526
// Compilation succeeded
2522-
2523-
// update compilation ticks - used by the implementation of
2524-
// java.lang.management.CompilationMXBean
2525-
_perf_total_compilation->inc(time.ticks());
2526-
_peak_compilation_time = time.milliseconds() > _peak_compilation_time ? time.milliseconds() : _peak_compilation_time;
2527-
25282527
if (CITime) {
25292528
int bytes_compiled = method->code_size() + task->num_inlined_bytecodes();
25302529
if (is_osr) {

0 commit comments

Comments
 (0)