src/hotspot/share/oops/accessBackend.inline.hpp
changeset 49383 bf2ff45e592f
parent 48628 69d65d9dcadb
child 49454 689ebcfe04fd
--- a/src/hotspot/share/oops/accessBackend.inline.hpp	Wed Mar 14 00:30:56 2018 +0900
+++ b/src/hotspot/share/oops/accessBackend.inline.hpp	Tue Mar 13 17:13:35 2018 +0100
@@ -118,7 +118,7 @@
 template <DecoratorSet decorators>
 template <typename T>
 inline bool RawAccessBarrier<decorators>::oop_arraycopy(arrayOop src_obj, arrayOop dst_obj, T* src, T* dst, size_t length) {
-  return arraycopy(src, dst, length);
+  return arraycopy(src_obj, dst_obj, src, dst, length);
 }
 
 template <DecoratorSet decorators>
@@ -257,7 +257,7 @@
   template <DecoratorSet decorators, typename T>
   static inline typename EnableIf<
   HasDecorator<decorators, INTERNAL_VALUE_IS_OOP>::value>::type
-  arraycopy(T* src, T* dst, size_t length) {
+  arraycopy(arrayOop src_obj, arrayOop dst_obj, T* src, T* dst, size_t length) {
     // We do not check for ARRAYCOPY_ATOMIC for oops, because they are unconditionally always atomic.
     if (HasDecorator<decorators, ARRAYCOPY_ARRAYOF>::value) {
       AccessInternal::arraycopy_arrayof_conjoint_oops(src, dst, length);
@@ -271,7 +271,7 @@
   template <DecoratorSet decorators, typename T>
   static inline typename EnableIf<
     !HasDecorator<decorators, INTERNAL_VALUE_IS_OOP>::value>::type
-  arraycopy(T* src, T* dst, size_t length) {
+  arraycopy(arrayOop src_obj, arrayOop dst_obj, T* src, T* dst, size_t length) {
     if (HasDecorator<decorators, ARRAYCOPY_ARRAYOF>::value) {
       AccessInternal::arraycopy_arrayof_conjoint(src, dst, length);
     } else if (HasDecorator<decorators, ARRAYCOPY_DISJOINT>::value && sizeof(T) == HeapWordSize) {
@@ -289,12 +289,23 @@
       }
     }
   }
+
+  template <DecoratorSet decorators>
+  static inline typename EnableIf<
+    !HasDecorator<decorators, INTERNAL_VALUE_IS_OOP>::value>::type
+  arraycopy(arrayOop src_obj, arrayOop dst_obj, void* src, void* dst, size_t length) {
+    if (HasDecorator<decorators, ARRAYCOPY_ATOMIC>::value) {
+      AccessInternal::arraycopy_conjoint_atomic(src, dst, length);
+    } else {
+      AccessInternal::arraycopy_conjoint(src, dst, length);
+    }
+  }
 };
 
 template <DecoratorSet decorators>
 template <typename T>
-inline bool RawAccessBarrier<decorators>::arraycopy(T* src, T* dst, size_t length) {
-  RawAccessBarrierArrayCopy::arraycopy<decorators>(src, dst, length);
+inline bool RawAccessBarrier<decorators>::arraycopy(arrayOop src_obj, arrayOop dst_obj, T* src, T* dst, size_t length) {
+  RawAccessBarrierArrayCopy::arraycopy<decorators>(src_obj, dst_obj, src, dst, length);
   return true;
 }