src/hotspot/share/compiler/disassembler.hpp
changeset 51056 3ddf41505d54
parent 50528 1fd4844371bb
child 53244 9807daeb47c4
--- a/src/hotspot/share/compiler/disassembler.hpp	Fri Jul 13 10:10:51 2018 -0700
+++ b/src/hotspot/share/compiler/disassembler.hpp	Sun Jun 03 23:33:00 2018 -0700
@@ -77,6 +77,17 @@
   static void decode(nmethod* nm,                outputStream* st = NULL);
   static void decode(address begin, address end, outputStream* st = NULL,
                      CodeStrings c = CodeStrings(), ptrdiff_t offset = 0);
+  static void _hook(const char* file, int line, class MacroAssembler* masm);
+
+  // This functions makes it easy to generate comments in the generated
+  // interpreter code, by riding on the customary __ macro in the interpreter generator.
+  // See templateTable_x86.cpp for an example.
+  template<class T> inline static T* hook(const char* file, int line, T* masm) {
+    if (PrintInterpreter) {
+      _hook(file, line, masm);
+    }
+    return masm;
+  }
 };
 
 #endif // SHARE_VM_COMPILER_DISASSEMBLER_HPP