diff src/share/vm/code/nmethod.hpp @ 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 e522a00b91aa
children bf2ea3ed3bce
line wrap: on
line diff
--- a/src/share/vm/code/nmethod.hpp	Tue Nov 20 22:50:44 2012 +0100
+++ b/src/share/vm/code/nmethod.hpp	Wed Nov 21 19:23:43 2012 +0100
@@ -762,4 +762,19 @@
   }
 };
 
+#ifdef GRAAL
+class DebugScopedNMethod : public DebugScopedValue {
+private:
+  nmethod* _nm;
+public:
+  DebugScopedNMethod(const char* file, int line, nmethod* nm) : DebugScopedValue(file, line), _nm(nm) {}
+  void print_on(outputStream* st);
+};
+#define DS_NMETHOD(nm) DebugScopedNMethod __dsnm__(__FILE__, __LINE__, nm)
+#define DS_NMETHOD1(name, nm) DebugScopedNMethod name(__FILE__, __LINE__, nm)
+#else
+#define DS_NMETHOD(nm) do {} while (0)
+#define DS_NMETHOD1(name, nm) do {} while (0)
+#endif
+
 #endif // SHARE_VM_CODE_NMETHOD_HPP