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());
93#ifdef V8_ENABLE_DIRECT_LOCAL
99class DirectHandleBase {
103 return ptr_ == internal::ValueHelper::kEmpty;
107 V8_INLINE void Clear() { ptr_ = internal::ValueHelper::kEmpty; }
110 friend class internal::ValueHelper;
111 friend class internal::HandleHelper;
114 V8_INLINE DirectHandleBase(
const DirectHandleBase& other) =
default;
115 V8_INLINE DirectHandleBase& operator=(
const DirectHandleBase& that) =
default;
117 V8_INLINE explicit DirectHandleBase(internal::Address ptr) : ptr_(ptr) {}
120 V8_INLINE internal::Address ptr()
const {
return ptr_; }
124 template <
typename T,
bool check_null = false>
126 return reinterpret_cast<T*
>(ptr_);
130 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
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:1472
Definition: v8-internal.h:1416
Definition: v8-handle-base.h:10
uintptr_t Address
Definition: v8-internal.h:31
Definition: v8-handle-base.h:18
#define V8_EXPORT
Definition: v8config.h:762
#define V8_INLINE
Definition: v8config.h:477
#define V8_TRIVIAL_ABI
Definition: v8config.h:712