annotate 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
rev   line source
eosterlund@47998 1 /*
eosterlund@48628 2 * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
eosterlund@47998 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
eosterlund@47998 4 *
eosterlund@47998 5 * This code is free software; you can redistribute it and/or modify it
eosterlund@47998 6 * under the terms of the GNU General Public License version 2 only, as
eosterlund@47998 7 * published by the Free Software Foundation.
eosterlund@47998 8 *
eosterlund@47998 9 * This code is distributed in the hope that it will be useful, but WITHOUT
eosterlund@47998 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
eosterlund@47998 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
eosterlund@47998 12 * version 2 for more details (a copy is included in the LICENSE file that
eosterlund@47998 13 * accompanied this code).
eosterlund@47998 14 *
eosterlund@47998 15 * You should have received a copy of the GNU General Public License version
eosterlund@47998 16 * 2 along with this work; if not, write to the Free Software Foundation,
eosterlund@47998 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
eosterlund@47998 18 *
eosterlund@47998 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
eosterlund@47998 20 * or visit www.oracle.com if you need additional information or have any
eosterlund@47998 21 * questions.
eosterlund@47998 22 *
eosterlund@47998 23 */
eosterlund@47998 24
rkennke@49658 25 #ifndef SHARE_OOPS_ACCESS_INLINE_HPP
rkennke@49658 26 #define SHARE_OOPS_ACCESS_INLINE_HPP
eosterlund@47998 27
eosterlund@49347 28 #include "gc/shared/barrierSetConfig.inline.hpp"
eosterlund@47998 29 #include "oops/access.hpp"
eosterlund@47998 30 #include "oops/accessBackend.inline.hpp"
eosterlund@47998 31
rkennke@49658 32 // This file outlines the last 2 steps of the template pipeline of accesses going through
rkennke@49658 33 // the Access API.
rkennke@49658 34 // * Step 5.a: Barrier resolution. This step is invoked the first time a runtime-dispatch
rkennke@49658 35 // happens for an access. The appropriate BarrierSet::AccessBarrier accessor
rkennke@49658 36 // is resolved, then the function pointer is updated to that accessor for
rkennke@49658 37 // future invocations.
rkennke@49658 38 // * Step 5.b: Post-runtime dispatch. This step now casts previously unknown types such
rkennke@49658 39 // as the address type of an oop on the heap (is it oop* or narrowOop*) to
rkennke@49658 40 // the appropriate type. It also splits sufficiently orthogonal accesses into
rkennke@49658 41 // different functions, such as whether the access involves oops or primitives
rkennke@49658 42 // and whether the access is performed on the heap or outside. Then the
rkennke@49658 43 // appropriate BarrierSet::AccessBarrier is called to perform the access.
eosterlund@47998 44
eosterlund@47998 45 namespace AccessInternal {
rkennke@49658 46 // Step 5.b: Post-runtime dispatch.
eosterlund@47998 47 // This class is the last step before calling the BarrierSet::AccessBarrier.
eosterlund@47998 48 // Here we make sure to figure out types that were not known prior to the
eosterlund@47998 49 // runtime dispatch, such as whether an oop on the heap is oop or narrowOop.
eosterlund@47998 50 // We also split orthogonal barriers such as handling primitives vs oops
eosterlund@47998 51 // and on-heap vs off-heap into different calls to the barrier set.
eosterlund@47998 52 template <class GCBarrierType, BarrierType type, DecoratorSet decorators>
eosterlund@47998 53 struct PostRuntimeDispatch: public AllStatic { };
eosterlund@47998 54
eosterlund@47998 55 template <class GCBarrierType, DecoratorSet decorators>
eosterlund@47998 56 struct PostRuntimeDispatch<GCBarrierType, BARRIER_STORE, decorators>: public AllStatic {
eosterlund@47998 57 template <typename T>
eosterlund@47998 58 static void access_barrier(void* addr, T value) {
eosterlund@47998 59 GCBarrierType::store_in_heap(reinterpret_cast<T*>(addr), value);
eosterlund@47998 60 }
eosterlund@47998 61
eosterlund@47998 62 static void oop_access_barrier(void* addr, oop value) {
eosterlund@47998 63 typedef typename HeapOopType<decorators>::type OopType;
eosterlund@47998 64 if (HasDecorator<decorators, IN_HEAP>::value) {
eosterlund@47998 65 GCBarrierType::oop_store_in_heap(reinterpret_cast<OopType*>(addr), value);
eosterlund@47998 66 } else {
eosterlund@47998 67 GCBarrierType::oop_store_not_in_heap(reinterpret_cast<OopType*>(addr), value);
eosterlund@47998 68 }
eosterlund@47998 69 }
eosterlund@47998 70 };
eosterlund@47998 71
eosterlund@47998 72 template <class GCBarrierType, DecoratorSet decorators>
eosterlund@47998 73 struct PostRuntimeDispatch<GCBarrierType, BARRIER_LOAD, decorators>: public AllStatic {
eosterlund@47998 74 template <typename T>
eosterlund@47998 75 static T access_barrier(void* addr) {
eosterlund@47998 76 return GCBarrierType::load_in_heap(reinterpret_cast<T*>(addr));
eosterlund@47998 77 }
eosterlund@47998 78
eosterlund@47998 79 static oop oop_access_barrier(void* addr) {
eosterlund@47998 80 typedef typename HeapOopType<decorators>::type OopType;
eosterlund@47998 81 if (HasDecorator<decorators, IN_HEAP>::value) {
eosterlund@47998 82 return GCBarrierType::oop_load_in_heap(reinterpret_cast<OopType*>(addr));
eosterlund@47998 83 } else {
eosterlund@47998 84 return GCBarrierType::oop_load_not_in_heap(reinterpret_cast<OopType*>(addr));
eosterlund@47998 85 }
eosterlund@47998 86 }
eosterlund@47998 87 };
eosterlund@47998 88
eosterlund@47998 89 template <class GCBarrierType, DecoratorSet decorators>
eosterlund@47998 90 struct PostRuntimeDispatch<GCBarrierType, BARRIER_ATOMIC_XCHG, decorators>: public AllStatic {
eosterlund@47998 91 template <typename T>
eosterlund@47998 92 static T access_barrier(T new_value, void* addr) {
eosterlund@47998 93 return GCBarrierType::atomic_xchg_in_heap(new_value, reinterpret_cast<T*>(addr));
eosterlund@47998 94 }
eosterlund@47998 95
eosterlund@47998 96 static oop oop_access_barrier(oop new_value, void* addr) {
eosterlund@47998 97 typedef typename HeapOopType<decorators>::type OopType;
eosterlund@47998 98 if (HasDecorator<decorators, IN_HEAP>::value) {
eosterlund@47998 99 return GCBarrierType::oop_atomic_xchg_in_heap(new_value, reinterpret_cast<OopType*>(addr));
eosterlund@47998 100 } else {
eosterlund@47998 101 return GCBarrierType::oop_atomic_xchg_not_in_heap(new_value, reinterpret_cast<OopType*>(addr));
eosterlund@47998 102 }
eosterlund@47998 103 }
eosterlund@47998 104 };
eosterlund@47998 105
eosterlund@47998 106 template <class GCBarrierType, DecoratorSet decorators>
eosterlund@47998 107 struct PostRuntimeDispatch<GCBarrierType, BARRIER_ATOMIC_CMPXCHG, decorators>: public AllStatic {
eosterlund@47998 108 template <typename T>
eosterlund@47998 109 static T access_barrier(T new_value, void* addr, T compare_value) {
eosterlund@47998 110 return GCBarrierType::atomic_cmpxchg_in_heap(new_value, reinterpret_cast<T*>(addr), compare_value);
eosterlund@47998 111 }
eosterlund@47998 112
eosterlund@47998 113 static oop oop_access_barrier(oop new_value, void* addr, oop compare_value) {
eosterlund@47998 114 typedef typename HeapOopType<decorators>::type OopType;
eosterlund@47998 115 if (HasDecorator<decorators, IN_HEAP>::value) {
eosterlund@47998 116 return GCBarrierType::oop_atomic_cmpxchg_in_heap(new_value, reinterpret_cast<OopType*>(addr), compare_value);
eosterlund@47998 117 } else {
eosterlund@47998 118 return GCBarrierType::oop_atomic_cmpxchg_not_in_heap(new_value, reinterpret_cast<OopType*>(addr), compare_value);
eosterlund@47998 119 }
eosterlund@47998 120 }
eosterlund@47998 121 };
eosterlund@47998 122
eosterlund@47998 123 template <class GCBarrierType, DecoratorSet decorators>
eosterlund@47998 124 struct PostRuntimeDispatch<GCBarrierType, BARRIER_ARRAYCOPY, decorators>: public AllStatic {
eosterlund@47998 125 template <typename T>
rkennke@50389 126 static bool access_barrier(arrayOop src_obj, size_t src_offset_in_bytes, T* src_raw,
rkennke@50389 127 arrayOop dst_obj, size_t dst_offset_in_bytes, T* dst_raw,
rkennke@50389 128 size_t length) {
rkennke@50389 129 GCBarrierType::arraycopy_in_heap(src_obj, src_offset_in_bytes, src_raw,
rkennke@50389 130 dst_obj, dst_offset_in_bytes, dst_raw,
rkennke@50389 131 length);
rkennke@49383 132 return true;
eosterlund@47998 133 }
eosterlund@47998 134
eosterlund@47998 135 template <typename T>
rkennke@50389 136 static bool oop_access_barrier(arrayOop src_obj, size_t src_offset_in_bytes, T* src_raw,
rkennke@50389 137 arrayOop dst_obj, size_t dst_offset_in_bytes, T* dst_raw,
rkennke@50389 138 size_t length) {
eosterlund@47998 139 typedef typename HeapOopType<decorators>::type OopType;
rkennke@50389 140 return GCBarrierType::oop_arraycopy_in_heap(src_obj, src_offset_in_bytes, reinterpret_cast<OopType*>(src_raw),
rkennke@50389 141 dst_obj, dst_offset_in_bytes, reinterpret_cast<OopType*>(dst_raw),
rkennke@50389 142 length);
eosterlund@47998 143 }
eosterlund@47998 144 };
eosterlund@47998 145
eosterlund@47998 146 template <class GCBarrierType, DecoratorSet decorators>
eosterlund@47998 147 struct PostRuntimeDispatch<GCBarrierType, BARRIER_STORE_AT, decorators>: public AllStatic {
eosterlund@47998 148 template <typename T>
eosterlund@47998 149 static void access_barrier(oop base, ptrdiff_t offset, T value) {
eosterlund@47998 150 GCBarrierType::store_in_heap_at(base, offset, value);
eosterlund@47998 151 }
eosterlund@47998 152
eosterlund@47998 153 static void oop_access_barrier(oop base, ptrdiff_t offset, oop value) {
eosterlund@47998 154 GCBarrierType::oop_store_in_heap_at(base, offset, value);
eosterlund@47998 155 }
eosterlund@47998 156 };
eosterlund@47998 157
eosterlund@47998 158 template <class GCBarrierType, DecoratorSet decorators>
eosterlund@47998 159 struct PostRuntimeDispatch<GCBarrierType, BARRIER_LOAD_AT, decorators>: public AllStatic {
eosterlund@47998 160 template <typename T>
eosterlund@47998 161 static T access_barrier(oop base, ptrdiff_t offset) {
eosterlund@47998 162 return GCBarrierType::template load_in_heap_at<T>(base, offset);
eosterlund@47998 163 }
eosterlund@47998 164
eosterlund@47998 165 static oop oop_access_barrier(oop base, ptrdiff_t offset) {
eosterlund@47998 166 return GCBarrierType::oop_load_in_heap_at(base, offset);
eosterlund@47998 167 }
eosterlund@47998 168 };
eosterlund@47998 169
eosterlund@47998 170 template <class GCBarrierType, DecoratorSet decorators>
eosterlund@47998 171 struct PostRuntimeDispatch<GCBarrierType, BARRIER_ATOMIC_XCHG_AT, decorators>: public AllStatic {
eosterlund@47998 172 template <typename T>
eosterlund@47998 173 static T access_barrier(T new_value, oop base, ptrdiff_t offset) {
eosterlund@47998 174 return GCBarrierType::atomic_xchg_in_heap_at(new_value, base, offset);
eosterlund@47998 175 }
eosterlund@47998 176
eosterlund@47998 177 static oop oop_access_barrier(oop new_value, oop base, ptrdiff_t offset) {
eosterlund@47998 178 return GCBarrierType::oop_atomic_xchg_in_heap_at(new_value, base, offset);
eosterlund@47998 179 }
eosterlund@47998 180 };
eosterlund@47998 181
eosterlund@47998 182 template <class GCBarrierType, DecoratorSet decorators>
eosterlund@47998 183 struct PostRuntimeDispatch<GCBarrierType, BARRIER_ATOMIC_CMPXCHG_AT, decorators>: public AllStatic {
eosterlund@47998 184 template <typename T>
eosterlund@47998 185 static T access_barrier(T new_value, oop base, ptrdiff_t offset, T compare_value) {
eosterlund@47998 186 return GCBarrierType::atomic_cmpxchg_in_heap_at(new_value, base, offset, compare_value);
eosterlund@47998 187 }
eosterlund@47998 188
eosterlund@47998 189 static oop oop_access_barrier(oop new_value, oop base, ptrdiff_t offset, oop compare_value) {
eosterlund@47998 190 return GCBarrierType::oop_atomic_cmpxchg_in_heap_at(new_value, base, offset, compare_value);
eosterlund@47998 191 }
eosterlund@47998 192 };
eosterlund@47998 193
eosterlund@47998 194 template <class GCBarrierType, DecoratorSet decorators>
eosterlund@47998 195 struct PostRuntimeDispatch<GCBarrierType, BARRIER_CLONE, decorators>: public AllStatic {
eosterlund@47998 196 static void access_barrier(oop src, oop dst, size_t size) {
eosterlund@47998 197 GCBarrierType::clone_in_heap(src, dst, size);
eosterlund@47998 198 }
eosterlund@47998 199 };
eosterlund@47998 200
eosterlund@49041 201 template <class GCBarrierType, DecoratorSet decorators>
eosterlund@49041 202 struct PostRuntimeDispatch<GCBarrierType, BARRIER_RESOLVE, decorators>: public AllStatic {
eosterlund@49041 203 static oop access_barrier(oop obj) {
eosterlund@49041 204 return GCBarrierType::resolve(obj);
eosterlund@49041 205 }
eosterlund@49041 206 };
eosterlund@49041 207
rkennke@49658 208 template <class GCBarrierType, DecoratorSet decorators>
rkennke@49658 209 struct PostRuntimeDispatch<GCBarrierType, BARRIER_EQUALS, decorators>: public AllStatic {
rkennke@49658 210 static bool access_barrier(oop o1, oop o2) {
rkennke@49658 211 return GCBarrierType::equals(o1, o2);
rkennke@49658 212 }
rkennke@49658 213 };
rkennke@49658 214
eosterlund@47998 215 // Resolving accessors with barriers from the barrier set happens in two steps.
eosterlund@47998 216 // 1. Expand paths with runtime-decorators, e.g. is UseCompressedOops on or off.
eosterlund@47998 217 // 2. Expand paths for each BarrierSet available in the system.
eosterlund@47998 218 template <DecoratorSet decorators, typename FunctionPointerT, BarrierType barrier_type>
eosterlund@47998 219 struct BarrierResolver: public AllStatic {
eosterlund@47998 220 template <DecoratorSet ds>
eosterlund@47998 221 static typename EnableIf<
eosterlund@47998 222 HasDecorator<ds, INTERNAL_VALUE_IS_OOP>::value,
eosterlund@47998 223 FunctionPointerT>::type
eosterlund@47998 224 resolve_barrier_gc() {
eosterlund@47998 225 BarrierSet* bs = BarrierSet::barrier_set();
eosterlund@47998 226 assert(bs != NULL, "GC barriers invoked before BarrierSet is set");
eosterlund@47998 227 switch (bs->kind()) {
eosterlund@47998 228 #define BARRIER_SET_RESOLVE_BARRIER_CLOSURE(bs_name) \
eosterlund@47998 229 case BarrierSet::bs_name: { \
eosterlund@47998 230 return PostRuntimeDispatch<typename BarrierSet::GetType<BarrierSet::bs_name>::type:: \
eosterlund@47998 231 AccessBarrier<ds>, barrier_type, ds>::oop_access_barrier; \
eosterlund@47998 232 } \
eosterlund@47998 233 break;
eosterlund@47998 234 FOR_EACH_CONCRETE_BARRIER_SET_DO(BARRIER_SET_RESOLVE_BARRIER_CLOSURE)
eosterlund@47998 235 #undef BARRIER_SET_RESOLVE_BARRIER_CLOSURE
eosterlund@47998 236
eosterlund@47998 237 default:
eosterlund@47998 238 fatal("BarrierSet AccessBarrier resolving not implemented");
eosterlund@47998 239 return NULL;
eosterlund@47998 240 };
eosterlund@47998 241 }
eosterlund@47998 242
eosterlund@47998 243 template <DecoratorSet ds>
eosterlund@47998 244 static typename EnableIf<
eosterlund@47998 245 !HasDecorator<ds, INTERNAL_VALUE_IS_OOP>::value,
eosterlund@47998 246 FunctionPointerT>::type
eosterlund@47998 247 resolve_barrier_gc() {
eosterlund@47998 248 BarrierSet* bs = BarrierSet::barrier_set();
eosterlund@47998 249 assert(bs != NULL, "GC barriers invoked before BarrierSet is set");
eosterlund@47998 250 switch (bs->kind()) {
eosterlund@47998 251 #define BARRIER_SET_RESOLVE_BARRIER_CLOSURE(bs_name) \
eosterlund@47998 252 case BarrierSet::bs_name: { \
eosterlund@47998 253 return PostRuntimeDispatch<typename BarrierSet::GetType<BarrierSet::bs_name>::type:: \
eosterlund@47998 254 AccessBarrier<ds>, barrier_type, ds>::access_barrier; \
eosterlund@47998 255 } \
eosterlund@47998 256 break;
eosterlund@47998 257 FOR_EACH_CONCRETE_BARRIER_SET_DO(BARRIER_SET_RESOLVE_BARRIER_CLOSURE)
eosterlund@47998 258 #undef BARRIER_SET_RESOLVE_BARRIER_CLOSURE
eosterlund@47998 259
eosterlund@47998 260 default:
eosterlund@47998 261 fatal("BarrierSet AccessBarrier resolving not implemented");
eosterlund@47998 262 return NULL;
eosterlund@47998 263 };
eosterlund@47998 264 }
eosterlund@47998 265
eosterlund@47998 266 static FunctionPointerT resolve_barrier_rt() {
eosterlund@47998 267 if (UseCompressedOops) {
eosterlund@47998 268 const DecoratorSet expanded_decorators = decorators | INTERNAL_RT_USE_COMPRESSED_OOPS;
eosterlund@47998 269 return resolve_barrier_gc<expanded_decorators>();
eosterlund@47998 270 } else {
eosterlund@47998 271 return resolve_barrier_gc<decorators>();
eosterlund@47998 272 }
eosterlund@47998 273 }
eosterlund@47998 274
eosterlund@47998 275 static FunctionPointerT resolve_barrier() {
eosterlund@47998 276 return resolve_barrier_rt();
eosterlund@47998 277 }
eosterlund@47998 278 };
eosterlund@47998 279
rkennke@49658 280 // Step 5.a: Barrier resolution
eosterlund@47998 281 // The RuntimeDispatch class is responsible for performing a runtime dispatch of the
eosterlund@47998 282 // accessor. This is required when the access either depends on whether compressed oops
eosterlund@47998 283 // is being used, or it depends on which GC implementation was chosen (e.g. requires GC
eosterlund@47998 284 // barriers). The way it works is that a function pointer initially pointing to an
eosterlund@47998 285 // accessor resolution function gets called for each access. Upon first invocation,
eosterlund@47998 286 // it resolves which accessor to be used in future invocations and patches the
eosterlund@47998 287 // function pointer to this new accessor.
eosterlund@47998 288
eosterlund@47998 289 template <DecoratorSet decorators, typename T>
rkennke@49658 290 void RuntimeDispatch<decorators, T, BARRIER_STORE>::store_init(void* addr, T value) {
rkennke@49658 291 func_t function = BarrierResolver<decorators, func_t, BARRIER_STORE>::resolve_barrier();
rkennke@49658 292 _store_func = function;
rkennke@49658 293 function(addr, value);
eosterlund@47998 294 }
eosterlund@47998 295
eosterlund@47998 296 template <DecoratorSet decorators, typename T>
rkennke@49658 297 void RuntimeDispatch<decorators, T, BARRIER_STORE_AT>::store_at_init(oop base, ptrdiff_t offset, T value) {
rkennke@49658 298 func_t function = BarrierResolver<decorators, func_t, BARRIER_STORE_AT>::resolve_barrier();
rkennke@49658 299 _store_at_func = function;
rkennke@49658 300 function(base, offset, value);
eosterlund@47998 301 }
eosterlund@47998 302
eosterlund@47998 303 template <DecoratorSet decorators, typename T>
rkennke@49658 304 T RuntimeDispatch<decorators, T, BARRIER_LOAD>::load_init(void* addr) {
rkennke@49658 305 func_t function = BarrierResolver<decorators, func_t, BARRIER_LOAD>::resolve_barrier();
rkennke@49658 306 _load_func = function;
rkennke@49658 307 return function(addr);
eosterlund@47998 308 }
eosterlund@47998 309
eosterlund@47998 310 template <DecoratorSet decorators, typename T>
rkennke@49658 311 T RuntimeDispatch<decorators, T, BARRIER_LOAD_AT>::load_at_init(oop base, ptrdiff_t offset) {
rkennke@49658 312 func_t function = BarrierResolver<decorators, func_t, BARRIER_LOAD_AT>::resolve_barrier();
rkennke@49658 313 _load_at_func = function;
rkennke@49658 314 return function(base, offset);
eosterlund@47998 315 }
eosterlund@47998 316
eosterlund@47998 317 template <DecoratorSet decorators, typename T>
rkennke@49658 318 T RuntimeDispatch<decorators, T, BARRIER_ATOMIC_CMPXCHG>::atomic_cmpxchg_init(T new_value, void* addr, T compare_value) {
rkennke@49658 319 func_t function = BarrierResolver<decorators, func_t, BARRIER_ATOMIC_CMPXCHG>::resolve_barrier();
rkennke@49658 320 _atomic_cmpxchg_func = function;
rkennke@49658 321 return function(new_value, addr, compare_value);
eosterlund@47998 322 }
eosterlund@47998 323
eosterlund@47998 324 template <DecoratorSet decorators, typename T>
rkennke@49658 325 T RuntimeDispatch<decorators, T, BARRIER_ATOMIC_CMPXCHG_AT>::atomic_cmpxchg_at_init(T new_value, oop base, ptrdiff_t offset, T compare_value) {
rkennke@49658 326 func_t function = BarrierResolver<decorators, func_t, BARRIER_ATOMIC_CMPXCHG_AT>::resolve_barrier();
rkennke@49658 327 _atomic_cmpxchg_at_func = function;
rkennke@49658 328 return function(new_value, base, offset, compare_value);
eosterlund@47998 329 }
eosterlund@47998 330
eosterlund@49454 331 template <DecoratorSet decorators, typename T>
rkennke@49658 332 T RuntimeDispatch<decorators, T, BARRIER_ATOMIC_XCHG>::atomic_xchg_init(T new_value, void* addr) {
rkennke@49658 333 func_t function = BarrierResolver<decorators, func_t, BARRIER_ATOMIC_XCHG>::resolve_barrier();
rkennke@49658 334 _atomic_xchg_func = function;
rkennke@49658 335 return function(new_value, addr);
eosterlund@47998 336 }
eosterlund@47998 337
eosterlund@47998 338 template <DecoratorSet decorators, typename T>
rkennke@49658 339 T RuntimeDispatch<decorators, T, BARRIER_ATOMIC_XCHG_AT>::atomic_xchg_at_init(T new_value, oop base, ptrdiff_t offset) {
rkennke@49658 340 func_t function = BarrierResolver<decorators, func_t, BARRIER_ATOMIC_XCHG_AT>::resolve_barrier();
rkennke@49658 341 _atomic_xchg_at_func = function;
rkennke@49658 342 return function(new_value, base, offset);
eosterlund@47998 343 }
eosterlund@47998 344
eosterlund@47998 345 template <DecoratorSet decorators, typename T>
rkennke@50389 346 bool RuntimeDispatch<decorators, T, BARRIER_ARRAYCOPY>::arraycopy_init(arrayOop src_obj, size_t src_offset_in_bytes, T* src_raw,
rkennke@50389 347 arrayOop dst_obj, size_t dst_offset_in_bytes, T* dst_raw,
rkennke@50389 348 size_t length) {
rkennke@49658 349 func_t function = BarrierResolver<decorators, func_t, BARRIER_ARRAYCOPY>::resolve_barrier();
rkennke@49658 350 _arraycopy_func = function;
rkennke@50389 351 return function(src_obj, src_offset_in_bytes, src_raw,
rkennke@50389 352 dst_obj, dst_offset_in_bytes, dst_raw,
rkennke@50389 353 length);
eosterlund@47998 354 }
eosterlund@47998 355
eosterlund@47998 356 template <DecoratorSet decorators, typename T>
rkennke@49658 357 void RuntimeDispatch<decorators, T, BARRIER_CLONE>::clone_init(oop src, oop dst, size_t size) {
rkennke@49658 358 func_t function = BarrierResolver<decorators, func_t, BARRIER_CLONE>::resolve_barrier();
rkennke@49658 359 _clone_func = function;
rkennke@49658 360 function(src, dst, size);
eosterlund@47998 361 }
eosterlund@47998 362
eosterlund@47998 363 template <DecoratorSet decorators, typename T>
rkennke@49658 364 oop RuntimeDispatch<decorators, T, BARRIER_RESOLVE>::resolve_init(oop obj) {
rkennke@49658 365 func_t function = BarrierResolver<decorators, func_t, BARRIER_RESOLVE>::resolve_barrier();
rkennke@49658 366 _resolve_func = function;
rkennke@49658 367 return function(obj);
eosterlund@47998 368 }
eosterlund@47998 369
eosterlund@47998 370 template <DecoratorSet decorators, typename T>
rkennke@49658 371 bool RuntimeDispatch<decorators, T, BARRIER_EQUALS>::equals_init(oop o1, oop o2) {
rkennke@49658 372 func_t function = BarrierResolver<decorators, func_t, BARRIER_EQUALS>::resolve_barrier();
rkennke@49658 373 _equals_func = function;
rkennke@49658 374 return function(o1, o2);
eosterlund@49041 375 }
eosterlund@47998 376 }
eosterlund@47998 377
rkennke@49658 378 #endif // SHARE_OOPS_ACCESS_INLINE_HPP