changeset 14483:c11a9bfd9c2f

8155965: Unsafe.weakCompareAndSetVolatile entry points and intrinsics Reviewed-by: psandoz, vlivanov
author shade
date Fri, 06 May 2016 17:59:49 +0300
parents cbd0fd67b328
children 72b2e58a1ac4
files src/java.base/share/classes/jdk/internal/misc/Unsafe.java
diffstat 1 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/share/classes/jdk/internal/misc/Unsafe.java	Thu May 05 18:14:47 2016 -0700
+++ b/src/java.base/share/classes/jdk/internal/misc/Unsafe.java	Fri May 06 17:59:49 2016 +0300
@@ -1271,6 +1271,13 @@
         return compareAndSwapObject(o, offset, expected, x);
     }
 
+    @HotSpotIntrinsicCandidate
+    public final boolean weakCompareAndSwapObjectVolatile(Object o, long offset,
+                                                                Object expected,
+                                                                Object x) {
+        return compareAndSwapObject(o, offset, expected, x);
+    }
+
     /**
      * Atomically updates Java variable to {@code x} if it is currently
      * holding {@code expected}.
@@ -1325,6 +1332,13 @@
         return compareAndSwapInt(o, offset, expected, x);
     }
 
+    @HotSpotIntrinsicCandidate
+    public final boolean weakCompareAndSwapIntVolatile(Object o, long offset,
+                                                             int expected,
+                                                             int x) {
+        return compareAndSwapInt(o, offset, expected, x);
+    }
+
     /**
      * Atomically updates Java variable to {@code x} if it is currently
      * holding {@code expected}.
@@ -1379,6 +1393,13 @@
         return compareAndSwapLong(o, offset, expected, x);
     }
 
+    @HotSpotIntrinsicCandidate
+    public final boolean weakCompareAndSwapLongVolatile(Object o, long offset,
+                                                              long expected,
+                                                              long x) {
+        return compareAndSwapLong(o, offset, expected, x);
+    }
+
     /**
      * Fetches a reference value from a given Java variable, with volatile
      * load semantics. Otherwise identical to {@link #getObject(Object, long)}