[lworld] RFR: 8371915: [lworld] LayoutKind enum should have helper methods

Frederic Parain fparain at openjdk.org
Wed Nov 19 22:00:44 UTC 2025


On Wed, 19 Nov 2025 21:37:46 GMT, Dan Heidinga <heidinga at openjdk.org> wrote:

>> Add some helper methods to test properties of layouts in a more reliable way.
>> 
>> Tested with Mach5, tier 1 to 3.
>> 
>> Fred
>
> src/hotspot/share/oops/arrayKlass.cpp line 231:
> 
>> 229:     break;
>> 230:     case LayoutKind::NULLABLE_ATOMIC_FLAT:
>> 231:       props = ArrayKlass::ArrayProperties::NON_ATOMIC;
> 
> Why does NULLABLE_ATOMIC_FLAT produce NON_ATOMIC?  Something, maybe just naming?, seems off here.
> 
> I know this is a refactoring of existing code and so has the same meaning but it doesn't make sense to me

Good catch!
I've copied/pasted this code when refactoring without verifying it.
It doesn't make sense to me either.
For LayoutKind::NULLABLE_ATOMIC_FLAT the method should return ArrayKlass::ArrayProperties::DEFAULT.
Let me fix this and run some tests.

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

PR Review Comment: https://git.openjdk.org/valhalla/pull/1745#discussion_r2543690075


More information about the valhalla-dev mailing list