On Fri, 24 Apr 2026 14:14:33 GMT, Paul Hübner <[email protected]> wrote:

> Hi all,
> 
> This decouples the `AlwaysAtomicAccesses` flag from layouts in Valhalla.
> 
> It also fixes a broken assertion that had gone unnoticed due to 
> `AlwaysAtomicAccesses` being falsy.
> 
> Testing: tiers 1-3. 
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

src/hotspot/share/oops/flatArrayKlass.cpp line 103:

> 101: 
> 102: FlatArrayKlass* FlatArrayKlass::allocate_klass(Klass* eklass, 
> ArrayProperties props, LayoutKind lk, TRAPS) {
> 103:   guarantee((!Universe::is_bootstrapping() || 
> vmClasses::Object_klass_is_loaded()), "Too-early construction of a flat array 
> klass");

More descriptive message while I'm changing the assertions.

src/hotspot/share/oops/flatArrayKlass.cpp line 114:

> 112:   // b) explicitly marked as allowing non-atomicity.
> 113:   assert(!props.is_non_atomic() ||
> 114:          (element_klass->is_naturally_atomic(props.is_null_restricted()) 
> ||

Why the parentheses? I want to make it clear that this is an implication. `p → 
q` is expressed as `!p || q`. Since `q`, being "naturally atomic or explicitly 
allowed to be non-atomic", contains a disjunction, I've grouped it together to 
make it more legible.

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

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2366#discussion_r3138493286
PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2366#discussion_r3153843679

Reply via email to