--- 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