RFR: 8361492: [IR Framework] Has too restrictive regex for load and store

Christian Hagedorn chagedorn at openjdk.org
Fri Jul 11 17:17:39 UTC 2025


On Fri, 11 Jul 2025 16:56:16 GMT, Marc Chevalier <mchevalier at openjdk.org> wrote:

> Improving store and load regexes + adding test. It's mostly an improve version of a fix I had to do in Valhalla where it was blocking (part of JDK-8361250, blocking JDK-8357785).
> 
> The new regex takes into account that classes can implement interfaces, nested classes, and various labels after the `@`. It should be more robust.
> 
> Thanks,
> Marc

Nice addition and good tests! Some code style nits in the test code but otherwise, it looks good to me.

test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestPhaseIRMatching.java line 562:

> 560:         int i;
> 561:     }
> 562:     interface I2{}

Suggestion:

    interface I1 {}
    static class Base implements I1 {
        int i;
    }
    interface I2 {}

test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestPhaseIRMatching.java line 567:

> 565:     }
> 566:     Base Lb = new Base();
> 567:     Derived Ld = new Derived();

Maybe give them a more descriptive name and make them lower case. Same below for `Ldn`.

test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestPhaseIRMatching.java line 569:

> 567:     Derived Ld = new Derived();
> 568: 
> 569:     static class SingleNest{

Suggestion:

    static class SingleNest {

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

Marked as reviewed by chagedorn (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/26269#pullrequestreview-3011251296
PR Review Comment: https://git.openjdk.org/jdk/pull/26269#discussion_r2201357032
PR Review Comment: https://git.openjdk.org/jdk/pull/26269#discussion_r2201362629
PR Review Comment: https://git.openjdk.org/jdk/pull/26269#discussion_r2201357876


More information about the hotspot-compiler-dev mailing list