# HG changeset patch # User Bernhard Urban # Date 1395761881 -3600 # Node ID b10e42998d01b9a97c7c975e02c2b940ae41be4f # Parent 56621a6eed29ebfa142e208f2bbdee3a7c8fa542 nmethod: fix -XX:+PrintNMethodStatistics diff -r 56621a6eed29 -r b10e42998d01 src/share/vm/code/nmethod.cpp --- a/src/share/vm/code/nmethod.cpp Tue Mar 25 14:23:43 2014 +0100 +++ b/src/share/vm/code/nmethod.cpp Tue Mar 25 16:38:01 2014 +0100 @@ -105,7 +105,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. struct java_nmethod_stats_struct { @@ -233,7 +232,6 @@ unknown_java_nmethod_stats.note_nmethod(nm); } } -#endif //--------------------------------------------------------------------------------- @@ -536,7 +534,7 @@ code_buffer, frame_size, basic_lock_owner_sp_offset, basic_lock_sp_offset, oop_maps); - NOT_PRODUCT(if (nm != NULL) note_java_nmethod(nm)); + if (nm != NULL) note_java_nmethod(nm); if (PrintAssembly && nm != NULL) { Disassembler::decode(nm); } @@ -572,7 +570,7 @@ nm = new (nmethod_size) nmethod(method(), nmethod_size, &offsets, code_buffer, frame_size); - NOT_PRODUCT(if (nm != NULL) note_java_nmethod(nm)); + if (nm != NULL) note_java_nmethod(nm); if (PrintAssembly && nm != NULL) { Disassembler::decode(nm); } @@ -652,7 +650,7 @@ // record this nmethod as dependent on this klass InstanceKlass::cast(klass)->add_dependent_nmethod(nm); } - NOT_PRODUCT(if (nm != NULL) note_java_nmethod(nm)); + if (nm != NULL) note_java_nmethod(nm); if (PrintAssembly || CompilerOracle::has_option_string(method, "PrintAssembly")) { Disassembler::decode(nm); } @@ -3058,6 +3056,7 @@ void nmethod::print_nul_chk_table() { ImplicitExceptionTable(this).print(code_begin()); } +#endif // PRODUCT void nmethod::print_statistics() { ttyLocker ttyl; @@ -3078,4 +3077,3 @@ Dependencies::print_statistics(); if (xtty != NULL) xtty->tail("statistics"); } -#endif // PRODUCT diff -r 56621a6eed29 -r b10e42998d01 src/share/vm/code/nmethod.hpp --- a/src/share/vm/code/nmethod.hpp Tue Mar 25 14:23:43 2014 +0100 +++ b/src/share/vm/code/nmethod.hpp Tue Mar 25 16:38:01 2014 +0100 @@ -694,7 +694,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,