[lworld] RFR: 8348607: [lworld] Calls to Unsafe.getValue() / Unsafe.putValue() must be updated [v2]

Chen Liang liach at openjdk.org
Thu Jan 30 23:54:41 UTC 2025


On Thu, 30 Jan 2025 23:50:16 GMT, Chen Liang <liach at openjdk.org> wrote:

>> src/java.base/share/classes/java/lang/invoke/MemberName.java line 450:
>> 
>>> 448:     /**
>>> 449:      * VM-internal layout code for this field {@link jdk.internal.misc.Unsafe#fieldLayout(Field)}.
>>> 450:      * Only meaningful if the field {@link #isFlat()}, otherwise this may be garbage.
>> 
>> Can this be improved to have layout == 0 if !isFlat?
>> It would be cleaner and allow fewer tests in the code.
>> It might even be able to save a bit by testing the `highFlags & MN_HIGHT_LAYOUT_MASK == 0` instead of isFlat.
>> And Yes, I know this comes from the VM changes, it would need to be pushed back to the vm.
>
> Yep, removed the flat bit, and as a result removed the high flags in MemberName. Flat is now derived from the 3 layout bits all being 0.

Formalized `layout == 0` for non-flat, other values are for flat, but up to VM interpretation.

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

PR Review Comment: https://git.openjdk.org/valhalla/pull/1340#discussion_r1936464628


More information about the valhalla-dev mailing list