jdk/src/java.base/share/classes/java/lang/invoke/X-VarHandleByteArrayView.java.template
changeset 37719 add11bc0e6e2
parent 36934 590fc47a0aeb
child 38358 cb99c6d2af1b
child 37792 dd626e6f5967
equal deleted inserted replaced
37718:79b158dae903 37719:add11bc0e6e2
   226                     address(ba, index(ba, index)),
   226                     address(ba, index(ba, index)),
   227                     convEndian(handle.be, expected), convEndian(handle.be, value));
   227                     convEndian(handle.be, expected), convEndian(handle.be, value));
   228         }
   228         }
   229 
   229 
   230         @ForceInline
   230         @ForceInline
       
   231         static boolean weakCompareAndSetVolatile(ArrayHandle handle, Object oba, int index, $type$ expected, $type$ value) {
       
   232             byte[] ba = (byte[]) oba;
       
   233             // TODO defer to strong form until new Unsafe method is added
       
   234             return UNSAFE.compareAndSwap$RawType$(
       
   235                     ba,
       
   236                     address(ba, index(ba, index)),
       
   237                     convEndian(handle.be, expected), convEndian(handle.be, value));
       
   238         }
       
   239 
       
   240         @ForceInline
   231         static boolean weakCompareAndSetAcquire(ArrayHandle handle, Object oba, int index, $type$ expected, $type$ value) {
   241         static boolean weakCompareAndSetAcquire(ArrayHandle handle, Object oba, int index, $type$ expected, $type$ value) {
   232             byte[] ba = (byte[]) oba;
   242             byte[] ba = (byte[]) oba;
   233             return UNSAFE.weakCompareAndSwap$RawType$Acquire(
   243             return UNSAFE.weakCompareAndSwap$RawType$Acquire(
   234                     ba,
   244                     ba,
   235                     address(ba, index(ba, index)),
   245                     address(ba, index(ba, index)),
   442                     address(bb, indexRO(bb, index)),
   452                     address(bb, indexRO(bb, index)),
   443                     convEndian(handle.be, expected), convEndian(handle.be, value));
   453                     convEndian(handle.be, expected), convEndian(handle.be, value));
   444         }
   454         }
   445 
   455 
   446         @ForceInline
   456         @ForceInline
       
   457         static boolean weakCompareAndSetVolatile(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) {
       
   458             ByteBuffer bb = (ByteBuffer) obb;
       
   459             // TODO defer to strong form until new Unsafe method is added
       
   460             return UNSAFE.compareAndSwap$RawType$(
       
   461                     UNSAFE.getObject(bb, BYTE_BUFFER_HB),
       
   462                     address(bb, indexRO(bb, index)),
       
   463                     convEndian(handle.be, expected), convEndian(handle.be, value));
       
   464         }
       
   465 
       
   466         @ForceInline
   447         static boolean weakCompareAndSetAcquire(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) {
   467         static boolean weakCompareAndSetAcquire(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) {
   448             ByteBuffer bb = (ByteBuffer) obb;
   468             ByteBuffer bb = (ByteBuffer) obb;
   449             return UNSAFE.weakCompareAndSwap$RawType$Acquire(
   469             return UNSAFE.weakCompareAndSwap$RawType$Acquire(
   450                     UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   470                     UNSAFE.getObject(bb, BYTE_BUFFER_HB),
   451                     address(bb, indexRO(bb, index)),
   471                     address(bb, indexRO(bb, index)),