[lworld] RFR: 8371915: [lworld] LayoutKind enum should have helper methods [v2]
Coleen Phillimore
coleenp at openjdk.org
Fri Nov 21 20:19:57 UTC 2025
On Thu, 20 Nov 2025 20:57:37 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>> Frederic Parain has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Fix ArrayProperties for NULLABLE_ATOMIC_FLAT
>
> src/hotspot/share/oops/layoutKind.hpp line 85:
>
>> 83: };
>> 84:
>> 85: class LayoutKindHelper : AllStatic {
>
> I wonder if this would be nicer if LayoutKind was a class and these helpers were in that class and encapsulate the whole thing in LayoutKind, so the accessors could be lk->is_flat(), etc? less characters. The enum inside LayoutKind could be referenced as LayoutKind::Kind::REFERENCE if direct references to the value is needed. Other enum class types in the VM are used that way (like AccessFlags). Then also it wouldn't need a helper.
It might not be a good idea based on all the places that we read the LayoutKind enum values, in which case, never mind.
-------------
PR Review Comment: https://git.openjdk.org/valhalla/pull/1745#discussion_r2550859729
More information about the valhalla-dev
mailing list