From 293fec7e28ed06f0942e94b1c21affdf6aabe9ca Mon Sep 17 00:00:00 2001 From: Christian Hagedorn Date: Mon, 1 Dec 2025 07:06:46 +0000 Subject: [PATCH] 8372461: [IR Framework] Multiple test failures after JDK-8371789 Reviewed-by: epeter, syan, dfenacci --- test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java | 9 ++++----- .../ir_framework/tests/TestIRMatching.java | 6 +++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java b/test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java index a730fcb30cf..787dedba9c6 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java @@ -523,13 +523,13 @@ public class IRNode { public static final String CHECKCAST_ARRAY = PREFIX + "CHECKCAST_ARRAY" + POSTFIX; static { - String regex = "(((?i:cmp|CLFI|CLR).*precise \\[.*:|.*(?i:mov|mv|or).*precise \\[.*:.*\\R.*(cmp|CMP|CLR))" + END; + String regex = "(((?i:cmp|CLFI|CLR).*aryklassptr:\\[.*:Constant|.*(?i:mov|mv|or).*aryklassptr:\\[.*:Constant.*\\R.*(cmp|CMP|CLR))" + END; optoOnly(CHECKCAST_ARRAY, regex); } public static final String CHECKCAST_ARRAY_OF = COMPOSITE_PREFIX + "CHECKCAST_ARRAY_OF" + POSTFIX; static { - String regex = "(((?i:cmp|CLFI|CLR).*precise \\[.*" + IS_REPLACED + ":|.*(?i:mov|mv|or).*precise \\[.*" + IS_REPLACED + ":.*\\R.*(cmp|CMP|CLR))" + END; + String regex = "(((?i:cmp|CLFI|CLR).*aryklassptr:\\[.*" + IS_REPLACED + ":.*:Constant|.*(?i:mov|mv|or).*aryklassptr:\\[.*" + IS_REPLACED + ":.*:Constant.*\\R.*(cmp|CMP|CLR))" + END; optoOnly(CHECKCAST_ARRAY_OF, regex); } @@ -3220,10 +3220,9 @@ public class IRNode { // @ matches the start character of the pattern // (\w+: ?)+ tries to match the pattern 'ptrtype:' or 'stable:' with optional trailing whitespaces - // (\w/)* tries to match the pattern 'a/b/` - // (\w$)* tries to match the pattern 'c$d$' + // [\\w/\\$] tries to match the pattern such as 'a/b/', 'a/b', or '/b' but also nested class such as '$c' or '$c$d' // \b asserts that the next character is a word character - private static final String LOAD_STORE_PREFIX = "@(\\w+: ?)+(\\w/)*(\\w$)*\\b"; + private static final String LOAD_STORE_PREFIX = "@(\\w+: ?)+[\\w/\\$]*\\b"; // ( \([^\)]+\))? tries to match the pattern ' (f/g,h/i/j)' // :\w+ tries to match the pattern ':NotNull' // .* tries to match the remaining of the pattern diff --git a/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestIRMatching.java b/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestIRMatching.java index 5615cce983a..142a30f34a9 100644 --- a/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestIRMatching.java +++ b/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestIRMatching.java @@ -255,9 +255,9 @@ public class TestIRMatching { } else { cmp = "cmp"; } - runCheck(BadFailOnConstraint.create(CheckCastArray.class, "array(java.lang.Object[])", 1, cmp, "precise"), - BadFailOnConstraint.create(CheckCastArray.class, "array(java.lang.Object[])", 2, 1,cmp, "precise", "MyClass"), - BadFailOnConstraint.create(CheckCastArray.class, "array(java.lang.Object[])", 2, 2,cmp, "precise", "ir_framework/tests/MyClass"), + runCheck(BadFailOnConstraint.create(CheckCastArray.class, "array(java.lang.Object[])", 1, cmp, "Constant"), + BadFailOnConstraint.create(CheckCastArray.class, "array(java.lang.Object[])", 2, 1,cmp, "Constant", "MyClass"), + BadFailOnConstraint.create(CheckCastArray.class, "array(java.lang.Object[])", 2, 2,cmp, "Constant", "ir_framework/tests/MyClass"), GoodFailOnConstraint.create(CheckCastArray.class, "array(java.lang.Object[])", 3), Platform.isS390x() ? // There is no checkcast_arraycopy stub for C2 on s390 GoodFailOnConstraint.create(CheckCastArray.class, "arrayCopy(java.lang.Object[],java.lang.Class)", 1)