diff src/hotspot/share/oops/access.inline.hpp @ 50389:7e8c0409a747

8198285: More consistent Access API for arraycopy Reviewed-by: eosterlund, shade
author rkennke
date Mon, 04 Jun 2018 23:01:48 +0200
parents 8237a91c1cca
children b1c6d4d7f801
line wrap: on
line diff
--- a/src/hotspot/share/oops/access.inline.hpp	Mon Jun 04 22:03:10 2018 +0200
+++ b/src/hotspot/share/oops/access.inline.hpp	Mon Jun 04 23:01:48 2018 +0200
@@ -123,17 +123,23 @@
   template <class GCBarrierType, DecoratorSet decorators>
   struct PostRuntimeDispatch<GCBarrierType, BARRIER_ARRAYCOPY, decorators>: public AllStatic {
     template <typename T>
-    static bool access_barrier(arrayOop src_obj, arrayOop dst_obj, T* src, T* dst, size_t length) {
-      GCBarrierType::arraycopy_in_heap(src_obj, dst_obj, src, dst, length);
+    static bool access_barrier(arrayOop src_obj, size_t src_offset_in_bytes, T* src_raw,
+                               arrayOop dst_obj, size_t dst_offset_in_bytes, T* dst_raw,
+                               size_t length) {
+      GCBarrierType::arraycopy_in_heap(src_obj, src_offset_in_bytes, src_raw,
+                                       dst_obj, dst_offset_in_bytes, dst_raw,
+                                       length);
       return true;
     }
 
     template <typename T>
-    static bool oop_access_barrier(arrayOop src_obj, arrayOop dst_obj, T* src, T* dst, size_t length) {
+    static bool oop_access_barrier(arrayOop src_obj, size_t src_offset_in_bytes, T* src_raw,
+                                   arrayOop dst_obj, size_t dst_offset_in_bytes, T* dst_raw,
+                                   size_t length) {
       typedef typename HeapOopType<decorators>::type OopType;
-      return GCBarrierType::oop_arraycopy_in_heap(src_obj, dst_obj,
-                                                  reinterpret_cast<OopType*>(src),
-                                                  reinterpret_cast<OopType*>(dst), length);
+      return GCBarrierType::oop_arraycopy_in_heap(src_obj, src_offset_in_bytes, reinterpret_cast<OopType*>(src_raw),
+                                                  dst_obj, dst_offset_in_bytes, reinterpret_cast<OopType*>(dst_raw),
+                                                  length);
     }
   };
 
@@ -337,10 +343,14 @@
   }
 
   template <DecoratorSet decorators, typename T>
-  bool RuntimeDispatch<decorators, T, BARRIER_ARRAYCOPY>::arraycopy_init(arrayOop src_obj, arrayOop dst_obj, T *src, T* dst, size_t length) {
+  bool RuntimeDispatch<decorators, T, BARRIER_ARRAYCOPY>::arraycopy_init(arrayOop src_obj, size_t src_offset_in_bytes, T* src_raw,
+                                                                         arrayOop dst_obj, size_t dst_offset_in_bytes, T* dst_raw,
+                                                                         size_t length) {
     func_t function = BarrierResolver<decorators, func_t, BARRIER_ARRAYCOPY>::resolve_barrier();
     _arraycopy_func = function;
-    return function(src_obj, dst_obj, src, dst, length);
+    return function(src_obj, src_offset_in_bytes, src_raw,
+                    dst_obj, dst_offset_in_bytes, dst_raw,
+                    length);
   }
 
   template <DecoratorSet decorators, typename T>