diff src/share/vm/code/nmethod.cpp @ 6999:679e6584c177

added ScopedDebugValue to add values of interest to hs_err crash logs
author Doug Simon <doug.simon@oracle.com>
date Wed, 21 Nov 2012 19:23:43 +0100
parents 2cb439954abf
children bf2ea3ed3bce
line wrap: on
line diff
--- a/src/share/vm/code/nmethod.cpp	Tue Nov 20 22:50:44 2012 +0100
+++ b/src/share/vm/code/nmethod.cpp	Wed Nov 21 19:23:43 2012 +0100
@@ -42,6 +42,7 @@
 #include "utilities/dtrace.hpp"
 #include "utilities/events.hpp"
 #include "utilities/xmlstream.hpp"
+#include "utilities/debug.hpp"
 #ifdef SHARK
 #include "shark/sharkCompiler.hpp"
 #endif
@@ -2978,3 +2979,19 @@
   Dependencies::print_statistics();
   if (xtty != NULL)  xtty->tail("statistics");
 }
+
+#ifdef GRAAL
+void DebugScopedNMethod::print_on(outputStream* st) {
+  if (_nm != NULL) {
+    st->print("nmethod@%p", _nm);
+    Method* method = _nm->method();
+    if (method != NULL) {
+      char holder[O_BUFLEN];
+      char nameAndSig[O_BUFLEN];
+      method->method_holder()->name()->as_C_string(holder, O_BUFLEN);
+      method->name_and_sig_as_C_string(nameAndSig, O_BUFLEN);
+      st->print(" - %s::%s", holder, nameAndSig);
+    }
+  }
+}
+#endif