RFR: 8320404: Double whitespace in SubTypeCheckNode::dump_spec output

Christian Hagedorn chagedorn at openjdk.org
Tue Mar 12 08:13:13 UTC 2024


On Mon, 11 Mar 2024 07:41:29 GMT, Koichi Sakata <ksakata at openjdk.org> wrote:

> This is a trivial change to remove an extra whitespace.
> 
> A double whitespace is printed because method->print_short_name already adds a whitespace before the name.
> 
> ### Test
> 
> For testing, I modified the ProfileAtTypeCheck class to fail a test case and display the message. Specifically, I changed the number of the count element in the IR annotation below.
> 
> 
>     @Test
>     @IR(phase = { CompilePhase.AFTER_PARSING }, counts = { IRNode.SUBTYPE_CHECK, "1" })
>     @IR(phase = { CompilePhase.AFTER_MACRO_EXPANSION }, counts = { IRNode.CMP_P, "5", IRNode.LOAD_KLASS_OR_NKLASS, "2", IRNode.PARTIAL_SUBTYPE_CHECK, "1" })
>     public static void test15(Object o) {
> 
> 
> This change was only for testing, so I reverted back to the original code after the test.
> 
> #### Execution Result
> 
> Before the change: 
> 
> $ make test TEST="test/hotspot/jtreg/compiler/c2/irTests/ProfileAtTypeCheck.java"
> ...
> Failed IR Rules (1) of Methods (1)
> ----------------------------------
> 1) Method "public static void compiler.c2.irTests.ProfileAtTypeCheck.test15(java.lang.Object)" - [Failed IR rules: 1]:
>    * @IR rule 1: "@compiler.lib.ir_framework.IR(phase={AFTER_PARSING}, applyIfPlatformAnd={}, applyIfCPUFeatureOr={}, counts={"_#SUBTYPE_CHECK#_", "11"}, applyIfPlatform={}, applyIfPlatformOr={}, failOn={}, applyIfOr={}, applyIfCPUFeatureAnd={}, applyIf={}, applyIfCPUFeature={}, ap
> plyIfAnd={}, applyIfNot={})"
>      > Phase "After Parsing":
>        - counts: Graph contains wrong number of nodes:
>          * Constraint 1: "(\d+(\s){2}(SubTypeCheck.*)+(\s){2}===.*)"
>            - Failed comparison: [found] 1 = 11 [given]
>              - Matched node:
>                * 53  SubTypeCheck  === _ 44 35  [[ 58 ]]  profiled at:  compiler.c2.irTests.ProfileAtTypeCheck::test15:5 !jvms: ProfileAtTypeCheck::test15 @ bci:5 (line 399)
> 
> 
> After the change:
> 
> $ make test TEST="test/hotspot/jtreg/compiler/c2/irTests/ProfileAtTypeCheck.java"
> ...
> Failed IR Rules (1) of Methods (1)
> ----------------------------------
> 1) Method "public static void compiler.c2.irTests.ProfileAtTypeCheck.test15(java.lang.Object)" - [Failed IR rules: 1]:
>    * @IR rule 1: "@compiler.lib.ir_framework.IR(phase={AFTER_PARSING}, applyIfPlatformAnd={}, applyIfCPUFeatureOr={}, counts={"_#SUBTYPE_CHECK#_", "11"}, applyIfPlatform={}, applyIfPlatformOr={}, failOn={}, applyIfOr={}, applyIfCPUFeatureAnd={}, applyIf={}, applyIfCPUFeature={}, ap
> plyIfAnd={}, applyIfNot={})"
>      > Phase "After Parsing":
>        - counts: Graph contains wrong number of nodes:
>          * Cons...

Looks good and trivial.

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

Marked as reviewed by chagedorn (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/18181#pullrequestreview-1930353634


More information about the hotspot-compiler-dev mailing list