On Tue, 13 May 2025 13:35:19 GMT, Quan Anh Mai <[email protected]> wrote:

> This would forbid the class which contains the `NULLABLE_NON_ATOMIC_FLAT` 
> from being flattened into a class which contains it. I think we should only 
> do so if the holder of the flattened strict final field should not be 
> flattened if it is not itself a strict final field:
> 
>     * The holder is an identity class.
> 
>     * The holder is a large value class without `@LooselyConsistentValue`.
> 
> 
> This is equally valid to null-restricted field of 
> non-`@LooselyConsistentValue`, too.

Yes, there are some restrictions where the NULLABLE_NON_ATOMIC_FLAT can be 
used, see the comments and the `can_use_atomic_flat` argument in the 
`field_layout_selection()` method.

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

PR Comment: https://git.openjdk.org/valhalla/pull/1407#issuecomment-3730431574

Reply via email to