author | mchung |
Mon, 22 Oct 2018 17:00:04 -0700 | |
changeset 52220 | 9c260a6b6471 |
parent 48710 | 38872bed90e0 |
child 52914 | 4fa75d8ad418 |
permissions | -rw-r--r-- |
36934 | 1 |
/* |
48710 | 2 |
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. |
36934 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. Oracle designates this |
|
8 |
* particular file as subject to the "Classpath" exception as provided |
|
9 |
* by Oracle in the LICENSE file that accompanied this code. |
|
10 |
* |
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
24 |
*/ |
|
25 |
package java.lang.invoke; |
|
26 |
||
27 |
import jdk.internal.misc.Unsafe; |
|
38356
1e4ecca97792
8155794: Move Objects.checkIndex BiFunction accepting methods to an internal package
psandoz
parents:
36934
diff
changeset
|
28 |
import jdk.internal.util.Preconditions; |
36934 | 29 |
import jdk.internal.vm.annotation.ForceInline; |
30 |
||
31 |
import java.nio.ByteBuffer; |
|
32 |
import java.nio.ReadOnlyBufferException; |
|
33 |
import java.util.Objects; |
|
34 |
||
35 |
import static java.lang.invoke.MethodHandleStatics.UNSAFE; |
|
36 |
||
37 |
#warn |
|
38 |
||
39 |
final class VarHandleByteArrayAs$Type$s extends VarHandleByteArrayBase { |
|
40 |
||
41 |
static final int ALIGN = $BoxType$.BYTES - 1; |
|
42 |
||
43 |
#if[floatingPoint] |
|
44 |
@ForceInline |
|
45 |
static $rawType$ convEndian(boolean big, $type$ v) { |
|
46 |
$rawType$ rv = $Type$.$type$ToRaw$RawType$Bits(v); |
|
47 |
return big == BE ? rv : $RawBoxType$.reverseBytes(rv); |
|
48 |
} |
|
49 |
||
50 |
@ForceInline |
|
51 |
static $type$ convEndian(boolean big, $rawType$ rv) { |
|
52 |
rv = big == BE ? rv : $RawBoxType$.reverseBytes(rv); |
|
53 |
return $Type$.$rawType$BitsTo$Type$(rv); |
|
54 |
} |
|
55 |
#else[floatingPoint] |
|
56 |
@ForceInline |
|
57 |
static $type$ convEndian(boolean big, $type$ n) { |
|
58 |
return big == BE ? n : $BoxType$.reverseBytes(n); |
|
59 |
} |
|
60 |
#end[floatingPoint] |
|
61 |
||
62 |
||
37792 | 63 |
private static abstract class ByteArrayViewVarHandle extends VarHandle { |
36934 | 64 |
final boolean be; |
65 |
||
37792 | 66 |
ByteArrayViewVarHandle(VarForm form, boolean be) { |
67 |
super(form); |
|
36934 | 68 |
this.be = be; |
69 |
} |
|
70 |
} |
|
71 |
||
72 |
static final class ArrayHandle extends ByteArrayViewVarHandle { |
|
73 |
||
74 |
ArrayHandle(boolean be) { |
|
37792 | 75 |
super(ArrayHandle.FORM, be); |
76 |
} |
|
77 |
||
78 |
@Override |
|
79 |
final MethodType accessModeTypeUncached(AccessMode accessMode) { |
|
80 |
return accessMode.at.accessModeType(byte[].class, $type$.class, int.class); |
|
36934 | 81 |
} |
82 |
||
83 |
@ForceInline |
|
84 |
static int index(byte[] ba, int index) { |
|
38356
1e4ecca97792
8155794: Move Objects.checkIndex BiFunction accepting methods to an internal package
psandoz
parents:
36934
diff
changeset
|
85 |
return Preconditions.checkIndex(index, ba.length - ALIGN, null); |
36934 | 86 |
} |
87 |
||
88 |
@ForceInline |
|
89 |
static long address(byte[] ba, int index) { |
|
90 |
long address = ((long) index) + Unsafe.ARRAY_BYTE_BASE_OFFSET; |
|
91 |
if ((address & ALIGN) != 0) |
|
92 |
throw newIllegalStateExceptionForMisalignedAccess(index); |
|
93 |
return address; |
|
94 |
} |
|
95 |
||
96 |
@ForceInline |
|
97 |
static $type$ get(ArrayHandle handle, Object oba, int index) { |
|
98 |
byte[] ba = (byte[]) oba; |
|
99 |
#if[floatingPoint] |
|
100 |
$rawType$ rawValue = UNSAFE.get$RawType$Unaligned( |
|
101 |
ba, |
|
102 |
((long) index(ba, index)) + Unsafe.ARRAY_BYTE_BASE_OFFSET, |
|
103 |
handle.be); |
|
104 |
return $Type$.$rawType$BitsTo$Type$(rawValue); |
|
105 |
#else[floatingPoint] |
|
106 |
return UNSAFE.get$Type$Unaligned( |
|
107 |
ba, |
|
108 |
((long) index(ba, index)) + Unsafe.ARRAY_BYTE_BASE_OFFSET, |
|
109 |
handle.be); |
|
110 |
#end[floatingPoint] |
|
111 |
} |
|
112 |
||
113 |
@ForceInline |
|
114 |
static void set(ArrayHandle handle, Object oba, int index, $type$ value) { |
|
115 |
byte[] ba = (byte[]) oba; |
|
116 |
#if[floatingPoint] |
|
117 |
UNSAFE.put$RawType$Unaligned( |
|
118 |
ba, |
|
119 |
((long) index(ba, index)) + Unsafe.ARRAY_BYTE_BASE_OFFSET, |
|
120 |
$Type$.$type$ToRaw$RawType$Bits(value), |
|
121 |
handle.be); |
|
122 |
#else[floatingPoint] |
|
123 |
UNSAFE.put$RawType$Unaligned( |
|
124 |
ba, |
|
125 |
((long) index(ba, index)) + Unsafe.ARRAY_BYTE_BASE_OFFSET, |
|
126 |
value, |
|
127 |
handle.be); |
|
128 |
#end[floatingPoint] |
|
129 |
} |
|
130 |
||
131 |
@ForceInline |
|
132 |
static $type$ getVolatile(ArrayHandle handle, Object oba, int index) { |
|
133 |
byte[] ba = (byte[]) oba; |
|
134 |
return convEndian(handle.be, |
|
135 |
UNSAFE.get$RawType$Volatile( |
|
136 |
ba, |
|
137 |
address(ba, index(ba, index)))); |
|
138 |
} |
|
139 |
||
140 |
@ForceInline |
|
141 |
static void setVolatile(ArrayHandle handle, Object oba, int index, $type$ value) { |
|
142 |
byte[] ba = (byte[]) oba; |
|
143 |
UNSAFE.put$RawType$Volatile( |
|
144 |
ba, |
|
145 |
address(ba, index(ba, index)), |
|
146 |
convEndian(handle.be, value)); |
|
147 |
} |
|
148 |
||
149 |
@ForceInline |
|
150 |
static $type$ getAcquire(ArrayHandle handle, Object oba, int index) { |
|
151 |
byte[] ba = (byte[]) oba; |
|
152 |
return convEndian(handle.be, |
|
153 |
UNSAFE.get$RawType$Acquire( |
|
154 |
ba, |
|
155 |
address(ba, index(ba, index)))); |
|
156 |
} |
|
157 |
||
158 |
@ForceInline |
|
159 |
static void setRelease(ArrayHandle handle, Object oba, int index, $type$ value) { |
|
160 |
byte[] ba = (byte[]) oba; |
|
161 |
UNSAFE.put$RawType$Release( |
|
162 |
ba, |
|
163 |
address(ba, index(ba, index)), |
|
164 |
convEndian(handle.be, value)); |
|
165 |
} |
|
166 |
||
167 |
@ForceInline |
|
168 |
static $type$ getOpaque(ArrayHandle handle, Object oba, int index) { |
|
169 |
byte[] ba = (byte[]) oba; |
|
170 |
return convEndian(handle.be, |
|
171 |
UNSAFE.get$RawType$Opaque( |
|
172 |
ba, |
|
173 |
address(ba, index(ba, index)))); |
|
174 |
} |
|
175 |
||
176 |
@ForceInline |
|
177 |
static void setOpaque(ArrayHandle handle, Object oba, int index, $type$ value) { |
|
178 |
byte[] ba = (byte[]) oba; |
|
179 |
UNSAFE.put$RawType$Opaque( |
|
180 |
ba, |
|
181 |
address(ba, index(ba, index)), |
|
182 |
convEndian(handle.be, value)); |
|
183 |
} |
|
184 |
#if[CAS] |
|
185 |
||
186 |
@ForceInline |
|
187 |
static boolean compareAndSet(ArrayHandle handle, Object oba, int index, $type$ expected, $type$ value) { |
|
188 |
byte[] ba = (byte[]) oba; |
|
52220
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
189 |
#if[Object] |
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
190 |
return UNSAFE.compareAndSetReference( |
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
191 |
ba, |
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
192 |
address(ba, index(ba, index)), |
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
193 |
convEndian(handle.be, expected), convEndian(handle.be, value)); |
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
194 |
#else[Object] |
45518
4a116dd82fb5
8181292: Backport Rename internal Unsafe.compare methods from 10 to 9
psandoz
parents:
40734
diff
changeset
|
195 |
return UNSAFE.compareAndSet$RawType$( |
36934 | 196 |
ba, |
197 |
address(ba, index(ba, index)), |
|
198 |
convEndian(handle.be, expected), convEndian(handle.be, value)); |
|
52220
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
199 |
#end[Object] |
36934 | 200 |
} |
201 |
||
202 |
@ForceInline |
|
39472
6df82f4c63ac
8154737: Rename VarHandle.compareAndExchangeVolatile to VarHandle.compareAndExchange
psandoz
parents:
38382
diff
changeset
|
203 |
static $type$ compareAndExchange(ArrayHandle handle, Object oba, int index, $type$ expected, $type$ value) { |
36934 | 204 |
byte[] ba = (byte[]) oba; |
205 |
return convEndian(handle.be, |
|
45518
4a116dd82fb5
8181292: Backport Rename internal Unsafe.compare methods from 10 to 9
psandoz
parents:
40734
diff
changeset
|
206 |
UNSAFE.compareAndExchange$RawType$( |
36934 | 207 |
ba, |
208 |
address(ba, index(ba, index)), |
|
209 |
convEndian(handle.be, expected), convEndian(handle.be, value))); |
|
210 |
} |
|
211 |
||
212 |
@ForceInline |
|
213 |
static $type$ compareAndExchangeAcquire(ArrayHandle handle, Object oba, int index, $type$ expected, $type$ value) { |
|
214 |
byte[] ba = (byte[]) oba; |
|
215 |
return convEndian(handle.be, |
|
216 |
UNSAFE.compareAndExchange$RawType$Acquire( |
|
217 |
ba, |
|
218 |
address(ba, index(ba, index)), |
|
219 |
convEndian(handle.be, expected), convEndian(handle.be, value))); |
|
220 |
} |
|
221 |
||
222 |
@ForceInline |
|
223 |
static $type$ compareAndExchangeRelease(ArrayHandle handle, Object oba, int index, $type$ expected, $type$ value) { |
|
224 |
byte[] ba = (byte[]) oba; |
|
225 |
return convEndian(handle.be, |
|
226 |
UNSAFE.compareAndExchange$RawType$Release( |
|
227 |
ba, |
|
228 |
address(ba, index(ba, index)), |
|
229 |
convEndian(handle.be, expected), convEndian(handle.be, value))); |
|
230 |
} |
|
231 |
||
232 |
@ForceInline |
|
40734
48879ea67e2a
8162108: Rename weakCompareAndSetVolatile to weakCompareAndSet
psandoz
parents:
40733
diff
changeset
|
233 |
static boolean weakCompareAndSetPlain(ArrayHandle handle, Object oba, int index, $type$ expected, $type$ value) { |
36934 | 234 |
byte[] ba = (byte[]) oba; |
45518
4a116dd82fb5
8181292: Backport Rename internal Unsafe.compare methods from 10 to 9
psandoz
parents:
40734
diff
changeset
|
235 |
return UNSAFE.weakCompareAndSet$RawType$Plain( |
36934 | 236 |
ba, |
237 |
address(ba, index(ba, index)), |
|
238 |
convEndian(handle.be, expected), convEndian(handle.be, value)); |
|
239 |
} |
|
240 |
||
241 |
@ForceInline |
|
40734
48879ea67e2a
8162108: Rename weakCompareAndSetVolatile to weakCompareAndSet
psandoz
parents:
40733
diff
changeset
|
242 |
static boolean weakCompareAndSet(ArrayHandle handle, Object oba, int index, $type$ expected, $type$ value) { |
37719
add11bc0e6e2
8154755: Add a VarHandle weakCompareAndSet with volatile semantics
psandoz
parents:
36934
diff
changeset
|
243 |
byte[] ba = (byte[]) oba; |
45518
4a116dd82fb5
8181292: Backport Rename internal Unsafe.compare methods from 10 to 9
psandoz
parents:
40734
diff
changeset
|
244 |
return UNSAFE.weakCompareAndSet$RawType$( |
37719
add11bc0e6e2
8154755: Add a VarHandle weakCompareAndSet with volatile semantics
psandoz
parents:
36934
diff
changeset
|
245 |
ba, |
add11bc0e6e2
8154755: Add a VarHandle weakCompareAndSet with volatile semantics
psandoz
parents:
36934
diff
changeset
|
246 |
address(ba, index(ba, index)), |
add11bc0e6e2
8154755: Add a VarHandle weakCompareAndSet with volatile semantics
psandoz
parents:
36934
diff
changeset
|
247 |
convEndian(handle.be, expected), convEndian(handle.be, value)); |
add11bc0e6e2
8154755: Add a VarHandle weakCompareAndSet with volatile semantics
psandoz
parents:
36934
diff
changeset
|
248 |
} |
add11bc0e6e2
8154755: Add a VarHandle weakCompareAndSet with volatile semantics
psandoz
parents:
36934
diff
changeset
|
249 |
|
add11bc0e6e2
8154755: Add a VarHandle weakCompareAndSet with volatile semantics
psandoz
parents:
36934
diff
changeset
|
250 |
@ForceInline |
36934 | 251 |
static boolean weakCompareAndSetAcquire(ArrayHandle handle, Object oba, int index, $type$ expected, $type$ value) { |
252 |
byte[] ba = (byte[]) oba; |
|
45518
4a116dd82fb5
8181292: Backport Rename internal Unsafe.compare methods from 10 to 9
psandoz
parents:
40734
diff
changeset
|
253 |
return UNSAFE.weakCompareAndSet$RawType$Acquire( |
36934 | 254 |
ba, |
255 |
address(ba, index(ba, index)), |
|
256 |
convEndian(handle.be, expected), convEndian(handle.be, value)); |
|
257 |
} |
|
258 |
||
259 |
@ForceInline |
|
260 |
static boolean weakCompareAndSetRelease(ArrayHandle handle, Object oba, int index, $type$ expected, $type$ value) { |
|
261 |
byte[] ba = (byte[]) oba; |
|
45518
4a116dd82fb5
8181292: Backport Rename internal Unsafe.compare methods from 10 to 9
psandoz
parents:
40734
diff
changeset
|
262 |
return UNSAFE.weakCompareAndSet$RawType$Release( |
36934 | 263 |
ba, |
264 |
address(ba, index(ba, index)), |
|
265 |
convEndian(handle.be, expected), convEndian(handle.be, value)); |
|
266 |
} |
|
267 |
||
268 |
@ForceInline |
|
269 |
static $type$ getAndSet(ArrayHandle handle, Object oba, int index, $type$ value) { |
|
270 |
byte[] ba = (byte[]) oba; |
|
52220
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
271 |
#if[Object] |
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
272 |
return convEndian(handle.be, |
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
273 |
UNSAFE.getAndSetReference( |
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
274 |
ba, |
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
275 |
address(ba, index(ba, index)), |
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
276 |
convEndian(handle.be, value))); |
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
277 |
#else[Object] |
36934 | 278 |
return convEndian(handle.be, |
279 |
UNSAFE.getAndSet$RawType$( |
|
280 |
ba, |
|
281 |
address(ba, index(ba, index)), |
|
282 |
convEndian(handle.be, value))); |
|
52220
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
283 |
#end[Object] |
36934 | 284 |
} |
40732
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
285 |
|
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
286 |
@ForceInline |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
287 |
static $type$ getAndSetAcquire(ArrayHandle handle, Object oba, int index, $type$ value) { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
288 |
byte[] ba = (byte[]) oba; |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
289 |
return convEndian(handle.be, |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
290 |
UNSAFE.getAndSet$RawType$Acquire( |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
291 |
ba, |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
292 |
address(ba, index(ba, index)), |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
293 |
convEndian(handle.be, value))); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
294 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
295 |
|
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
296 |
@ForceInline |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
297 |
static $type$ getAndSetRelease(ArrayHandle handle, Object oba, int index, $type$ value) { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
298 |
byte[] ba = (byte[]) oba; |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
299 |
return convEndian(handle.be, |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
300 |
UNSAFE.getAndSet$RawType$Release( |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
301 |
ba, |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
302 |
address(ba, index(ba, index)), |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
303 |
convEndian(handle.be, value))); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
304 |
} |
36934 | 305 |
#end[CAS] |
306 |
#if[AtomicAdd] |
|
307 |
||
308 |
@ForceInline |
|
38382
98d5a441bc2f
8157152: Atomic add for VarHandle byte[]/ByteBuffer views is incorrect for endian conversion
psandoz
parents:
38372
diff
changeset
|
309 |
static $type$ getAndAdd(ArrayHandle handle, Object oba, int index, $type$ delta) { |
36934 | 310 |
byte[] ba = (byte[]) oba; |
38382
98d5a441bc2f
8157152: Atomic add for VarHandle byte[]/ByteBuffer views is incorrect for endian conversion
psandoz
parents:
38372
diff
changeset
|
311 |
if (handle.be == BE) { |
98d5a441bc2f
8157152: Atomic add for VarHandle byte[]/ByteBuffer views is incorrect for endian conversion
psandoz
parents:
38372
diff
changeset
|
312 |
return UNSAFE.getAndAdd$RawType$( |
98d5a441bc2f
8157152: Atomic add for VarHandle byte[]/ByteBuffer views is incorrect for endian conversion
psandoz
parents:
38372
diff
changeset
|
313 |
ba, |
98d5a441bc2f
8157152: Atomic add for VarHandle byte[]/ByteBuffer views is incorrect for endian conversion
psandoz
parents:
38372
diff
changeset
|
314 |
address(ba, index(ba, index)), |
98d5a441bc2f
8157152: Atomic add for VarHandle byte[]/ByteBuffer views is incorrect for endian conversion
psandoz
parents:
38372
diff
changeset
|
315 |
delta); |
98d5a441bc2f
8157152: Atomic add for VarHandle byte[]/ByteBuffer views is incorrect for endian conversion
psandoz
parents:
38372
diff
changeset
|
316 |
} else { |
98d5a441bc2f
8157152: Atomic add for VarHandle byte[]/ByteBuffer views is incorrect for endian conversion
psandoz
parents:
38372
diff
changeset
|
317 |
return getAndAddConvEndianWithCAS(ba, index, delta); |
98d5a441bc2f
8157152: Atomic add for VarHandle byte[]/ByteBuffer views is incorrect for endian conversion
psandoz
parents:
38372
diff
changeset
|
318 |
} |
36934 | 319 |
} |
320 |
||
321 |
@ForceInline |
|
40732
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
322 |
static $type$ getAndAddAcquire(ArrayHandle handle, Object oba, int index, $type$ delta) { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
323 |
byte[] ba = (byte[]) oba; |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
324 |
if (handle.be == BE) { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
325 |
return UNSAFE.getAndAdd$RawType$Acquire( |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
326 |
ba, |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
327 |
address(ba, index(ba, index)), |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
328 |
delta); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
329 |
} else { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
330 |
return getAndAddConvEndianWithCAS(ba, index, delta); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
331 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
332 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
333 |
|
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
334 |
@ForceInline |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
335 |
static $type$ getAndAddRelease(ArrayHandle handle, Object oba, int index, $type$ delta) { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
336 |
byte[] ba = (byte[]) oba; |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
337 |
if (handle.be == BE) { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
338 |
return UNSAFE.getAndAdd$RawType$Release( |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
339 |
ba, |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
340 |
address(ba, index(ba, index)), |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
341 |
delta); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
342 |
} else { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
343 |
return getAndAddConvEndianWithCAS(ba, index, delta); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
344 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
345 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
346 |
|
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
347 |
@ForceInline |
38382
98d5a441bc2f
8157152: Atomic add for VarHandle byte[]/ByteBuffer views is incorrect for endian conversion
psandoz
parents:
38372
diff
changeset
|
348 |
static $type$ getAndAddConvEndianWithCAS(byte[] ba, int index, $type$ delta) { |
98d5a441bc2f
8157152: Atomic add for VarHandle byte[]/ByteBuffer views is incorrect for endian conversion
psandoz
parents:
38372
diff
changeset
|
349 |
$type$ nativeExpectedValue, expectedValue; |
98d5a441bc2f
8157152: Atomic add for VarHandle byte[]/ByteBuffer views is incorrect for endian conversion
psandoz
parents:
38372
diff
changeset
|
350 |
long offset = address(ba, index(ba, index)); |
98d5a441bc2f
8157152: Atomic add for VarHandle byte[]/ByteBuffer views is incorrect for endian conversion
psandoz
parents:
38372
diff
changeset
|
351 |
do { |
98d5a441bc2f
8157152: Atomic add for VarHandle byte[]/ByteBuffer views is incorrect for endian conversion
psandoz
parents:
38372
diff
changeset
|
352 |
nativeExpectedValue = UNSAFE.get$RawType$Volatile(ba, offset); |
98d5a441bc2f
8157152: Atomic add for VarHandle byte[]/ByteBuffer views is incorrect for endian conversion
psandoz
parents:
38372
diff
changeset
|
353 |
expectedValue = $RawBoxType$.reverseBytes(nativeExpectedValue); |
45518
4a116dd82fb5
8181292: Backport Rename internal Unsafe.compare methods from 10 to 9
psandoz
parents:
40734
diff
changeset
|
354 |
} while (!UNSAFE.weakCompareAndSet$RawType$(ba, offset, |
38382
98d5a441bc2f
8157152: Atomic add for VarHandle byte[]/ByteBuffer views is incorrect for endian conversion
psandoz
parents:
38372
diff
changeset
|
355 |
nativeExpectedValue, $RawBoxType$.reverseBytes(expectedValue + delta))); |
98d5a441bc2f
8157152: Atomic add for VarHandle byte[]/ByteBuffer views is incorrect for endian conversion
psandoz
parents:
38372
diff
changeset
|
356 |
return expectedValue; |
98d5a441bc2f
8157152: Atomic add for VarHandle byte[]/ByteBuffer views is incorrect for endian conversion
psandoz
parents:
38372
diff
changeset
|
357 |
} |
36934 | 358 |
#end[AtomicAdd] |
40732
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
359 |
#if[Bitwise] |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
360 |
|
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
361 |
@ForceInline |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
362 |
static $type$ getAndBitwiseOr(ArrayHandle handle, Object oba, int index, $type$ value) { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
363 |
byte[] ba = (byte[]) oba; |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
364 |
if (handle.be == BE) { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
365 |
return UNSAFE.getAndBitwiseOr$RawType$( |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
366 |
ba, |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
367 |
address(ba, index(ba, index)), |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
368 |
value); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
369 |
} else { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
370 |
return getAndBitwiseOrConvEndianWithCAS(ba, index, value); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
371 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
372 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
373 |
|
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
374 |
@ForceInline |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
375 |
static $type$ getAndBitwiseOrRelease(ArrayHandle handle, Object oba, int index, $type$ value) { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
376 |
byte[] ba = (byte[]) oba; |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
377 |
if (handle.be == BE) { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
378 |
return UNSAFE.getAndBitwiseOr$RawType$Release( |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
379 |
ba, |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
380 |
address(ba, index(ba, index)), |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
381 |
value); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
382 |
} else { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
383 |
return getAndBitwiseOrConvEndianWithCAS(ba, index, value); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
384 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
385 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
386 |
|
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
387 |
@ForceInline |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
388 |
static $type$ getAndBitwiseOrAcquire(ArrayHandle handle, Object oba, int index, $type$ value) { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
389 |
byte[] ba = (byte[]) oba; |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
390 |
if (handle.be == BE) { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
391 |
return UNSAFE.getAndBitwiseOr$RawType$Acquire( |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
392 |
ba, |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
393 |
address(ba, index(ba, index)), |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
394 |
value); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
395 |
} else { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
396 |
return getAndBitwiseOrConvEndianWithCAS(ba, index, value); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
397 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
398 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
399 |
|
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
400 |
@ForceInline |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
401 |
static $type$ getAndBitwiseOrConvEndianWithCAS(byte[] ba, int index, $type$ value) { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
402 |
$type$ nativeExpectedValue, expectedValue; |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
403 |
long offset = address(ba, index(ba, index)); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
404 |
do { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
405 |
nativeExpectedValue = UNSAFE.get$RawType$Volatile(ba, offset); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
406 |
expectedValue = $RawBoxType$.reverseBytes(nativeExpectedValue); |
45518
4a116dd82fb5
8181292: Backport Rename internal Unsafe.compare methods from 10 to 9
psandoz
parents:
40734
diff
changeset
|
407 |
} while (!UNSAFE.weakCompareAndSet$RawType$(ba, offset, |
40732
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
408 |
nativeExpectedValue, $RawBoxType$.reverseBytes(expectedValue | value))); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
409 |
return expectedValue; |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
410 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
411 |
|
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
412 |
@ForceInline |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
413 |
static $type$ getAndBitwiseAnd(ArrayHandle handle, Object oba, int index, $type$ value) { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
414 |
byte[] ba = (byte[]) oba; |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
415 |
if (handle.be == BE) { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
416 |
return UNSAFE.getAndBitwiseAnd$RawType$( |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
417 |
ba, |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
418 |
address(ba, index(ba, index)), |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
419 |
value); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
420 |
} else { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
421 |
return getAndBitwiseAndConvEndianWithCAS(ba, index, value); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
422 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
423 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
424 |
|
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
425 |
@ForceInline |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
426 |
static $type$ getAndBitwiseAndRelease(ArrayHandle handle, Object oba, int index, $type$ value) { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
427 |
byte[] ba = (byte[]) oba; |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
428 |
if (handle.be == BE) { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
429 |
return UNSAFE.getAndBitwiseAnd$RawType$Release( |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
430 |
ba, |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
431 |
address(ba, index(ba, index)), |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
432 |
value); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
433 |
} else { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
434 |
return getAndBitwiseAndConvEndianWithCAS(ba, index, value); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
435 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
436 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
437 |
|
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
438 |
@ForceInline |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
439 |
static $type$ getAndBitwiseAndAcquire(ArrayHandle handle, Object oba, int index, $type$ value) { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
440 |
byte[] ba = (byte[]) oba; |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
441 |
if (handle.be == BE) { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
442 |
return UNSAFE.getAndBitwiseAnd$RawType$Acquire( |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
443 |
ba, |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
444 |
address(ba, index(ba, index)), |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
445 |
value); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
446 |
} else { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
447 |
return getAndBitwiseAndConvEndianWithCAS(ba, index, value); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
448 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
449 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
450 |
|
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
451 |
@ForceInline |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
452 |
static $type$ getAndBitwiseAndConvEndianWithCAS(byte[] ba, int index, $type$ value) { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
453 |
$type$ nativeExpectedValue, expectedValue; |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
454 |
long offset = address(ba, index(ba, index)); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
455 |
do { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
456 |
nativeExpectedValue = UNSAFE.get$RawType$Volatile(ba, offset); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
457 |
expectedValue = $RawBoxType$.reverseBytes(nativeExpectedValue); |
45518
4a116dd82fb5
8181292: Backport Rename internal Unsafe.compare methods from 10 to 9
psandoz
parents:
40734
diff
changeset
|
458 |
} while (!UNSAFE.weakCompareAndSet$RawType$(ba, offset, |
40732
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
459 |
nativeExpectedValue, $RawBoxType$.reverseBytes(expectedValue & value))); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
460 |
return expectedValue; |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
461 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
462 |
|
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
463 |
@ForceInline |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
464 |
static $type$ getAndBitwiseXor(ArrayHandle handle, Object oba, int index, $type$ value) { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
465 |
byte[] ba = (byte[]) oba; |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
466 |
if (handle.be == BE) { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
467 |
return UNSAFE.getAndBitwiseXor$RawType$( |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
468 |
ba, |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
469 |
address(ba, index(ba, index)), |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
470 |
value); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
471 |
} else { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
472 |
return getAndBitwiseXorConvEndianWithCAS(ba, index, value); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
473 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
474 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
475 |
|
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
476 |
@ForceInline |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
477 |
static $type$ getAndBitwiseXorRelease(ArrayHandle handle, Object oba, int index, $type$ value) { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
478 |
byte[] ba = (byte[]) oba; |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
479 |
if (handle.be == BE) { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
480 |
return UNSAFE.getAndBitwiseXor$RawType$Release( |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
481 |
ba, |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
482 |
address(ba, index(ba, index)), |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
483 |
value); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
484 |
} else { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
485 |
return getAndBitwiseXorConvEndianWithCAS(ba, index, value); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
486 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
487 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
488 |
|
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
489 |
@ForceInline |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
490 |
static $type$ getAndBitwiseXorAcquire(ArrayHandle handle, Object oba, int index, $type$ value) { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
491 |
byte[] ba = (byte[]) oba; |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
492 |
if (handle.be == BE) { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
493 |
return UNSAFE.getAndBitwiseXor$RawType$Acquire( |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
494 |
ba, |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
495 |
address(ba, index(ba, index)), |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
496 |
value); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
497 |
} else { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
498 |
return getAndBitwiseXorConvEndianWithCAS(ba, index, value); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
499 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
500 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
501 |
|
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
502 |
@ForceInline |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
503 |
static $type$ getAndBitwiseXorConvEndianWithCAS(byte[] ba, int index, $type$ value) { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
504 |
$type$ nativeExpectedValue, expectedValue; |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
505 |
long offset = address(ba, index(ba, index)); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
506 |
do { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
507 |
nativeExpectedValue = UNSAFE.get$RawType$Volatile(ba, offset); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
508 |
expectedValue = $RawBoxType$.reverseBytes(nativeExpectedValue); |
45518
4a116dd82fb5
8181292: Backport Rename internal Unsafe.compare methods from 10 to 9
psandoz
parents:
40734
diff
changeset
|
509 |
} while (!UNSAFE.weakCompareAndSet$RawType$(ba, offset, |
40732
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
510 |
nativeExpectedValue, $RawBoxType$.reverseBytes(expectedValue ^ value))); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
511 |
return expectedValue; |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
512 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
513 |
#end[Bitwise] |
37792 | 514 |
|
515 |
static final VarForm FORM = new VarForm(ArrayHandle.class, byte[].class, $type$.class, int.class); |
|
36934 | 516 |
} |
517 |
||
518 |
||
519 |
static final class ByteBufferHandle extends ByteArrayViewVarHandle { |
|
520 |
||
521 |
ByteBufferHandle(boolean be) { |
|
37792 | 522 |
super(ByteBufferHandle.FORM, be); |
523 |
} |
|
524 |
||
525 |
@Override |
|
526 |
final MethodType accessModeTypeUncached(AccessMode accessMode) { |
|
527 |
return accessMode.at.accessModeType(ByteBuffer.class, $type$.class, int.class); |
|
36934 | 528 |
} |
529 |
||
530 |
@ForceInline |
|
531 |
static int index(ByteBuffer bb, int index) { |
|
38356
1e4ecca97792
8155794: Move Objects.checkIndex BiFunction accepting methods to an internal package
psandoz
parents:
36934
diff
changeset
|
532 |
return Preconditions.checkIndex(index, UNSAFE.getInt(bb, BUFFER_LIMIT) - ALIGN, null); |
36934 | 533 |
} |
534 |
||
535 |
@ForceInline |
|
536 |
static int indexRO(ByteBuffer bb, int index) { |
|
537 |
if (UNSAFE.getBoolean(bb, BYTE_BUFFER_IS_READ_ONLY)) |
|
538 |
throw new ReadOnlyBufferException(); |
|
38356
1e4ecca97792
8155794: Move Objects.checkIndex BiFunction accepting methods to an internal package
psandoz
parents:
36934
diff
changeset
|
539 |
return Preconditions.checkIndex(index, UNSAFE.getInt(bb, BUFFER_LIMIT) - ALIGN, null); |
36934 | 540 |
} |
541 |
||
542 |
@ForceInline |
|
543 |
static long address(ByteBuffer bb, int index) { |
|
544 |
long address = ((long) index) + UNSAFE.getLong(bb, BUFFER_ADDRESS); |
|
545 |
if ((address & ALIGN) != 0) |
|
546 |
throw newIllegalStateExceptionForMisalignedAccess(index); |
|
547 |
return address; |
|
548 |
} |
|
549 |
||
550 |
@ForceInline |
|
551 |
static $type$ get(ByteBufferHandle handle, Object obb, int index) { |
|
48710 | 552 |
ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); |
36934 | 553 |
#if[floatingPoint] |
554 |
$rawType$ rawValue = UNSAFE.get$RawType$Unaligned( |
|
52220
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
555 |
UNSAFE.getReference(bb, BYTE_BUFFER_HB), |
36934 | 556 |
((long) index(bb, index)) + UNSAFE.getLong(bb, BUFFER_ADDRESS), |
557 |
handle.be); |
|
558 |
return $Type$.$rawType$BitsTo$Type$(rawValue); |
|
559 |
#else[floatingPoint] |
|
560 |
return UNSAFE.get$Type$Unaligned( |
|
52220
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
561 |
UNSAFE.getReference(bb, BYTE_BUFFER_HB), |
36934 | 562 |
((long) index(bb, index)) + UNSAFE.getLong(bb, BUFFER_ADDRESS), |
563 |
handle.be); |
|
564 |
#end[floatingPoint] |
|
565 |
} |
|
566 |
||
567 |
@ForceInline |
|
568 |
static void set(ByteBufferHandle handle, Object obb, int index, $type$ value) { |
|
48710 | 569 |
ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); |
36934 | 570 |
#if[floatingPoint] |
571 |
UNSAFE.put$RawType$Unaligned( |
|
52220
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
572 |
UNSAFE.getReference(bb, BYTE_BUFFER_HB), |
36934 | 573 |
((long) indexRO(bb, index)) + UNSAFE.getLong(bb, BUFFER_ADDRESS), |
574 |
$Type$.$type$ToRaw$RawType$Bits(value), |
|
575 |
handle.be); |
|
576 |
#else[floatingPoint] |
|
577 |
UNSAFE.put$Type$Unaligned( |
|
52220
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
578 |
UNSAFE.getReference(bb, BYTE_BUFFER_HB), |
36934 | 579 |
((long) indexRO(bb, index)) + UNSAFE.getLong(bb, BUFFER_ADDRESS), |
580 |
value, |
|
581 |
handle.be); |
|
582 |
#end[floatingPoint] |
|
583 |
} |
|
584 |
||
585 |
@ForceInline |
|
586 |
static $type$ getVolatile(ByteBufferHandle handle, Object obb, int index) { |
|
48710 | 587 |
ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); |
36934 | 588 |
return convEndian(handle.be, |
589 |
UNSAFE.get$RawType$Volatile( |
|
52220
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
590 |
UNSAFE.getReference(bb, BYTE_BUFFER_HB), |
36934 | 591 |
address(bb, index(bb, index)))); |
592 |
} |
|
593 |
||
594 |
@ForceInline |
|
595 |
static void setVolatile(ByteBufferHandle handle, Object obb, int index, $type$ value) { |
|
48710 | 596 |
ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); |
36934 | 597 |
UNSAFE.put$RawType$Volatile( |
52220
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
598 |
UNSAFE.getReference(bb, BYTE_BUFFER_HB), |
36934 | 599 |
address(bb, indexRO(bb, index)), |
600 |
convEndian(handle.be, value)); |
|
601 |
} |
|
602 |
||
603 |
@ForceInline |
|
604 |
static $type$ getAcquire(ByteBufferHandle handle, Object obb, int index) { |
|
48710 | 605 |
ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); |
36934 | 606 |
return convEndian(handle.be, |
607 |
UNSAFE.get$RawType$Acquire( |
|
52220
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
608 |
UNSAFE.getReference(bb, BYTE_BUFFER_HB), |
36934 | 609 |
address(bb, index(bb, index)))); |
610 |
} |
|
611 |
||
612 |
@ForceInline |
|
613 |
static void setRelease(ByteBufferHandle handle, Object obb, int index, $type$ value) { |
|
48710 | 614 |
ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); |
36934 | 615 |
UNSAFE.put$RawType$Release( |
52220
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
616 |
UNSAFE.getReference(bb, BYTE_BUFFER_HB), |
36934 | 617 |
address(bb, indexRO(bb, index)), |
618 |
convEndian(handle.be, value)); |
|
619 |
} |
|
620 |
||
621 |
@ForceInline |
|
622 |
static $type$ getOpaque(ByteBufferHandle handle, Object obb, int index) { |
|
48710 | 623 |
ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); |
36934 | 624 |
return convEndian(handle.be, |
625 |
UNSAFE.get$RawType$Opaque( |
|
52220
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
626 |
UNSAFE.getReference(bb, BYTE_BUFFER_HB), |
36934 | 627 |
address(bb, index(bb, index)))); |
628 |
} |
|
629 |
||
630 |
@ForceInline |
|
631 |
static void setOpaque(ByteBufferHandle handle, Object obb, int index, $type$ value) { |
|
48710 | 632 |
ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); |
36934 | 633 |
UNSAFE.put$RawType$Opaque( |
52220
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
634 |
UNSAFE.getReference(bb, BYTE_BUFFER_HB), |
36934 | 635 |
address(bb, indexRO(bb, index)), |
636 |
convEndian(handle.be, value)); |
|
637 |
} |
|
638 |
#if[CAS] |
|
639 |
||
640 |
@ForceInline |
|
641 |
static boolean compareAndSet(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) { |
|
48710 | 642 |
ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); |
52220
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
643 |
#if[Object] |
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
644 |
return UNSAFE.compareAndSetReference( |
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
645 |
UNSAFE.getReference(bb, BYTE_BUFFER_HB), |
36934 | 646 |
address(bb, indexRO(bb, index)), |
647 |
convEndian(handle.be, expected), convEndian(handle.be, value)); |
|
52220
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
648 |
#else[Object] |
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
649 |
return UNSAFE.compareAndSet$RawType$( |
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
650 |
UNSAFE.getReference(bb, BYTE_BUFFER_HB), |
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
651 |
address(bb, indexRO(bb, index)), |
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
652 |
convEndian(handle.be, expected), convEndian(handle.be, value)); |
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
653 |
#end[Object] |
36934 | 654 |
} |
655 |
||
656 |
@ForceInline |
|
39472
6df82f4c63ac
8154737: Rename VarHandle.compareAndExchangeVolatile to VarHandle.compareAndExchange
psandoz
parents:
38382
diff
changeset
|
657 |
static $type$ compareAndExchange(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) { |
48710 | 658 |
ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); |
36934 | 659 |
return convEndian(handle.be, |
45518
4a116dd82fb5
8181292: Backport Rename internal Unsafe.compare methods from 10 to 9
psandoz
parents:
40734
diff
changeset
|
660 |
UNSAFE.compareAndExchange$RawType$( |
52220
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
661 |
UNSAFE.getReference(bb, BYTE_BUFFER_HB), |
36934 | 662 |
address(bb, indexRO(bb, index)), |
663 |
convEndian(handle.be, expected), convEndian(handle.be, value))); |
|
664 |
} |
|
665 |
||
666 |
@ForceInline |
|
667 |
static $type$ compareAndExchangeAcquire(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) { |
|
48710 | 668 |
ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); |
36934 | 669 |
return convEndian(handle.be, |
670 |
UNSAFE.compareAndExchange$RawType$Acquire( |
|
52220
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
671 |
UNSAFE.getReference(bb, BYTE_BUFFER_HB), |
36934 | 672 |
address(bb, indexRO(bb, index)), |
673 |
convEndian(handle.be, expected), convEndian(handle.be, value))); |
|
674 |
} |
|
675 |
||
676 |
@ForceInline |
|
677 |
static $type$ compareAndExchangeRelease(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) { |
|
48710 | 678 |
ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); |
36934 | 679 |
return convEndian(handle.be, |
680 |
UNSAFE.compareAndExchange$RawType$Release( |
|
52220
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
681 |
UNSAFE.getReference(bb, BYTE_BUFFER_HB), |
36934 | 682 |
address(bb, indexRO(bb, index)), |
683 |
convEndian(handle.be, expected), convEndian(handle.be, value))); |
|
684 |
} |
|
685 |
||
686 |
@ForceInline |
|
40734
48879ea67e2a
8162108: Rename weakCompareAndSetVolatile to weakCompareAndSet
psandoz
parents:
40733
diff
changeset
|
687 |
static boolean weakCompareAndSetPlain(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) { |
48710 | 688 |
ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); |
45518
4a116dd82fb5
8181292: Backport Rename internal Unsafe.compare methods from 10 to 9
psandoz
parents:
40734
diff
changeset
|
689 |
return UNSAFE.weakCompareAndSet$RawType$Plain( |
52220
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
690 |
UNSAFE.getReference(bb, BYTE_BUFFER_HB), |
36934 | 691 |
address(bb, indexRO(bb, index)), |
692 |
convEndian(handle.be, expected), convEndian(handle.be, value)); |
|
693 |
} |
|
694 |
||
695 |
@ForceInline |
|
40734
48879ea67e2a
8162108: Rename weakCompareAndSetVolatile to weakCompareAndSet
psandoz
parents:
40733
diff
changeset
|
696 |
static boolean weakCompareAndSet(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) { |
48710 | 697 |
ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); |
45518
4a116dd82fb5
8181292: Backport Rename internal Unsafe.compare methods from 10 to 9
psandoz
parents:
40734
diff
changeset
|
698 |
return UNSAFE.weakCompareAndSet$RawType$( |
52220
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
699 |
UNSAFE.getReference(bb, BYTE_BUFFER_HB), |
37719
add11bc0e6e2
8154755: Add a VarHandle weakCompareAndSet with volatile semantics
psandoz
parents:
36934
diff
changeset
|
700 |
address(bb, indexRO(bb, index)), |
add11bc0e6e2
8154755: Add a VarHandle weakCompareAndSet with volatile semantics
psandoz
parents:
36934
diff
changeset
|
701 |
convEndian(handle.be, expected), convEndian(handle.be, value)); |
add11bc0e6e2
8154755: Add a VarHandle weakCompareAndSet with volatile semantics
psandoz
parents:
36934
diff
changeset
|
702 |
} |
add11bc0e6e2
8154755: Add a VarHandle weakCompareAndSet with volatile semantics
psandoz
parents:
36934
diff
changeset
|
703 |
|
add11bc0e6e2
8154755: Add a VarHandle weakCompareAndSet with volatile semantics
psandoz
parents:
36934
diff
changeset
|
704 |
@ForceInline |
36934 | 705 |
static boolean weakCompareAndSetAcquire(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) { |
48710 | 706 |
ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); |
45518
4a116dd82fb5
8181292: Backport Rename internal Unsafe.compare methods from 10 to 9
psandoz
parents:
40734
diff
changeset
|
707 |
return UNSAFE.weakCompareAndSet$RawType$Acquire( |
52220
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
708 |
UNSAFE.getReference(bb, BYTE_BUFFER_HB), |
36934 | 709 |
address(bb, indexRO(bb, index)), |
710 |
convEndian(handle.be, expected), convEndian(handle.be, value)); |
|
711 |
} |
|
712 |
||
713 |
@ForceInline |
|
714 |
static boolean weakCompareAndSetRelease(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) { |
|
48710 | 715 |
ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); |
45518
4a116dd82fb5
8181292: Backport Rename internal Unsafe.compare methods from 10 to 9
psandoz
parents:
40734
diff
changeset
|
716 |
return UNSAFE.weakCompareAndSet$RawType$Release( |
52220
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
717 |
UNSAFE.getReference(bb, BYTE_BUFFER_HB), |
36934 | 718 |
address(bb, indexRO(bb, index)), |
719 |
convEndian(handle.be, expected), convEndian(handle.be, value)); |
|
720 |
} |
|
721 |
||
722 |
@ForceInline |
|
723 |
static $type$ getAndSet(ByteBufferHandle handle, Object obb, int index, $type$ value) { |
|
48710 | 724 |
ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); |
52220
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
725 |
#if[Object] |
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
726 |
return convEndian(handle.be, |
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
727 |
UNSAFE.getAndSetReference( |
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
728 |
UNSAFE.getReference(bb, BYTE_BUFFER_HB), |
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
729 |
address(bb, indexRO(bb, index)), |
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
730 |
convEndian(handle.be, value))); |
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
731 |
#else[Object] |
36934 | 732 |
return convEndian(handle.be, |
733 |
UNSAFE.getAndSet$RawType$( |
|
52220
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
734 |
UNSAFE.getReference(bb, BYTE_BUFFER_HB), |
36934 | 735 |
address(bb, indexRO(bb, index)), |
736 |
convEndian(handle.be, value))); |
|
52220
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
737 |
#end[Object] |
36934 | 738 |
} |
40732
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
739 |
|
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
740 |
@ForceInline |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
741 |
static $type$ getAndSetAcquire(ByteBufferHandle handle, Object obb, int index, $type$ value) { |
48710 | 742 |
ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); |
40732
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
743 |
return convEndian(handle.be, |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
744 |
UNSAFE.getAndSet$RawType$Acquire( |
52220
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
745 |
UNSAFE.getReference(bb, BYTE_BUFFER_HB), |
40732
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
746 |
address(bb, indexRO(bb, index)), |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
747 |
convEndian(handle.be, value))); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
748 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
749 |
|
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
750 |
@ForceInline |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
751 |
static $type$ getAndSetRelease(ByteBufferHandle handle, Object obb, int index, $type$ value) { |
48710 | 752 |
ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); |
40732
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
753 |
return convEndian(handle.be, |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
754 |
UNSAFE.getAndSet$RawType$Release( |
52220
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
755 |
UNSAFE.getReference(bb, BYTE_BUFFER_HB), |
40732
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
756 |
address(bb, indexRO(bb, index)), |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
757 |
convEndian(handle.be, value))); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
758 |
} |
36934 | 759 |
#end[CAS] |
760 |
#if[AtomicAdd] |
|
761 |
||
762 |
@ForceInline |
|
38382
98d5a441bc2f
8157152: Atomic add for VarHandle byte[]/ByteBuffer views is incorrect for endian conversion
psandoz
parents:
38372
diff
changeset
|
763 |
static $type$ getAndAdd(ByteBufferHandle handle, Object obb, int index, $type$ delta) { |
48710 | 764 |
ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); |
38382
98d5a441bc2f
8157152: Atomic add for VarHandle byte[]/ByteBuffer views is incorrect for endian conversion
psandoz
parents:
38372
diff
changeset
|
765 |
if (handle.be == BE) { |
98d5a441bc2f
8157152: Atomic add for VarHandle byte[]/ByteBuffer views is incorrect for endian conversion
psandoz
parents:
38372
diff
changeset
|
766 |
return UNSAFE.getAndAdd$RawType$( |
52220
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
767 |
UNSAFE.getReference(bb, BYTE_BUFFER_HB), |
38382
98d5a441bc2f
8157152: Atomic add for VarHandle byte[]/ByteBuffer views is incorrect for endian conversion
psandoz
parents:
38372
diff
changeset
|
768 |
address(bb, indexRO(bb, index)), |
98d5a441bc2f
8157152: Atomic add for VarHandle byte[]/ByteBuffer views is incorrect for endian conversion
psandoz
parents:
38372
diff
changeset
|
769 |
delta); |
98d5a441bc2f
8157152: Atomic add for VarHandle byte[]/ByteBuffer views is incorrect for endian conversion
psandoz
parents:
38372
diff
changeset
|
770 |
} else { |
98d5a441bc2f
8157152: Atomic add for VarHandle byte[]/ByteBuffer views is incorrect for endian conversion
psandoz
parents:
38372
diff
changeset
|
771 |
return getAndAddConvEndianWithCAS(bb, index, delta); |
98d5a441bc2f
8157152: Atomic add for VarHandle byte[]/ByteBuffer views is incorrect for endian conversion
psandoz
parents:
38372
diff
changeset
|
772 |
} |
36934 | 773 |
} |
774 |
||
775 |
@ForceInline |
|
40732
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
776 |
static $type$ getAndAddAcquire(ByteBufferHandle handle, Object obb, int index, $type$ delta) { |
48710 | 777 |
ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); |
40732
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
778 |
if (handle.be == BE) { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
779 |
return UNSAFE.getAndAdd$RawType$Acquire( |
52220
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
780 |
UNSAFE.getReference(bb, BYTE_BUFFER_HB), |
40732
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
781 |
address(bb, indexRO(bb, index)), |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
782 |
delta); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
783 |
} else { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
784 |
return getAndAddConvEndianWithCAS(bb, index, delta); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
785 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
786 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
787 |
|
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
788 |
@ForceInline |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
789 |
static $type$ getAndAddRelease(ByteBufferHandle handle, Object obb, int index, $type$ delta) { |
48710 | 790 |
ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); |
40732
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
791 |
if (handle.be == BE) { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
792 |
return UNSAFE.getAndAdd$RawType$Release( |
52220
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
793 |
UNSAFE.getReference(bb, BYTE_BUFFER_HB), |
40732
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
794 |
address(bb, indexRO(bb, index)), |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
795 |
delta); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
796 |
} else { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
797 |
return getAndAddConvEndianWithCAS(bb, index, delta); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
798 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
799 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
800 |
|
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
801 |
@ForceInline |
38382
98d5a441bc2f
8157152: Atomic add for VarHandle byte[]/ByteBuffer views is incorrect for endian conversion
psandoz
parents:
38372
diff
changeset
|
802 |
static $type$ getAndAddConvEndianWithCAS(ByteBuffer bb, int index, $type$ delta) { |
98d5a441bc2f
8157152: Atomic add for VarHandle byte[]/ByteBuffer views is incorrect for endian conversion
psandoz
parents:
38372
diff
changeset
|
803 |
$type$ nativeExpectedValue, expectedValue; |
52220
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
804 |
Object base = UNSAFE.getReference(bb, BYTE_BUFFER_HB); |
38382
98d5a441bc2f
8157152: Atomic add for VarHandle byte[]/ByteBuffer views is incorrect for endian conversion
psandoz
parents:
38372
diff
changeset
|
805 |
long offset = address(bb, indexRO(bb, index)); |
98d5a441bc2f
8157152: Atomic add for VarHandle byte[]/ByteBuffer views is incorrect for endian conversion
psandoz
parents:
38372
diff
changeset
|
806 |
do { |
98d5a441bc2f
8157152: Atomic add for VarHandle byte[]/ByteBuffer views is incorrect for endian conversion
psandoz
parents:
38372
diff
changeset
|
807 |
nativeExpectedValue = UNSAFE.get$RawType$Volatile(base, offset); |
98d5a441bc2f
8157152: Atomic add for VarHandle byte[]/ByteBuffer views is incorrect for endian conversion
psandoz
parents:
38372
diff
changeset
|
808 |
expectedValue = $RawBoxType$.reverseBytes(nativeExpectedValue); |
45518
4a116dd82fb5
8181292: Backport Rename internal Unsafe.compare methods from 10 to 9
psandoz
parents:
40734
diff
changeset
|
809 |
} while (!UNSAFE.weakCompareAndSet$RawType$(base, offset, |
38382
98d5a441bc2f
8157152: Atomic add for VarHandle byte[]/ByteBuffer views is incorrect for endian conversion
psandoz
parents:
38372
diff
changeset
|
810 |
nativeExpectedValue, $RawBoxType$.reverseBytes(expectedValue + delta))); |
98d5a441bc2f
8157152: Atomic add for VarHandle byte[]/ByteBuffer views is incorrect for endian conversion
psandoz
parents:
38372
diff
changeset
|
811 |
return expectedValue; |
98d5a441bc2f
8157152: Atomic add for VarHandle byte[]/ByteBuffer views is incorrect for endian conversion
psandoz
parents:
38372
diff
changeset
|
812 |
} |
36934 | 813 |
#end[AtomicAdd] |
40732
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
814 |
#if[Bitwise] |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
815 |
|
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
816 |
@ForceInline |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
817 |
static $type$ getAndBitwiseOr(ByteBufferHandle handle, Object obb, int index, $type$ value) { |
48710 | 818 |
ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); |
40732
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
819 |
if (handle.be == BE) { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
820 |
return UNSAFE.getAndBitwiseOr$RawType$( |
52220
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
821 |
UNSAFE.getReference(bb, BYTE_BUFFER_HB), |
40732
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
822 |
address(bb, indexRO(bb, index)), |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
823 |
value); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
824 |
} else { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
825 |
return getAndBitwiseOrConvEndianWithCAS(bb, index, value); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
826 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
827 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
828 |
|
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
829 |
@ForceInline |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
830 |
static $type$ getAndBitwiseOrRelease(ByteBufferHandle handle, Object obb, int index, $type$ value) { |
48710 | 831 |
ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); |
40732
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
832 |
if (handle.be == BE) { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
833 |
return UNSAFE.getAndBitwiseOr$RawType$Release( |
52220
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
834 |
UNSAFE.getReference(bb, BYTE_BUFFER_HB), |
40732
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
835 |
address(bb, indexRO(bb, index)), |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
836 |
value); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
837 |
} else { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
838 |
return getAndBitwiseOrConvEndianWithCAS(bb, index, value); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
839 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
840 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
841 |
|
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
842 |
@ForceInline |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
843 |
static $type$ getAndBitwiseOrAcquire(ByteBufferHandle handle, Object obb, int index, $type$ value) { |
48710 | 844 |
ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); |
40732
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
845 |
if (handle.be == BE) { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
846 |
return UNSAFE.getAndBitwiseOr$RawType$Acquire( |
52220
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
847 |
UNSAFE.getReference(bb, BYTE_BUFFER_HB), |
40732
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
848 |
address(bb, indexRO(bb, index)), |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
849 |
value); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
850 |
} else { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
851 |
return getAndBitwiseOrConvEndianWithCAS(bb, index, value); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
852 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
853 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
854 |
|
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
855 |
@ForceInline |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
856 |
static $type$ getAndBitwiseOrConvEndianWithCAS(ByteBuffer bb, int index, $type$ value) { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
857 |
$type$ nativeExpectedValue, expectedValue; |
52220
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
858 |
Object base = UNSAFE.getReference(bb, BYTE_BUFFER_HB); |
40732
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
859 |
long offset = address(bb, indexRO(bb, index)); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
860 |
do { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
861 |
nativeExpectedValue = UNSAFE.get$RawType$Volatile(base, offset); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
862 |
expectedValue = $RawBoxType$.reverseBytes(nativeExpectedValue); |
45518
4a116dd82fb5
8181292: Backport Rename internal Unsafe.compare methods from 10 to 9
psandoz
parents:
40734
diff
changeset
|
863 |
} while (!UNSAFE.weakCompareAndSet$RawType$(base, offset, |
40732
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
864 |
nativeExpectedValue, $RawBoxType$.reverseBytes(expectedValue | value))); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
865 |
return expectedValue; |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
866 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
867 |
|
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
868 |
@ForceInline |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
869 |
static $type$ getAndBitwiseAnd(ByteBufferHandle handle, Object obb, int index, $type$ value) { |
48710 | 870 |
ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); |
40732
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
871 |
if (handle.be == BE) { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
872 |
return UNSAFE.getAndBitwiseAnd$RawType$( |
52220
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
873 |
UNSAFE.getReference(bb, BYTE_BUFFER_HB), |
40732
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
874 |
address(bb, indexRO(bb, index)), |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
875 |
value); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
876 |
} else { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
877 |
return getAndBitwiseAndConvEndianWithCAS(bb, index, value); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
878 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
879 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
880 |
|
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
881 |
@ForceInline |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
882 |
static $type$ getAndBitwiseAndRelease(ByteBufferHandle handle, Object obb, int index, $type$ value) { |
48710 | 883 |
ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); |
40732
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
884 |
if (handle.be == BE) { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
885 |
return UNSAFE.getAndBitwiseAnd$RawType$Release( |
52220
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
886 |
UNSAFE.getReference(bb, BYTE_BUFFER_HB), |
40732
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
887 |
address(bb, indexRO(bb, index)), |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
888 |
value); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
889 |
} else { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
890 |
return getAndBitwiseAndConvEndianWithCAS(bb, index, value); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
891 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
892 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
893 |
|
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
894 |
@ForceInline |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
895 |
static $type$ getAndBitwiseAndAcquire(ByteBufferHandle handle, Object obb, int index, $type$ value) { |
48710 | 896 |
ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); |
40732
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
897 |
if (handle.be == BE) { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
898 |
return UNSAFE.getAndBitwiseAnd$RawType$Acquire( |
52220
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
899 |
UNSAFE.getReference(bb, BYTE_BUFFER_HB), |
40732
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
900 |
address(bb, indexRO(bb, index)), |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
901 |
value); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
902 |
} else { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
903 |
return getAndBitwiseAndConvEndianWithCAS(bb, index, value); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
904 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
905 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
906 |
|
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
907 |
@ForceInline |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
908 |
static $type$ getAndBitwiseAndConvEndianWithCAS(ByteBuffer bb, int index, $type$ value) { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
909 |
$type$ nativeExpectedValue, expectedValue; |
52220
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
910 |
Object base = UNSAFE.getReference(bb, BYTE_BUFFER_HB); |
40732
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
911 |
long offset = address(bb, indexRO(bb, index)); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
912 |
do { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
913 |
nativeExpectedValue = UNSAFE.get$RawType$Volatile(base, offset); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
914 |
expectedValue = $RawBoxType$.reverseBytes(nativeExpectedValue); |
45518
4a116dd82fb5
8181292: Backport Rename internal Unsafe.compare methods from 10 to 9
psandoz
parents:
40734
diff
changeset
|
915 |
} while (!UNSAFE.weakCompareAndSet$RawType$(base, offset, |
40732
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
916 |
nativeExpectedValue, $RawBoxType$.reverseBytes(expectedValue & value))); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
917 |
return expectedValue; |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
918 |
} |
45518
4a116dd82fb5
8181292: Backport Rename internal Unsafe.compare methods from 10 to 9
psandoz
parents:
40734
diff
changeset
|
919 |
|
4a116dd82fb5
8181292: Backport Rename internal Unsafe.compare methods from 10 to 9
psandoz
parents:
40734
diff
changeset
|
920 |
|
40732
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
921 |
@ForceInline |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
922 |
static $type$ getAndBitwiseXor(ByteBufferHandle handle, Object obb, int index, $type$ value) { |
48710 | 923 |
ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); |
40732
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
924 |
if (handle.be == BE) { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
925 |
return UNSAFE.getAndBitwiseXor$RawType$( |
52220
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
926 |
UNSAFE.getReference(bb, BYTE_BUFFER_HB), |
40732
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
927 |
address(bb, indexRO(bb, index)), |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
928 |
value); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
929 |
} else { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
930 |
return getAndBitwiseXorConvEndianWithCAS(bb, index, value); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
931 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
932 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
933 |
|
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
934 |
@ForceInline |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
935 |
static $type$ getAndBitwiseXorRelease(ByteBufferHandle handle, Object obb, int index, $type$ value) { |
48710 | 936 |
ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); |
40732
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
937 |
if (handle.be == BE) { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
938 |
return UNSAFE.getAndBitwiseXor$RawType$Release( |
52220
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
939 |
UNSAFE.getReference(bb, BYTE_BUFFER_HB), |
40732
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
940 |
address(bb, indexRO(bb, index)), |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
941 |
value); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
942 |
} else { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
943 |
return getAndBitwiseXorConvEndianWithCAS(bb, index, value); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
944 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
945 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
946 |
|
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
947 |
@ForceInline |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
948 |
static $type$ getAndBitwiseXorAcquire(ByteBufferHandle handle, Object obb, int index, $type$ value) { |
48710 | 949 |
ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb); |
40732
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
950 |
if (handle.be == BE) { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
951 |
return UNSAFE.getAndBitwiseXor$RawType$Acquire( |
52220
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
952 |
UNSAFE.getReference(bb, BYTE_BUFFER_HB), |
40732
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
953 |
address(bb, indexRO(bb, index)), |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
954 |
value); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
955 |
} else { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
956 |
return getAndBitwiseXorConvEndianWithCAS(bb, index, value); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
957 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
958 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
959 |
|
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
960 |
@ForceInline |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
961 |
static $type$ getAndBitwiseXorConvEndianWithCAS(ByteBuffer bb, int index, $type$ value) { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
962 |
$type$ nativeExpectedValue, expectedValue; |
52220
9c260a6b6471
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
mchung
parents:
48710
diff
changeset
|
963 |
Object base = UNSAFE.getReference(bb, BYTE_BUFFER_HB); |
40732
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
964 |
long offset = address(bb, indexRO(bb, index)); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
965 |
do { |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
966 |
nativeExpectedValue = UNSAFE.get$RawType$Volatile(base, offset); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
967 |
expectedValue = $RawBoxType$.reverseBytes(nativeExpectedValue); |
45518
4a116dd82fb5
8181292: Backport Rename internal Unsafe.compare methods from 10 to 9
psandoz
parents:
40734
diff
changeset
|
968 |
} while (!UNSAFE.weakCompareAndSet$RawType$(base, offset, |
40732
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
969 |
nativeExpectedValue, $RawBoxType$.reverseBytes(expectedValue ^ value))); |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
970 |
return expectedValue; |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
971 |
} |
2fd9cf42bb3c
8161444: VarHandles should provide access bitwise atomics
psandoz
parents:
39472
diff
changeset
|
972 |
#end[Bitwise] |
37792 | 973 |
|
974 |
static final VarForm FORM = new VarForm(ByteBufferHandle.class, ByteBuffer.class, $type$.class, int.class); |
|
36934 | 975 |
} |
976 |
} |