8340792: -XX:+PrintInterpreter: instructions should only be printed if printing all InterpreterCodelets

Reviewed-by: mdoerr, coleenp
This commit is contained in:
Richard Reingruber 2024-10-04 08:26:15 +00:00
parent 3f420fac84
commit a63ac5a699
3 changed files with 10 additions and 3 deletions

View File

@ -74,7 +74,9 @@ void AbstractInterpreter::print() {
tty->print_cr("avg codelet size = %6d bytes", _code->used_space() / _code->number_of_stubs());
tty->cr();
}
_should_print_instructions = PrintInterpreter;
_code->print();
_should_print_instructions = false;
tty->print_cr("----------------------------------------------------------------------");
tty->cr();
}
@ -91,6 +93,8 @@ address AbstractInterpreter::_slow_signature_handler;
address AbstractInterpreter::_entry_table [AbstractInterpreter::number_of_method_entries];
address AbstractInterpreter::_native_abi_to_tosca [AbstractInterpreter::number_of_result_handlers];
bool AbstractInterpreter::_should_print_instructions = false;
//------------------------------------------------------------------------------------------------------------------------
// Generation of complete interpreter

View File

@ -126,6 +126,8 @@ class AbstractInterpreter: AllStatic {
static address _rethrow_exception_entry; // rethrows an activation in previous frame
static bool _should_print_instructions; // only with PrintInterpreter and when printing all InterpreterCodelet
friend class AbstractInterpreterGenerator;
friend class InterpreterMacroAssembler;
@ -133,6 +135,7 @@ class AbstractInterpreter: AllStatic {
// Initialization/debugging
static void initialize();
static StubQueue* code() { return _code; }
static bool should_print_instructions() { return _should_print_instructions; }
// Method activation

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -66,7 +66,7 @@ void InterpreterCodelet::verify() {}
void InterpreterCodelet::print_on(outputStream* st) const {
ttyLocker ttyl;
if (PrintInterpreter) {
if (AbstractInterpreter::should_print_instructions()) {
st->cr();
st->print_cr("----------------------------------------------------------------------");
}
@ -76,7 +76,7 @@ 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 (PrintInterpreter) {
if (AbstractInterpreter::should_print_instructions()) {
st->cr();
Disassembler::decode(code_begin(), code_end(), st NOT_PRODUCT(COMMA &_asm_remarks));
}