From a48b3e8baac6324d38dd10394113267879bc8fe2 Mon Sep 17 00:00:00 2001 From: Xin Liu Date: Thu, 14 Jul 2022 09:51:24 -0700 Subject: Support dump all phases and print nodes in ascending order of index. eg. -XX:CompileCommand=PrintIdealPhase,java.lang.String::length,DEBUG --- src/hotspot/share/opto/compile.cpp | 4 +++- src/hotspot/share/opto/phasetype.hpp | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/hotspot/share/opto/compile.cpp b/src/hotspot/share/opto/compile.cpp index 0c3fb5d74e2..63a06b84704 100644 --- a/src/hotspot/share/opto/compile.cpp +++ b/src/hotspot/share/opto/compile.cpp @@ -556,7 +556,9 @@ void Compile::print_ideal_ir(const char* phase_name) { phase_name); } if (_output == nullptr) { - root()->dump(9999); + tty->print_cr("AFTER: %s", phase_name); + // Print out all nodes in ascending order of index. + root()->dump_bfs(MaxNodeLimit, nullptr, "+S$"); } else { // Dump the node blockwise if we have a scheduling _output->print_scheduling(); diff --git a/src/hotspot/share/opto/phasetype.hpp b/src/hotspot/share/opto/phasetype.hpp index d0415317c00..faf83176f79 100644 --- a/src/hotspot/share/opto/phasetype.hpp +++ b/src/hotspot/share/opto/phasetype.hpp @@ -168,6 +168,8 @@ class PhaseNameValidator { // strncpy always writes len characters. If the source string is shorter, the function fills the remaining bytes with NULLs. strncpy(_bad, *iter, len); _valid = false; + } else if (PHASE_DEBUG == cpt) { + mask = ~((uint64_t)0); } else { assert(cpt < 64, "out of bounds"); mask |= CompilerPhaseTypeHelper::to_bitmask(cpt); -- 2.32.0 (Apple Git-132)