On Mon, 24 Mar 2025 20:49:25 GMT, Frederic Parain <[email protected]> wrote:

> Strict final instance fields are not subject to concurrent writes during a 
> read access, so they can be flattened even if they are nullable and bigger 
> than 64 bits. The NULLABLE_NON_ATOMIC_FLAT layout is added for this 
> particular case.
> This new layout can also be used in the special case of nullable empty value 
> classes, because their payload contains a single entry, the null-marker, 
> which is naturally atomic.

src/hotspot/share/classfile/classFileParser.hpp line 101:

> 99:                       _non_atomic_size_in_bytes(-1), 
> _non_atomic_alignment(-1),
> 100:                       _atomic_layout_size_in_bytes(-1), 
> _nullable_atomic_layout_size_in_bytes(-1),
> 101:                       _nullable_non_atomic_layout_size_in_bytes(-1),

Do we need `nullable_non_atomic_alignment`, similar to `non_atomic_alignment`. 
Besides, it may be better to rename the `null_free` fields, too.

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

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/1407#discussion_r2678654545

Reply via email to