changeset 14733:b10e42998d01

nmethod: fix -XX:+PrintNMethodStatistics
author Bernhard Urban <bernhard.urban@jku.at>
date Tue, 25 Mar 2014 16:38:01 +0100
parents 56621a6eed29
children 6ae9af961b7c 5ba874df3b2b
files src/share/vm/code/nmethod.cpp src/share/vm/code/nmethod.hpp
diffstat 2 files changed, 5 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- 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
--- 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,