5#ifndef INCLUDE_V8_SANDBOX_H_
6#define INCLUDE_V8_SANDBOX_H_
90 uint32_t actual_tag =
static_cast<uint16_t
>(entry);
95 uint32_t first_tag =
static_cast<uint32_t
>(
lower_bound) << kTagShift;
96 uint32_t last_tag = (
static_cast<uint32_t
>(
upper_bound) << kTagShift) + 1;
97 return actual_tag >= first_tag && actual_tag <= last_tag;
116#ifdef V8_COMPRESS_POINTERS
119 Internals::kIsolateCppHeapPointerTableOffset +
121 return *
reinterpret_cast<Address**
>(addr);
127 Address heap_object_ptr,
int offset,
128 CppHeapPointerTagRange tag_range) {
129#ifdef V8_COMPRESS_POINTERS
133 Internals::ReadRawField<CppHeapPointerHandle>(heap_object_ptr, offset);
134 const uint32_t index = handle >> kExternalPointerIndexShift;
135 const Address* table = GetCppHeapPointerTableBase(isolate);
136 const std::atomic<Address>* ptr =
137 reinterpret_cast<const std::atomic<Address>*
>(&table[index]);
138 Address entry = std::atomic_load_explicit(ptr, std::memory_order_relaxed);
141 if (
V8_LIKELY(tag_range.CheckTagOf(entry))) {
163 return reinterpret_cast<T*
>(pointer);
165 return reinterpret_cast<T*
>(
166 Internals::ReadRawField<Address>(heap_object_ptr, offset));
Definition: v8-isolate.h:273
Definition: v8-sandbox.h:104
static void InitializeBeforeThreadCreation()
static const int kExternalPointerTableBasePointerOffset
Definition: v8-internal.h:883
uint32_t CppHeapPointerHandle
Definition: v8-internal.h:376
constexpr uint64_t kCppHeapPointerPayloadShift
Definition: v8-internal.h:393
constexpr uint64_t kCppHeapPointerTagShift
Definition: v8-internal.h:392
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:70
constexpr CppHeapPointerTagRange(CppHeapPointerTag lower, CppHeapPointerTag upper)
Definition: v8-sandbox.h:71
bool CheckTagOf(uint64_t entry)
Definition: v8-sandbox.h:83
CppHeapPointerTag lower_bound
Definition: v8-sandbox.h:74
CppHeapPointerTag upper_bound
Definition: v8-sandbox.h:75
#define V8_EXPORT
Definition: v8config.h:793
#define V8_INLINE
Definition: v8config.h:499
#define V8_LIKELY(condition)
Definition: v8config.h:650