RFR: 8254129: IR Test Framework to support regex-based matching on the IR in JTreg compiler tests [v2]
Christian Hagedorn
chagedorn at openjdk.java.net
Tue Apr 20 13:41:08 UTC 2021
On Sat, 17 Apr 2021 01:16:33 GMT, Igor Ignatyev <iignatyev at openjdk.org> wrote:
>> Christian Hagedorn has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Adjust whitelist
>
> test/lib/jdk/test/lib/hotspot/ir_framework/IRMatcher.java line 182:
>
>> 180: private static void appendLine(StringBuilder builder, String line) {
>> 181: if (line.contains("&")) {
>> 182: line = line.replace("&", "&");
>
> although I doubt it will ever be a problem in our use case, yet to be safe this replacement should be the last one, otherwise `<` will become `<` while it should be `<`
Good catch!
> test/lib/jdk/test/lib/hotspot/ir_framework/IRMatcher.java line 349:
>
>> 347: if (matchCount > 0) {
>> 348: matcher.reset();
>> 349: failMsg.append(" Regex ").append(nodeId).append(") ").append(nodeRegex).append("\n");
>
> it seems you missed an opening parenthesis after `Regex ` .
I used the parenthesis like an enumeration `Regex 1), Regex 2)` etc. But might be better to just use `Regex 1:`.
> test/lib/jdk/test/lib/hotspot/ir_framework/IRMatcher.java line 516:
>
>> 514: */
>> 515: public void appendIdealOutput(String idealOutput) {
>> 516: outputBuilder.setLength(0);
>
> I doubt that a method named `append.*` should remove the previous values.
Renamed the methods into `set.*`.
-------------
PR: https://git.openjdk.java.net/jdk/pull/3508
More information about the hotspot-dev
mailing list