changeset 4562:ef00461e29af

Merge
author Christian Haeubl <christian.haeubl@oracle.com>
date Fri, 10 Feb 2012 10:16:19 -0800
parents 35ca3ade314d (diff) e43d36482d12 (current diff)
children b27666ff9bd6
files src/share/vm/code/nmethod.cpp src/share/vm/code/nmethod.hpp src/share/vm/runtime/java.cpp
diffstat 5 files changed, 18 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotProfilingInfo.java	Fri Feb 10 17:09:39 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotProfilingInfo.java	Fri Feb 10 10:16:19 2012 -0800
@@ -34,6 +34,7 @@
      *
      */
     private static final long serialVersionUID = -8307682725047864875L;
+    private static final DebugMetric metricInsufficentSpace = Debug.metric("InsufficientSpaceForProfilingData");
 
     private int position;
     private int hintPosition;
@@ -111,7 +112,7 @@
 
             if (!methodData.isWithin(currentPosition)) {
                 exceptionPossiblyNotRecorded = true;
-                Debug.metric("InsufficientSpaceForProfilingData").increment();
+                metricInsufficentSpace.increment();
             }
         }
 
--- a/src/share/vm/code/nmethod.cpp	Fri Feb 10 17:09:39 2012 +0100
+++ b/src/share/vm/code/nmethod.cpp	Fri Feb 10 10:16:19 2012 -0800
@@ -119,7 +119,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
@@ -209,7 +208,6 @@
                   pc_desc_tests, pc_desc_searches, pc_desc_adds);
   }
 } nmethod_stats;
-#endif //PRODUCT
 
 
 //---------------------------------------------------------------------------------
@@ -512,7 +510,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);
   }
@@ -545,7 +543,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);
   }
@@ -612,7 +610,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);
   }
@@ -2834,6 +2832,8 @@
   ImplicitExceptionTable(this).print(code_begin());
 }
 
+#endif // PRODUCT
+
 void nmethod::print_statistics() {
   ttyLocker ttyl;
   if (xtty != NULL)  xtty->head("statistics type='nmethod'");
@@ -2844,5 +2844,3 @@
   Dependencies::print_statistics();
   if (xtty != NULL)  xtty->tail("statistics");
 }
-
-#endif // PRODUCT
--- a/src/share/vm/code/nmethod.hpp	Fri Feb 10 17:09:39 2012 +0100
+++ b/src/share/vm/code/nmethod.hpp	Fri Feb 10 10:16:19 2012 -0800
@@ -643,7 +643,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,
--- a/src/share/vm/runtime/globals.hpp	Fri Feb 10 17:09:39 2012 +0100
+++ b/src/share/vm/runtime/globals.hpp	Fri Feb 10 10:16:19 2012 -0800
@@ -922,6 +922,9 @@
   diagnostic(ccstr, PrintAssemblyOptions, NULL,                             \
           "Options string passed to disassembler.so")                       \
                                                                             \
+  product(bool, PrintNMethodStatistics, false,                              \
+          "Print a summary statistic for the generated nmethods")           \
+                                                                            \
   diagnostic(bool, PrintNMethods, false,                                    \
           "Print assembly code for nmethods when generated")                \
                                                                             \
--- a/src/share/vm/runtime/java.cpp	Fri Feb 10 17:09:39 2012 +0100
+++ b/src/share/vm/runtime/java.cpp	Fri Feb 10 10:16:19 2012 -0800
@@ -252,9 +252,12 @@
     Runtime1::print_statistics();
     Deoptimization::print_statistics();
     SharedRuntime::print_statistics();
+  }
+#endif /* COMPILER1 */
+
+  if(PrintNMethodStatistics) {
     nmethod::print_statistics();
   }
-#endif /* COMPILER1 */
 
 #ifdef COMPILER2
   if ((PrintOptoStatistics || LogVMOutput || LogCompilation) && UseCompiler) {
@@ -366,6 +369,9 @@
   if (CITime) {
     CompileBroker::print_times();
   }
+  if(PrintNMethodStatistics) {
+    nmethod::print_statistics();
+  }
 #ifdef COMPILER2
   if (PrintPreciseBiasedLockingStatistics) {
     OptoRuntime::print_named_counters();