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;
46#ifdef ENABLE_SLOW_DCHECKS
75 : location_(location) {}
88 template <
typename T,
bool check_null = false>
90 return internal::ValueHelper::SlotAsValue<T, check_null>(
slot());
93#ifdef V8_ENABLE_DIRECT_HANDLE
107#ifdef V8_ENABLE_DIRECT_HANDLE
113class DirectHandleBase {
117 return ptr_ == internal::ValueHelper::kEmpty;
121 V8_INLINE void Clear() { ptr_ = internal::ValueHelper::kEmpty; }
124 friend class internal::ValueHelper;
125 friend class internal::HandleHelper;
128 V8_INLINE DirectHandleBase(
const DirectHandleBase& other) =
default;
129 V8_INLINE DirectHandleBase& operator=(
const DirectHandleBase& that) =
default;
131 V8_INLINE explicit DirectHandleBase(internal::Address ptr) : ptr_(ptr) {}
134 V8_INLINE internal::Address ptr()
const {
return ptr_; }
138 template <
typename T,
bool check_null = false>
140 return reinterpret_cast<T*
>(ptr_);
143 V8_INLINE internal::ValueHelper::InternalRepresentationType repr()
const {
148 internal::Address ptr_ = internal::ValueHelper::kEmpty;
Definition: v8-handle-base.h:57
IndirectHandleBase & operator=(const IndirectHandleBase &that)=default
T * value() const
Definition: v8-handle-base.h:89
internal::Address ptr() const
Definition: v8-handle-base.h:80
internal::Address *& slot()
Definition: v8-handle-base.h:84
IndirectHandleBase()=default
internal::Address *const & slot() const
Definition: v8-handle-base.h:83
bool IsEmpty() const
Definition: v8-handle-base.h:60
IndirectHandleBase(const IndirectHandleBase &other)=default
IndirectHandleBase(internal::Address *location)
Definition: v8-handle-base.h:74
void Clear()
Definition: v8-handle-base.h:63
internal::ValueHelper::InternalRepresentationType repr() const
Definition: v8-handle-base.h:98
void VerifyOnStack() const
Definition: v8-handle-base.h:49
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:1651
Definition: v8-internal.h:1565
internal::Address * InternalRepresentationType
Definition: v8-internal.h:1579
static constexpr InternalRepresentationType kEmpty
Definition: v8-internal.h:1580
Definition: v8-function-callback.h:35
uintptr_t Address
Definition: v8-internal.h:52
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