8380219: Interpreter debugging would be easier if InterpreterCodelets could print their assembly code

Reviewed-by: dholmes, ayang
This commit is contained in:
Frederic Parain 2026-03-23 17:46:44 +00:00
parent c6a20173a3
commit 2095051a10
3 changed files with 9 additions and 4 deletions

View File

@ -112,7 +112,7 @@ class Disassembler : public AbstractDisassembler {
// 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) {
if (PrintInterpreter NOT_PRODUCT(|| true)) {
_hook(file, line, masm);
}
return masm;

View File

@ -61,10 +61,10 @@ void InterpreterCodelet::initialize(const char* description, Bytecodes::Code byt
void InterpreterCodelet::verify() {}
void InterpreterCodelet::print_on(outputStream* st) const {
void InterpreterCodelet::print_on(outputStream* st, bool print_code) const {
ttyLocker ttyl;
if (AbstractInterpreter::should_print_instructions()) {
if (print_code) {
st->cr();
st->print_cr("----------------------------------------------------------------------");
}
@ -74,12 +74,16 @@ void InterpreterCodelet::print_on(outputStream* st) const {
st->print_cr("[" INTPTR_FORMAT ", " INTPTR_FORMAT "] %d bytes",
p2i(code_begin()), p2i(code_end()), code_size());
if (AbstractInterpreter::should_print_instructions()) {
if (print_code) {
st->cr();
Disassembler::decode(code_begin(), code_end(), st NOT_PRODUCT(COMMA &_asm_remarks));
}
}
void InterpreterCodelet::print_on(outputStream* st) const {
print_on(st, AbstractInterpreter::should_print_instructions());
}
void InterpreterCodelet::print() const { print_on(tty); }
CodeletMark::CodeletMark(InterpreterMacroAssembler*& masm,

View File

@ -67,6 +67,7 @@ class InterpreterCodelet: public Stub {
// Debugging
void verify();
void print_on(outputStream* st, bool print_code) const;
void print_on(outputStream* st) const;
void print() const;