[foreign-preview] RFR: 8280597: Refactor java.lang.invoke.MethodHandles::memoryAccessVarHandle
Julia Boes
jboes at openjdk.java.net
Mon Mar 7 14:05:54 UTC 2022
On Mon, 7 Mar 2022 13:56:55 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
> This patch renames `MethodHandles::memoryAccessVarHandle` to `MethodHandles:memorySegmentViewVarHandle`, which is consistent with other methods in that class like `byteArrayViewVarHandle` and `byteBufferViewVarHandle`.
>
> When doing this, I also renamed several implementation classes and methods (included some automatically generated ones) to use the new names, and be more consistent with the naming scheme adopted for byte buffer var handle views.
>
> Finally, I tweaked the javadoc to use the new name. When doing this, I realized that the toplevel package javadoc was diving into var handles and combinators way too soon, so I have beefed up the memory segment dereference section (in the `MemorySegment` javadoc) and added a link from the package javadoc to that section.
>
> I'm still not 100% happy about how the memory segment javadoc looks, but for unrelated reasons, and I will deal with that in a separate pass.
src/java.base/share/classes/java/lang/foreign/MemorySegment.java line 137:
> 135: * {@linkplain MethodHandles#memorySegmentViewVarHandle(ValueLayout) memory segment view var handle},
> 136: * that is, a var handle that accepts a segment and a {@code long} offset. More complex access var handles
> 137: * can be obtained by adapt a segment var handle view using the var handle combinator functions defined in the
adapt -> adapting
-------------
PR: https://git.openjdk.java.net/panama-foreign/pull/663
More information about the panama-dev
mailing list