5#ifndef INCLUDE_V8_SANDBOX_H_
6#define INCLUDE_V8_SANDBOX_H_
89 uint32_t actual_tag =
static_cast<uint16_t
>(entry);
94 uint32_t first_tag =
static_cast<uint32_t
>(
lower_bound) << kTagShift;
95 uint32_t last_tag = (
static_cast<uint32_t
>(
upper_bound) << kTagShift) + 1;
96 return actual_tag >= first_tag && actual_tag <= last_tag;
115#ifdef V8_COMPRESS_POINTERS
118 Internals::kIsolateCppHeapPointerTableOffset +
120 return *
reinterpret_cast<Address**
>(addr);
126 Address heap_object_ptr,
int offset,
127 CppHeapPointerTagRange tag_range) {
128#ifdef V8_COMPRESS_POINTERS
132 Internals::ReadRawField<CppHeapPointerHandle>(heap_object_ptr, offset);
133 const uint32_t index = handle >> kExternalPointerIndexShift;
134 const Address* table = GetCppHeapPointerTableBase(isolate);
135 const std::atomic<Address>* ptr =
136 reinterpret_cast<const std::atomic<Address>*
>(&table[index]);
137 Address entry = std::atomic_load_explicit(ptr, std::memory_order_relaxed);
140 if (
V8_LIKELY(tag_range.CheckTagOf(entry))) {
162 return reinterpret_cast<T*
>(pointer);
164 return reinterpret_cast<T*
>(
165 Internals::ReadRawField<Address>(heap_object_ptr, offset));
Definition: v8-isolate.h:261
Definition: v8-sandbox.h:103
static void InitializeBeforeThreadCreation()
static const int kExternalPointerTableBasePointerOffset
Definition: v8-internal.h:847
uint32_t CppHeapPointerHandle
Definition: v8-internal.h:366
constexpr uint64_t kCppHeapPointerPayloadShift
Definition: v8-internal.h:383
constexpr uint64_t kCppHeapPointerTagShift
Definition: v8-internal.h:382
uintptr_t Address
Definition: v8-internal.h:52
Definition: libplatform.h:15
CppHeapPointerTag
Definition: v8-sandbox.h:28
constexpr CppHeapPointerTagRange kAnyCppHeapPointer(CppHeapPointerTag::kFirstTag, CppHeapPointerTag::kLastTag)
Definition: v8-sandbox.h:69
constexpr CppHeapPointerTagRange(CppHeapPointerTag lower, CppHeapPointerTag upper)
Definition: v8-sandbox.h:70
bool CheckTagOf(uint64_t entry)
Definition: v8-sandbox.h:82
CppHeapPointerTag lower_bound
Definition: v8-sandbox.h:73
CppHeapPointerTag upper_bound
Definition: v8-sandbox.h:74
#define V8_EXPORT
Definition: v8config.h:793
#define V8_INLINE
Definition: v8config.h:499
#define V8_LIKELY(condition)
Definition: v8config.h:650