Skip to content

Commit

Permalink
8346264: "Total compile time" counter should include time spent in fa…
Browse files Browse the repository at this point in the history
…iling/bailout compiles

Reviewed-by: kvn, mli
  • Loading branch information
shipilev committed Jan 6, 2025
1 parent dd81f8d commit 12700cb
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/hotspot/share/compiler/compileBroker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2532,6 +2532,11 @@ void CompileBroker::collect_statistics(CompilerThread* thread, elapsedTimer time
// C1 and C2 counters are counting both successful and unsuccessful compiles
_t_total_compilation.add(time);

// Update compilation times. Used by the implementation of JFR CompilerStatistics
// and java.lang.management.CompilationMXBean.
_perf_total_compilation->inc(time.ticks());
_peak_compilation_time = MAX2(time.milliseconds(), _peak_compilation_time);

if (!success) {
_total_bailout_count++;
if (UsePerfData) {
Expand All @@ -2550,12 +2555,6 @@ void CompileBroker::collect_statistics(CompilerThread* thread, elapsedTimer time
_t_invalidated_compilation.add(time);
} else {
// Compilation succeeded

// update compilation ticks - used by the implementation of
// java.lang.management.CompilationMXBean
_perf_total_compilation->inc(time.ticks());
_peak_compilation_time = time.milliseconds() > _peak_compilation_time ? time.milliseconds() : _peak_compilation_time;

if (CITime) {
int bytes_compiled = method->code_size() + task->num_inlined_bytecodes();
if (is_osr) {
Expand Down

0 comments on commit 12700cb

Please sign in to comment.