From 84b7cc15c20581a14cdd2a590e0a30b1ef9acddb Mon Sep 17 00:00:00 2001 From: Ioi Lam Date: Wed, 11 Oct 2023 05:11:41 +0000 Subject: [PATCH] 8317761: Combine two versions of print_statistics() in java.cpp Reviewed-by: kvn, vlivanov --- src/hotspot/share/runtime/java.cpp | 57 +++------------------ src/hotspot/share/runtime/sharedRuntime.hpp | 3 +- 2 files changed, 9 insertions(+), 51 deletions(-) diff --git a/src/hotspot/share/runtime/java.cpp b/src/hotspot/share/runtime/java.cpp index 10e0bfc837d..6f227988748 100644 --- a/src/hotspot/share/runtime/java.cpp +++ b/src/hotspot/share/runtime/java.cpp @@ -225,6 +225,13 @@ void print_bytecode_count() { } } +#else + +void print_method_invocation_histogram() {} +void print_bytecode_count() {} + +#endif // PRODUCT + // General statistics printing (profiling ...) void print_statistics() { @@ -337,56 +344,6 @@ void print_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 // are trying to shutdown the VM at the same time, only one thread // can run before_exit() and all other threads must wait. diff --git a/src/hotspot/share/runtime/sharedRuntime.hpp b/src/hotspot/share/runtime/sharedRuntime.hpp index b401e057e05..b557d9cda9c 100644 --- a/src/hotspot/share/runtime/sharedRuntime.hpp +++ b/src/hotspot/share/runtime/sharedRuntime.hpp @@ -575,10 +575,11 @@ class SharedRuntime: AllStatic { 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 void print_call_statistics(uint64_t comp_total); - static void print_statistics(); static void print_ic_miss_histogram(); #endif // PRODUCT + + static void print_statistics() PRODUCT_RETURN; };