jdk/src/java.base/share/classes/java/lang/invoke/X-VarHandleByteArrayView.java.template
equal
deleted
inserted
replaced
232 } |
232 } |
233 |
233 |
234 @ForceInline |
234 @ForceInline |
235 static boolean weakCompareAndSetVolatile(ArrayHandle handle, Object oba, int index, $type$ expected, $type$ value) { |
235 static boolean weakCompareAndSetVolatile(ArrayHandle handle, Object oba, int index, $type$ expected, $type$ value) { |
236 byte[] ba = (byte[]) oba; |
236 byte[] ba = (byte[]) oba; |
237 // TODO defer to strong form until new Unsafe method is added |
237 return UNSAFE.weakCompareAndSwap$RawType$Volatile( |
238 return UNSAFE.compareAndSwap$RawType$( |
|
239 ba, |
238 ba, |
240 address(ba, index(ba, index)), |
239 address(ba, index(ba, index)), |
241 convEndian(handle.be, expected), convEndian(handle.be, value)); |
240 convEndian(handle.be, expected), convEndian(handle.be, value)); |
242 } |
241 } |
243 |
242 |
465 } |
464 } |
466 |
465 |
467 @ForceInline |
466 @ForceInline |
468 static boolean weakCompareAndSetVolatile(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) { |
467 static boolean weakCompareAndSetVolatile(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) { |
469 ByteBuffer bb = (ByteBuffer) obb; |
468 ByteBuffer bb = (ByteBuffer) obb; |
470 // TODO defer to strong form until new Unsafe method is added |
469 return UNSAFE.weakCompareAndSwap$RawType$Volatile( |
471 return UNSAFE.compareAndSwap$RawType$( |
|
472 UNSAFE.getObject(bb, BYTE_BUFFER_HB), |
470 UNSAFE.getObject(bb, BYTE_BUFFER_HB), |
473 address(bb, indexRO(bb, index)), |
471 address(bb, indexRO(bb, index)), |
474 convEndian(handle.be, expected), convEndian(handle.be, value)); |
472 convEndian(handle.be, expected), convEndian(handle.be, value)); |
475 } |
473 } |
476 |
474 |