< prev index next >

src/hotspot/share/oops/access.hpp

Print this page
rev 49275 : [mq]: JDK-8199781.patch

@@ -54,11 +54,11 @@
 // * atomic_xchg: Atomically swap a new value at an address if previous value matched the compared value.
 // * atomic_xchg_at: Atomically swap a new value at an internal pointer address if previous value matched the compared value.
 // * arraycopy: Copy data from one heap array to another heap array.
 // * clone: Clone the contents of an object to a newly allocated object.
 // * resolve: Resolve a stable to-space invariant oop that is guaranteed not to relocate its payload until a subsequent thread transition.
-
+// * equals: Object equality, e.g. when different copies of the same objects are in use (from-space vs. to-space)
 typedef uint64_t DecoratorSet;
 
 // == Internal Decorators - do not use ==
 // * INTERNAL_EMPTY: This is the name for the empty decorator set (in absence of other decorators).
 // * INTERNAL_CONVERT_COMPRESSED_OOPS: This is an oop access that will require converting an oop

@@ -302,10 +302,13 @@
   void clone(oop src, oop dst, size_t size);
 
   template <DecoratorSet decorators>
   oop resolve(oop src);
 
+  template <DecoratorSet decorators>
+  bool equals(oop o1, oop o2);
+
   // Infer the type that should be returned from a load.
   template <typename P, DecoratorSet decorators>
   class LoadProxy: public StackObj {
   private:
     P *const _addr;

@@ -510,10 +513,15 @@
 
   static oop resolve(oop obj) {
     verify_decorators<INTERNAL_EMPTY>();
     return AccessInternal::resolve<decorators>(obj);
   }
+
+  static bool equals(oop o1, oop o2) {
+    verify_decorators<INTERNAL_EMPTY>();
+    return AccessInternal::equals<decorators>(o1, o2);
+  }
 };
 
 // Helper for performing raw accesses (knows only of memory ordering
 // atomicity decorators as well as compressed oops)
 template <DecoratorSet decorators = INTERNAL_EMPTY>
< prev index next >