8327729: Remove deprecated xxxObject methods from jdk.internal.misc.Unsafe
Reviewed-by: martin, alanb, mchung
This commit is contained in:
parent
313e814bc9
commit
5b41466275
src/java.base/share/classes
test/hotspot/jtreg
compiler/stable
gc/shenandoah/compiler
@ -61,7 +61,7 @@ public class BufferedInputStream extends FilterInputStream {
|
||||
|
||||
/**
|
||||
* As this class is used early during bootstrap, it's motivated to use
|
||||
* Unsafe.compareAndSetObject instead of AtomicReferenceFieldUpdater
|
||||
* Unsafe.compareAndSetReference instead of AtomicReferenceFieldUpdater
|
||||
* (or VarHandles) to reduce dependencies and improve startup time.
|
||||
*/
|
||||
private static final Unsafe U = Unsafe.getUnsafe();
|
||||
|
@ -3861,91 +3861,4 @@ public final class Unsafe {
|
||||
cleaner.clean();
|
||||
}
|
||||
}
|
||||
|
||||
// The following deprecated methods are used by JSR 166.
|
||||
|
||||
@Deprecated(since="12", forRemoval=true)
|
||||
public final Object getObject(Object o, long offset) {
|
||||
return getReference(o, offset);
|
||||
}
|
||||
@Deprecated(since="12", forRemoval=true)
|
||||
public final Object getObjectVolatile(Object o, long offset) {
|
||||
return getReferenceVolatile(o, offset);
|
||||
}
|
||||
@Deprecated(since="12", forRemoval=true)
|
||||
public final Object getObjectAcquire(Object o, long offset) {
|
||||
return getReferenceAcquire(o, offset);
|
||||
}
|
||||
@Deprecated(since="12", forRemoval=true)
|
||||
public final Object getObjectOpaque(Object o, long offset) {
|
||||
return getReferenceOpaque(o, offset);
|
||||
}
|
||||
|
||||
|
||||
@Deprecated(since="12", forRemoval=true)
|
||||
public final void putObject(Object o, long offset, Object x) {
|
||||
putReference(o, offset, x);
|
||||
}
|
||||
@Deprecated(since="12", forRemoval=true)
|
||||
public final void putObjectVolatile(Object o, long offset, Object x) {
|
||||
putReferenceVolatile(o, offset, x);
|
||||
}
|
||||
@Deprecated(since="12", forRemoval=true)
|
||||
public final void putObjectOpaque(Object o, long offset, Object x) {
|
||||
putReferenceOpaque(o, offset, x);
|
||||
}
|
||||
@Deprecated(since="12", forRemoval=true)
|
||||
public final void putObjectRelease(Object o, long offset, Object x) {
|
||||
putReferenceRelease(o, offset, x);
|
||||
}
|
||||
|
||||
|
||||
@Deprecated(since="12", forRemoval=true)
|
||||
public final Object getAndSetObject(Object o, long offset, Object newValue) {
|
||||
return getAndSetReference(o, offset, newValue);
|
||||
}
|
||||
@Deprecated(since="12", forRemoval=true)
|
||||
public final Object getAndSetObjectAcquire(Object o, long offset, Object newValue) {
|
||||
return getAndSetReferenceAcquire(o, offset, newValue);
|
||||
}
|
||||
@Deprecated(since="12", forRemoval=true)
|
||||
public final Object getAndSetObjectRelease(Object o, long offset, Object newValue) {
|
||||
return getAndSetReferenceRelease(o, offset, newValue);
|
||||
}
|
||||
|
||||
|
||||
@Deprecated(since="12", forRemoval=true)
|
||||
public final boolean compareAndSetObject(Object o, long offset, Object expected, Object x) {
|
||||
return compareAndSetReference(o, offset, expected, x);
|
||||
}
|
||||
@Deprecated(since="12", forRemoval=true)
|
||||
public final Object compareAndExchangeObject(Object o, long offset, Object expected, Object x) {
|
||||
return compareAndExchangeReference(o, offset, expected, x);
|
||||
}
|
||||
@Deprecated(since="12", forRemoval=true)
|
||||
public final Object compareAndExchangeObjectAcquire(Object o, long offset, Object expected, Object x) {
|
||||
return compareAndExchangeReferenceAcquire(o, offset, expected, x);
|
||||
}
|
||||
@Deprecated(since="12", forRemoval=true)
|
||||
public final Object compareAndExchangeObjectRelease(Object o, long offset, Object expected, Object x) {
|
||||
return compareAndExchangeReferenceRelease(o, offset, expected, x);
|
||||
}
|
||||
|
||||
|
||||
@Deprecated(since="12", forRemoval=true)
|
||||
public final boolean weakCompareAndSetObject(Object o, long offset, Object expected, Object x) {
|
||||
return weakCompareAndSetReference(o, offset, expected, x);
|
||||
}
|
||||
@Deprecated(since="12", forRemoval=true)
|
||||
public final boolean weakCompareAndSetObjectAcquire(Object o, long offset, Object expected, Object x) {
|
||||
return weakCompareAndSetReferenceAcquire(o, offset, expected, x);
|
||||
}
|
||||
@Deprecated(since="12", forRemoval=true)
|
||||
public final boolean weakCompareAndSetObjectPlain(Object o, long offset, Object expected, Object x) {
|
||||
return weakCompareAndSetReferencePlain(o, offset, expected, x);
|
||||
}
|
||||
@Deprecated(since="12", forRemoval=true)
|
||||
public final boolean weakCompareAndSetObjectRelease(Object o, long offset, Object expected, Object x) {
|
||||
return weakCompareAndSetReferenceRelease(o, offset, expected, x);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -89,9 +89,9 @@ public class TestUnstableStable {
|
||||
stableArray1[0][0] = null;
|
||||
stableArray1[0][0] = 42;
|
||||
stableArray1[0][0] = 43;
|
||||
U.putObject(TestUnstableStable.class, FIELD_OFFSET, null);
|
||||
U.putObject(TestUnstableStable.class, FIELD_OFFSET, 42);
|
||||
U.putObject(TestUnstableStable.class, FIELD_OFFSET, 43);
|
||||
U.putReference(TestUnstableStable.class, FIELD_OFFSET, null);
|
||||
U.putReference(TestUnstableStable.class, FIELD_OFFSET, 42);
|
||||
U.putReference(TestUnstableStable.class, FIELD_OFFSET, 43);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ public class TestUnsafeLoadStoreMergedHeapStableTests {
|
||||
|
||||
static Object testHelper(boolean flag, Object o, long offset, Object x) {
|
||||
if (flag) {
|
||||
return UNSAFE.getAndSetObject(o, offset, x);
|
||||
return UNSAFE.getAndSetReference(o, offset, x);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -68,7 +68,7 @@ public class TestUnsafeLoadStoreMergedHeapStableTests {
|
||||
}
|
||||
|
||||
static Object test2(Object o, long offset) {
|
||||
return UNSAFE.getAndSetObject(o, offset, field);
|
||||
return UNSAFE.getAndSetReference(o, offset, field);
|
||||
}
|
||||
|
||||
static public void main(String[] args) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user