annotate src/hotspot/share/oops/access.inline.hpp @ 53207:b1c6d4d7f801

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