[lworld] RFR: 8351569: [lworld] Revisit atomic access modes in flat var handles [v4]

Maurizio Cimadamore mcimadamore at openjdk.org
Thu Mar 20 18:05:21 UTC 2025


On Thu, 20 Mar 2025 17:59:03 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> This PR is an attempt to put var handle support for flat values on a more solid footing. Some more notes in a comment below.
>
> Maurizio Cimadamore has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Avoid dynamic var handle creation in the middle of array element access

test/jdk/valhalla/valuetypes/NullRestrictedArraysTest.java line 304:

> 302:         // test atomic set with null witness
> 303: 
> 304:         assertFalse(vh.compareAndSet(array, 2, null, value1));

I realized that the VH code we have is liberal w.r.t. `null` witness values in CAS-like operations -- in the sense that it allows them, even though the underlying variable is null-restricted. For now I decided to preserve this behavior (instead e.g. throwing an IAE) - but better add a test :-)

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

PR Review Comment: https://git.openjdk.org/valhalla/pull/1402#discussion_r2006183430


More information about the valhalla-dev mailing list