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

Maurizio Cimadamore mcimadamore at openjdk.org
Fri Mar 21 19:02:31 UTC 2025


On Fri, 21 Mar 2025 17:50:25 GMT, Chen Liang <liach at openjdk.org> wrote:

>> Maurizio Cimadamore has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 16 additional commits since the last revision:
>> 
>>  - Address review commments
>>  - Simplify Unsafe::compareAndSetFlatValueAsBytes to use new unsafe flat array creation primitive
>>  - Merge branch 'lworld' into varhandle_flat
>>  - Add missing `@ForceInline`
>>  - Update src/java.base/share/classes/jdk/internal/misc/Unsafe.java
>>    
>>    Co-authored-by: Chen Liang <liach at openjdk.org>
>>  - Update src/java.base/share/classes/jdk/internal/misc/Unsafe.java
>>    
>>    Co-authored-by: Chen Liang <liach at openjdk.org>
>>  - Tighten the signature of VarHandles::checkAtomicFlatArray
>>  - Avoid dynamic var handle creation in the middle of array element access
>>  - Fix test header
>>  - Enhance compareAndSetFlatValueAsBytes to work on different kinds of flat arrays
>>    Cache result of oop-free analysis
>>    Beef up tests to check different combinations of VM flags
>>  - ... and 6 more: https://git.openjdk.org/valhalla/compare/fae70008...000917a3
>
> test/jdk/valhalla/valuetypes/NullRestrictedArraysTest.java line 29:
> 
>> 27:  * @enablePreview
>> 28:  * @run junit/othervm NullRestrictedArraysTest
>> 29:  * @run junit/othervm -XX:-UseArrayFlattening NullRestrictedArraysTest
> 
> Why remove the no flattening configurations?

If array flattening is disabled, but field flattening is enabled, we might run into situation where the new flat array primitive fails -- that primitive requires same level of flattening for both arrays and fields.

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

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


More information about the valhalla-dev mailing list