RFR: 8350118: Simplify the layout access VarHandle [v2]

Chen Liang liach at openjdk.org
Wed Feb 26 19:58:07 UTC 2025


On Wed, 26 Feb 2025 17:23:02 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

>> src/java.base/share/classes/jdk/internal/foreign/LayoutPath.java line 216:
>> 
>>> 214:         } else {
>>> 215:             // simpler adaptation
>>> 216:             handle = MethodHandles.insertCoordinates(handle, 2, offset);            // (MS, long)
>> 
>> Okay, looking at this code I think I get it: when the offset into the enclosing layout is fixed, we don't have strides (from `sequenceElement()`), so we don't need the extra adaptation.
>
> I suggest maybe renaming `noStride` to something like `fixedOffsetInEnclosing`

In last revision I called it `fixedOffset`, but it becomes confusing with the actual fixed value of the offset.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23720#discussion_r1972310946


More information about the build-dev mailing list