221 address(ba, index(ba, index)), |
221 address(ba, index(ba, index)), |
222 convEndian(handle.be, expected), convEndian(handle.be, value))); |
222 convEndian(handle.be, expected), convEndian(handle.be, value))); |
223 } |
223 } |
224 |
224 |
225 @ForceInline |
225 @ForceInline |
226 static boolean weakCompareAndSet(ArrayHandle handle, Object oba, int index, $type$ expected, $type$ value) { |
226 static boolean weakCompareAndSetPlain(ArrayHandle handle, Object oba, int index, $type$ expected, $type$ value) { |
227 byte[] ba = (byte[]) oba; |
227 byte[] ba = (byte[]) oba; |
228 return UNSAFE.weakCompareAndSwap$RawType$( |
228 return UNSAFE.weakCompareAndSwap$RawType$( |
229 ba, |
229 ba, |
230 address(ba, index(ba, index)), |
230 address(ba, index(ba, index)), |
231 convEndian(handle.be, expected), convEndian(handle.be, value)); |
231 convEndian(handle.be, expected), convEndian(handle.be, value)); |
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 weakCompareAndSet(ArrayHandle handle, Object oba, int index, $type$ expected, $type$ value) { |
236 byte[] ba = (byte[]) oba; |
236 byte[] ba = (byte[]) oba; |
237 return UNSAFE.weakCompareAndSwap$RawType$Volatile( |
237 return UNSAFE.weakCompareAndSwap$RawType$Volatile( |
238 ba, |
238 ba, |
239 address(ba, index(ba, index)), |
239 address(ba, index(ba, index)), |
240 convEndian(handle.be, expected), convEndian(handle.be, value)); |
240 convEndian(handle.be, expected), convEndian(handle.be, value)); |
660 address(bb, indexRO(bb, index)), |
660 address(bb, indexRO(bb, index)), |
661 convEndian(handle.be, expected), convEndian(handle.be, value))); |
661 convEndian(handle.be, expected), convEndian(handle.be, value))); |
662 } |
662 } |
663 |
663 |
664 @ForceInline |
664 @ForceInline |
665 static boolean weakCompareAndSet(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) { |
665 static boolean weakCompareAndSetPlain(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) { |
666 ByteBuffer bb = (ByteBuffer) obb; |
666 ByteBuffer bb = (ByteBuffer) obb; |
667 return UNSAFE.weakCompareAndSwap$RawType$( |
667 return UNSAFE.weakCompareAndSwap$RawType$( |
668 UNSAFE.getObject(bb, BYTE_BUFFER_HB), |
668 UNSAFE.getObject(bb, BYTE_BUFFER_HB), |
669 address(bb, indexRO(bb, index)), |
669 address(bb, indexRO(bb, index)), |
670 convEndian(handle.be, expected), convEndian(handle.be, value)); |
670 convEndian(handle.be, expected), convEndian(handle.be, value)); |
671 } |
671 } |
672 |
672 |
673 @ForceInline |
673 @ForceInline |
674 static boolean weakCompareAndSetVolatile(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) { |
674 static boolean weakCompareAndSet(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) { |
675 ByteBuffer bb = (ByteBuffer) obb; |
675 ByteBuffer bb = (ByteBuffer) obb; |
676 return UNSAFE.weakCompareAndSwap$RawType$Volatile( |
676 return UNSAFE.weakCompareAndSwap$RawType$Volatile( |
677 UNSAFE.getObject(bb, BYTE_BUFFER_HB), |
677 UNSAFE.getObject(bb, BYTE_BUFFER_HB), |
678 address(bb, indexRO(bb, index)), |
678 address(bb, indexRO(bb, index)), |
679 convEndian(handle.be, expected), convEndian(handle.be, value)); |
679 convEndian(handle.be, expected), convEndian(handle.be, value)); |