On Fri, 15 May 2026 13:04:02 GMT, Manuel Hässig <[email protected]> wrote:

> This PR updates the Test `compiler/stable/TestStableArrayMembars.java` for 
> Valhalla. This involves creating a code path for migrated value classes and a 
> slight change to C2 to be able to clean up more barriers than previously.
> 
> Unfortunately, with `--enable-preview` C2 is not able to fully clean up all 
> membars as it is for mainline. This is due to the later elision of the loads. 
> After parsing, membars do not carry information that could relate them to any 
> particular memory access, so we cannot remove them without potentially 
> violating the JMM. Further, the implementation of 
> `Unsafe.getFlatValueAcquire` emits a barrier in Java that cannot be 
> eliminated by the JIT anyways.
> 
> Testing:
>  - [x] tier1,tier2 and additional stress testing.
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

Looks good to me.

test/hotspot/jtreg/compiler/stable/TestStableArrayMembars.java line 134:

> 132:                    IRNode.LOAD, "=1"}, // There is exactly one load 
> fence, but no load
> 133:         applyIfAnd = {"enable-valhalla", "true",
> 134:                      "UseArrayFlattening", "true"})

Suggestion:

                      "UseArrayFlattening", "true"})

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

Marked as reviewed by thartmann (Committer).

PR Review: 
https://git.openjdk.org/valhalla/pull/2441#pullrequestreview-4317438898
PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2441#discussion_r3265027839

Reply via email to