RFR: 8372097: C2: PhasePrintLevel requires setting PrintPhaseLevel explicitly to be active

Manuel Hässig mhaessig at openjdk.org
Wed Nov 19 09:11:08 UTC 2025


On Wed, 19 Nov 2025 08:51:58 GMT, Roberto Castañeda Lozano <rcastanedalo at openjdk.org> wrote:

> This changeset aligns the behavior of `PrintPhaseLevel` with its description in `c2_globals.hpp` in the default case of `-XX:PrintPhaseLevel=0`. In particular, after the changeset, running `java -XX:CompileCommand=PhasePrintLevel,*::*,N` does print the phase names corresponding to level `N` for the matched methods, as expected:
> 
> 
> $ java -Xbatch -XX:CompileCommand=PhasePrintLevel,java.lang.StringLatin1::equals,2
> CompileCommand: PhasePrintLevel java/lang/StringLatin1.equals intx PhasePrintLevel = 2
> 1.	After Parsing
> 2.	Iter GVN 1
> 3.	Incremental Inline
> 4.	Incremental Boxing Inline
> 5.	Before Loop Optimizations
> 6.	PhaseIdealLoop 1
> 7.	PhaseIdealLoop 2
> ...
> 
> 
> The changeset makes the behavior of the `PrintPhaseLevel` flag and `PhasePrintLevel` compile command consistent with the behavior of the pre-existing, analogous `PrintIdealGraphLevel` flag and `IGVPrintLevel` compile command. The changeset adds tests covering and documenting different combinations of flag and compile-command-specified print levels, and fixes a typo in the flag description in `c2_globals.hpp`.
> 
> **Testing:** tier1-3 (linux-x64, windows-x64, macosx-x64, linux-aarch64, macosx-aarch64).

Thank you for taking the time to fix this, @robcasloz! I learned a lot from the test you wrote. 
This looks good to me.

-------------

Marked as reviewed by mhaessig (Committer).

PR Review: https://git.openjdk.org/jdk/pull/28386#pullrequestreview-3481593327


More information about the hotspot-compiler-dev mailing list