mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
8207146: Rename jdk.internal.misc.Unsafe::xxxObject to xxxReference
Reviewed-by: dholmes, thartmann
This commit is contained in:
parent
fd8d1cd6bf
commit
5e6d6b8642
70 changed files with 643 additions and 603 deletions
|
@ -238,7 +238,7 @@ class BufferedInputStream extends FilterInputStream {
|
|||
nsz = marklimit;
|
||||
byte[] nbuf = new byte[nsz];
|
||||
System.arraycopy(buffer, 0, nbuf, 0, pos);
|
||||
if (!U.compareAndSetObject(this, BUF_OFFSET, buffer, nbuf)) {
|
||||
if (!U.compareAndSetReference(this, BUF_OFFSET, buffer, nbuf)) {
|
||||
// Can't replace buf if there was an async close.
|
||||
// Note: This would need to be changed if fill()
|
||||
// is ever made accessible to multiple threads.
|
||||
|
@ -482,7 +482,7 @@ class BufferedInputStream extends FilterInputStream {
|
|||
public void close() throws IOException {
|
||||
byte[] buffer;
|
||||
while ( (buffer = buf) != null) {
|
||||
if (U.compareAndSetObject(this, BUF_OFFSET, buffer, null)) {
|
||||
if (U.compareAndSetReference(this, BUF_OFFSET, buffer, null)) {
|
||||
InputStream input = in;
|
||||
in = null;
|
||||
if (input != null)
|
||||
|
|
|
@ -2237,7 +2237,7 @@ public class File
|
|||
if (sep != separatorChar)
|
||||
pathField = pathField.replace(sep, separatorChar);
|
||||
String path = fs.normalize(pathField);
|
||||
UNSAFE.putObject(this, PATH_OFFSET, path);
|
||||
UNSAFE.putReference(this, PATH_OFFSET, path);
|
||||
UNSAFE.putIntVolatile(this, PREFIX_LENGTH_OFFSET, fs.prefixLength(path));
|
||||
}
|
||||
|
||||
|
|
|
@ -2135,7 +2135,7 @@ public class ObjectStreamClass implements Serializable {
|
|||
switch (typeCodes[i]) {
|
||||
case 'L':
|
||||
case '[':
|
||||
vals[offsets[i]] = unsafe.getObject(obj, readKeys[i]);
|
||||
vals[offsets[i]] = unsafe.getReference(obj, readKeys[i]);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -2190,7 +2190,7 @@ public class ObjectStreamClass implements Serializable {
|
|||
obj.getClass().getName());
|
||||
}
|
||||
if (!dryRun)
|
||||
unsafe.putObject(obj, key, val);
|
||||
unsafe.putReference(obj, key, val);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue