< prev index next > src/hotspot/share/oops/access.hpp
Print this page
#define SHARE_OOPS_ACCESS_HPP
#include "memory/allStatic.hpp"
#include "oops/accessBackend.hpp"
#include "oops/accessDecorators.hpp"
+ #include "oops/inlineKlass.hpp"
#include "oops/oopsHierarchy.hpp"
#include "utilities/debug.hpp"
#include "utilities/globalDefinitions.hpp"
// * atomic_cmpxchg_at: Atomically compare-and-swap a new value at an internal pointer address if previous value matched the compared value.
// * atomic_xchg: Atomically swap a new value at an address without checking the previous value.
// * atomic_xchg_at: Atomically swap a new value at an internal pointer address without checking the previous value.
// * arraycopy: Copy data from one heap array to another heap array. The ArrayAccess class has convenience functions for this.
// * clone: Clone the contents of an object to a newly allocated object.
+ // * value_copy: Copy the contents of a value type from one heap address to another
//
// == IMPLEMENTATION ==
// Each access goes through the following steps in a template pipeline.
// There are essentially 5 steps for each access:
// * Step 1: Set default decorators and decay types. This step gets rid of CV qualifiers
const DecoratorSet heap_oop_decorators = AS_DECORATOR_MASK | ON_DECORATOR_MASK |
IN_HEAP | IS_ARRAY | IS_NOT_NULL | IS_DEST_UNINITIALIZED;
verify_decorators<expected_mo_decorators | heap_oop_decorators>();
}
+ template <DecoratorSet expected_mo_decorators>
+ static void verify_heap_value_decorators() {
+ const DecoratorSet heap_value_decorators = IN_HEAP | IS_DEST_UNINITIALIZED;
+ verify_decorators<expected_mo_decorators | heap_value_decorators>();
+ }
+
static const DecoratorSet load_mo_decorators = MO_UNORDERED | MO_RELAXED | MO_ACQUIRE | MO_SEQ_CST;
static const DecoratorSet store_mo_decorators = MO_UNORDERED | MO_RELAXED | MO_RELEASE | MO_SEQ_CST;
static const DecoratorSet atomic_xchg_mo_decorators = MO_SEQ_CST;
static const DecoratorSet atomic_cmpxchg_mo_decorators = MO_RELAXED | MO_SEQ_CST;
static inline void clone(oop src, oop dst, size_t size) {
verify_decorators<IN_HEAP>();
AccessInternal::clone<decorators>(src, dst, size);
}
+ // inline type heap access (when flat)...
+
+ // Copy value type data from src to dst
+ static inline void value_copy(void* src, void* dst, InlineKlass* md, LayoutKind lk) {
+ verify_heap_value_decorators<IN_HEAP>();
+ AccessInternal::value_copy<decorators>(src, dst, md, lk);
+ }
+
// Primitive accesses
template <typename P>
static inline P load(P* addr) {
verify_primitive_decorators<load_mo_decorators>();
return AccessInternal::load<decorators, P, P>(addr);
}
template <typename T>
static inline void oop_arraycopy_raw(T* src, T* dst, size_t length) {
static_assert((decorators & ARRAYCOPY_CHECKCAST) == 0);
+ static_assert((decorators & ARRAYCOPY_NOTNULL) == 0);
OopCopyResult result = AccessT::oop_arraycopy(nullptr, 0, src,
nullptr, 0, dst,
length);
< prev index next >