Skip to content

Commit

Permalink
8316702: Only evaluate buffer when IGVPrintLevelOption >= 5
Browse files Browse the repository at this point in the history
Reviewed-by: chagedorn, thartmann
  • Loading branch information
Xin Liu committed Sep 22, 2023
1 parent 4b65483 commit bd2439f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/hotspot/share/opto/compile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5127,7 +5127,7 @@ bool Compile::should_print_phase(CompilerPhaseType cpt) {
return false;
}

bool Compile::should_print_igv(int level) {
bool Compile::should_print_igv(const int level) {
#ifndef PRODUCT
if (PrintIdealGraphLevel < 0) { // disabled by the user
return false;
Expand Down
5 changes: 3 additions & 2 deletions src/hotspot/share/opto/parse2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2779,13 +2779,14 @@ void Parse::do_one_bytecode() {
}

#ifndef PRODUCT
if (C->should_print_igv(1)) {
constexpr int perBytecode = 5;
if (C->should_print_igv(perBytecode)) {
IdealGraphPrinter* printer = C->igv_printer();
char buffer[256];
jio_snprintf(buffer, sizeof(buffer), "Bytecode %d: %s", bci(), Bytecodes::name(bc()));
bool old = printer->traverse_outs();
printer->set_traverse_outs(true);
printer->print_method(buffer, 5);
printer->print_method(buffer, perBytecode);
printer->set_traverse_outs(old);
}
#endif
Expand Down

1 comment on commit bd2439f

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.