5#ifndef INCLUDE_V8_HANDLE_BASE_H_
6#define INCLUDE_V8_HANDLE_BASE_H_
12template <
bool check_statically_enabled>
33#if V8_HAS_ATTRIBUTE_TRIVIAL_ABI
36 StackAllocated& operator=(
const StackAllocated&) =
default;
71 : location_(location) {}
84 template <
typename T,
bool check_null = false>
86 return internal::ValueHelper::SlotAsValue<T, check_null>(
slot());
89#ifdef V8_ENABLE_DIRECT_HANDLE
103#ifdef V8_ENABLE_DIRECT_HANDLE
109class DirectHandleBase {
113 return ptr_ == internal::ValueHelper::kEmpty;
117 V8_INLINE void Clear() { ptr_ = internal::ValueHelper::kEmpty; }
120 friend class internal::ValueHelper;
121 friend class internal::HandleHelper;
124 V8_INLINE DirectHandleBase(
const DirectHandleBase& other) =
default;
125 V8_INLINE DirectHandleBase& operator=(
const DirectHandleBase& that) =
default;
127 V8_INLINE explicit DirectHandleBase(internal::Address ptr) : ptr_(ptr) {}
130 V8_INLINE internal::Address ptr()
const {
return ptr_; }
134 template <
typename T,
bool check_null = false>
136 return reinterpret_cast<T*
>(ptr_);
139 V8_INLINE internal::ValueHelper::InternalRepresentationType repr()
const {
144 internal::Address ptr_ = internal::ValueHelper::kEmpty;
Definition: v8-handle-base.h:53
IndirectHandleBase & operator=(const IndirectHandleBase &that)=default
T * value() const
Definition: v8-handle-base.h:85
internal::Address ptr() const
Definition: v8-handle-base.h:76
internal::Address *& slot()
Definition: v8-handle-base.h:80
IndirectHandleBase()=default
internal::Address *const & slot() const
Definition: v8-handle-base.h:79
bool IsEmpty() const
Definition: v8-handle-base.h:56
IndirectHandleBase(const IndirectHandleBase &other)=default
IndirectHandleBase(internal::Address *location)
Definition: v8-handle-base.h:70
void Clear()
Definition: v8-handle-base.h:59
internal::ValueHelper::InternalRepresentationType repr() const
Definition: v8-handle-base.h:94
void VerifyOnStack() const
StackAllocated()
Definition: v8-handle-base.h:31
StackAllocated(const StackAllocated &other, no_checking_tag tag)
Definition: v8-handle-base.h:42
StackAllocated(no_checking_tag tag)
Definition: v8-handle-base.h:40
Definition: v8-handle-base.h:13
void VerifyOnStack() const
Definition: v8-handle-base.h:25
StackAllocated(const StackAllocated &other, no_checking_tag)
Definition: v8-handle-base.h:22
StackAllocated(no_checking_tag)
Definition: v8-handle-base.h:21
static constexpr no_checking_tag do_not_check
Definition: v8-handle-base.h:19
Definition: v8-internal.h:1713
Definition: v8-internal.h:1627
internal::Address * InternalRepresentationType
Definition: v8-internal.h:1641
static constexpr InternalRepresentationType kEmpty
Definition: v8-internal.h:1642
Definition: v8-function-callback.h:35
uintptr_t Address
Definition: v8-internal.h:51
Definition: v8-handle-base.h:18
#define V8_EXPORT
Definition: v8config.h:793
#define V8_INLINE
Definition: v8config.h:499
#define V8_TRIVIAL_ABI
Definition: v8config.h:743