# HG changeset patch # User Christian Haeubl # Date 1368026498 -7200 # Node ID 197426668a5d1609a2408edda266104e6a66b81d # Parent 9529ab567367a4341421df558a380f8a5ba58db9 Enabled nmethod statistics for the HotSpot product build. diff -r 9529ab567367 -r 197426668a5d src/share/vm/code/nmethod.cpp --- a/src/share/vm/code/nmethod.cpp Wed May 08 16:31:59 2013 +0200 +++ b/src/share/vm/code/nmethod.cpp Wed May 08 17:21:38 2013 +0200 @@ -124,7 +124,6 @@ // PrintC1Statistics, PrintOptoStatistics, LogVMOutput, and LogCompilation. // (In the latter two cases, they like other stats are printed to the log only.) -#ifndef PRODUCT // These variables are put into one block to reduce relocations // and make it simpler to print from the debugger. static @@ -214,7 +213,6 @@ pc_desc_tests, pc_desc_searches, pc_desc_adds); } } nmethod_stats; -#endif //PRODUCT //--------------------------------------------------------------------------------- @@ -521,7 +519,7 @@ code_buffer, frame_size, basic_lock_owner_sp_offset, basic_lock_sp_offset, oop_maps); - NOT_PRODUCT(if (nm != NULL) nmethod_stats.note_native_nmethod(nm)); + if (nm != NULL) nmethod_stats.note_native_nmethod(nm); if (PrintAssembly && nm != NULL) Disassembler::decode(nm); } @@ -558,7 +556,7 @@ nm = new (nmethod_size) nmethod(method(), nmethod_size, &offsets, code_buffer, frame_size); - NOT_PRODUCT(if (nm != NULL) nmethod_stats.note_nmethod(nm)); + if (nm != NULL) nmethod_stats.note_nmethod(nm); if (PrintAssembly && nm != NULL) Disassembler::decode(nm); } @@ -642,7 +640,7 @@ InstanceKlass::cast(klass)->add_dependent_nmethod(nm); } } - NOT_PRODUCT(if (nm != NULL) nmethod_stats.note_nmethod(nm)); + if (nm != NULL) nmethod_stats.note_nmethod(nm); if (PrintAssembly && nm != NULL) Disassembler::decode(nm); } @@ -3018,6 +3016,8 @@ ImplicitExceptionTable(this).print(code_begin()); } +#endif // PRODUCT + void nmethod::print_statistics() { ttyLocker ttyl; if (xtty != NULL) xtty->head("statistics type='nmethod'"); @@ -3028,5 +3028,3 @@ Dependencies::print_statistics(); if (xtty != NULL) xtty->tail("statistics"); } - -#endif // PRODUCT diff -r 9529ab567367 -r 197426668a5d src/share/vm/code/nmethod.hpp --- a/src/share/vm/code/nmethod.hpp Wed May 08 16:31:59 2013 +0200 +++ b/src/share/vm/code/nmethod.hpp Wed May 08 17:21:38 2013 +0200 @@ -689,7 +689,7 @@ // Prints a comment for one native instruction (reloc info, pc desc) void print_code_comment_on(outputStream* st, int column, address begin, address end); - static void print_statistics() PRODUCT_RETURN; + static void print_statistics(); // Compiler task identification. Note that all OSR methods // are numbered in an independent sequence if CICountOSR is true, diff -r 9529ab567367 -r 197426668a5d src/share/vm/runtime/java.cpp --- a/src/share/vm/runtime/java.cpp Wed May 08 16:31:59 2013 +0200 +++ b/src/share/vm/runtime/java.cpp Wed May 08 17:21:38 2013 +0200 @@ -249,7 +249,6 @@ Runtime1::print_statistics(); Deoptimization::print_statistics(); SharedRuntime::print_statistics(); - nmethod::print_statistics(); } #endif /* COMPILER1 */ @@ -259,12 +258,11 @@ Compile::print_statistics(); #ifndef COMPILER1 Deoptimization::print_statistics(); - nmethod::print_statistics(); SharedRuntime::print_statistics(); #endif //COMPILER1 os::print_statistics(); } - + if (PrintLockStatistics || PrintPreciseBiasedLockingStatistics) { OptoRuntime::print_named_counters(); } @@ -278,6 +276,10 @@ } #endif // ASSERT #endif // COMPILER2 + + if (PrintNMethodStatistics) { + nmethod::print_statistics(); + } if (CountCompiledCalls) { print_method_invocation_histogram(); } @@ -386,6 +388,9 @@ if (PrintBiasedLockingStatistics) { BiasedLocking::print_counters(); } + if (PrintNMethodStatistics) { + nmethod::print_statistics(); + } // Native memory tracking data if (PrintNMTStatistics) {