8317761: Combine two versions of print_statistics() in java.cpp

Reviewed-by: kvn, vlivanov
This commit is contained in:
Ioi Lam 2023-10-11 05:11:41 +00:00
parent 3aa4cba175
commit 84b7cc15c2
2 changed files with 9 additions and 51 deletions

View file

@ -225,6 +225,13 @@ void print_bytecode_count() {
} }
} }
#else
void print_method_invocation_histogram() {}
void print_bytecode_count() {}
#endif // PRODUCT
// General statistics printing (profiling ...) // General statistics printing (profiling ...)
void print_statistics() { void print_statistics() {
@ -337,56 +344,6 @@ void print_statistics() {
ThreadsSMRSupport::log_statistics(); ThreadsSMRSupport::log_statistics();
} }
#else // PRODUCT MODE STATISTICS
void print_statistics() {
if (PrintMethodData) {
print_method_profiling_data();
}
if (CITime) {
CompileBroker::print_times();
}
#ifdef COMPILER2_OR_JVMCI
if ((LogVMOutput || LogCompilation) && UseCompiler) {
// Only print the statistics to the log file
FlagSetting fs(DisplayVMOutput, false);
Deoptimization::print_statistics();
}
#endif /* COMPILER2 || INCLUDE_JVMCI */
if (PrintCodeCache) {
MutexLocker mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
CodeCache::print();
}
// CodeHeap State Analytics.
if (PrintCodeHeapAnalytics) {
CompileBroker::print_heapinfo(nullptr, "all", 4096); // details
}
#ifdef COMPILER2
if (PrintPreciseRTMLockingStatistics) {
OptoRuntime::print_named_counters();
}
#endif
// Native memory tracking data
if (PrintNMTStatistics) {
MemTracker::final_report(tty);
}
if (PrintMetaspaceStatisticsAtExit) {
MetaspaceUtils::print_basic_report(tty, 0);
}
ThreadsSMRSupport::log_statistics();
}
#endif
// Note: before_exit() can be executed only once, if more than one threads // Note: before_exit() can be executed only once, if more than one threads
// are trying to shutdown the VM at the same time, only one thread // are trying to shutdown the VM at the same time, only one thread
// can run before_exit() and all other threads must wait. // can run before_exit() and all other threads must wait.

View file

@ -575,10 +575,11 @@ class SharedRuntime: AllStatic {
static address nof_interface_calls_addr() { return (address)&_nof_interface_calls; } static address nof_interface_calls_addr() { return (address)&_nof_interface_calls; }
static address nof_inlined_interface_calls_addr() { return (address)&_nof_inlined_interface_calls; } static address nof_inlined_interface_calls_addr() { return (address)&_nof_inlined_interface_calls; }
static void print_call_statistics(uint64_t comp_total); static void print_call_statistics(uint64_t comp_total);
static void print_statistics();
static void print_ic_miss_histogram(); static void print_ic_miss_histogram();
#endif // PRODUCT #endif // PRODUCT
static void print_statistics() PRODUCT_RETURN;
}; };