< prev index next >

src/java.base/share/classes/java/lang/invoke/VarHandleMemoryAddressBase.java

Print this page

        

@@ -27,26 +27,37 @@
 
 /**
  * Base class for memory access var handle implementations.
  */
 abstract class VarHandleMemoryAddressBase extends VarHandle {
+
+    /** endianness **/
     final boolean be;
+
+    /** access size (in bytes, computed from var handle carrier type) **/
     final long length;
+
+    /** access offset (in bytes); must be compatible with {@code alignmentMask} **/
     final long offset;
-    final long alignment;
 
-    VarHandleMemoryAddressBase(VarForm form, boolean be, long length, long offset, long alignment) {
+    /** alignment constraint (in bytes, expressed as a bit mask) **/
+    final long alignmentMask;
+
+    VarHandleMemoryAddressBase(VarForm form, boolean be, long length, long offset, long alignmentMask) {
         super(form);
         this.be = be;
         this.length = length;
         this.offset = offset;
-        this.alignment = alignment;
+        this.alignmentMask = alignmentMask;
     }
 
     static IllegalStateException newIllegalStateExceptionForMisalignedAccess(long address) {
         return new IllegalStateException("Misaligned access at address: " + address);
     }
 
+    /**
+     * Strides used for multi-dimensional access; each stride must be compatible with {@code alignmentMask}.
+     */
     abstract long[] strides();
 
     abstract Class<?> carrier();
 }
< prev index next >