[lworld] RFR: 8372697: [lworld] compiler/c2/irTests/scalarReplacement/ScalarReplacementWithGCBarrierTests.java fails with --enable-preview

Marc Chevalier mchevalier at openjdk.org
Tue Dec 2 09:11:27 UTC 2025


On Tue, 2 Dec 2025 08:52:47 GMT, Paul Hübner <phubner at openjdk.org> wrote:

>> test/hotspot/jtreg/compiler/c2/irTests/scalarReplacement/ScalarReplacementWithGCBarrierTests.java line 108:
>> 
>>> 106:     // could not be eliminated.
>>> 107:     @Test
>>> 108:     @IR(applyIf = {"enable-valhalla", "false"}, phase = { CompilePhase.PHASEIDEAL_BEFORE_EA }, counts = { IRNode.ALLOC, "2" })
>> 
>> With `EnableValhalla` being removed in favour of `--enable-preview`, I think it would make sense if we transition to a preview on/off state rather than the fine-grained one we have right now.
>
> FWIW there's also `jdk.internal.misc.PreviewFeatures` that can be used to check if preview features are enabled at runtime.

PreviewFeatures.isEnabled() is internal and not accessible without adding some `@module` in each IR test. That seems like an excessive burden.

Doing it more fine-grained was on purpose. @TobiHartmann an opinion? I tihnk it can make a mess with other project repos, but I don't remember the exact scenario.

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

PR Review Comment: https://git.openjdk.org/valhalla/pull/1767#discussion_r2580286898


More information about the valhalla-dev mailing list