RFR: 8320404: Double whitespace in SubTypeCheckNode::dump_spec output
Koichi Sakata
ksakata at openjdk.org
Tue Mar 12 01:49:37 UTC 2024
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:
* 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)
I was able confirm that the thing has been corrected.
-------------
Commit messages:
- Remove an extra whitespace
Changes: https://git.openjdk.org/jdk/pull/18181/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=18181&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8320404
Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
Patch: https://git.openjdk.org/jdk/pull/18181.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/18181/head:pull/18181
PR: https://git.openjdk.org/jdk/pull/18181
More information about the hotspot-compiler-dev
mailing list