@@ -664,14 +664,15 @@ public sealed interface MemoryLayout
664
664
* <p>
665
665
* If the provided layout path has size {@code m} and contains a dereference path
666
666
* element in position {@code k} (where {@code k <= m}) then two layout paths
667
- * {@code P} and {@code P'} are derived, where P contains all the path elements from
668
- * 0 to {@code k - 1} and {@code P'} contains all the path elements from {@code k + 1}
669
- * to {@code m} (if any). Then, the returned var handle is computed as follows:
667
+ * {@code P} and {@code Q} are derived, where P contains all the path elements from
668
+ * 0 to {@code k - 1} and {@code Q} contains all the path elements from {@code k + 1}
669
+ * to {@code m} ({@code Q} could be an empty layout path if {@code k == m}).
670
+ * Then, the returned var handle is computed as follows:
670
671
*
671
672
* {@snippet lang = "java":
672
673
* VarHandle baseHandle = this.varHandle(P);
673
674
* MemoryLayout target = ((AddressLayout)this.select(P)).targetLayout().get();
674
- * VarHandle targetHandle = target.varHandle(P );
675
+ * VarHandle targetHandle = target.varHandle(Q );
675
676
* targetHandle = MethodHandles.insertCoordinates(targetHandle, 1, 0L); // always access nested targets at offset 0
676
677
* targetHandle = MethodHandles.collectCoordinates(targetHandle, 0,
677
678
* baseHandle.toMethodHandle(VarHandle.AccessMode.GET));
@@ -944,7 +945,7 @@ static PathElement sequenceElement(long index) {
944
945
* is computed as follows:
945
946
* <ul>
946
947
* <li>if {@code F > 0}, then {@code B = ceilDiv(C - S, F)}</li>
947
- * <li>if {@code F < 0}, then {@code B = ceilDiv(-( S + 1) , -F)}</li>
948
+ * <li>if {@code F < 0}, then {@code B = ceilDiv(S + 1, -F)}</li>
948
949
* </ul>
949
950
* That is, the size of the returned open path element is {@code B}.
950
951
*
@@ -972,8 +973,8 @@ static PathElement sequenceElement() {
972
973
}
973
974
974
975
/**
975
- * {@return a path element that dereferences an address layout as its
976
- * {@linkplain AddressLayout#targetLayout() target layout} (where set)}
976
+ * {@return a path element that selects the {@linkplain AddressLayout#targetLayout() target layout} of
977
+ * an address layout (where set)}
977
978
*/
978
979
static PathElement dereferenceElement () {
979
980
return LayoutPath .DereferenceElement .instance ();
0 commit comments