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;
132#ifdef V8_COMPRESS_POINTERS
135 Internals::kIsolateCppHeapPointerTableOffset +
137 return *
reinterpret_cast<Address**
>(addr);
143 Address heap_object_ptr,
int offset,
144 CppHeapPointerTagRange tag_range) {
145#ifdef V8_COMPRESS_POINTERS
149 Internals::ReadRawField<CppHeapPointerHandle>(heap_object_ptr, offset);
150 const uint32_t index = handle >> kExternalPointerIndexShift;
151 const Address* table = GetCppHeapPointerTableBase(isolate);
152 const std::atomic<Address>* ptr =
153 reinterpret_cast<const std::atomic<Address>*
>(&table[index]);
154 Address entry = std::atomic_load_explicit(ptr, std::memory_order_relaxed);
157 if (
V8_LIKELY(tag_range.CheckTagOf(entry))) {
179 return reinterpret_cast<T*
>(pointer);
181 return reinterpret_cast<T*
>(
182 Internals::ReadRawField<Address>(heap_object_ptr, offset));
Definition: v8-isolate.h:290
Definition: v8-sandbox.h:110
static void InitializeBeforeThreadCreation()
static void PrepareCurrentThreadForHardwareSandboxing()
static const int kExternalPointerTableBasePointerOffset
Definition: v8-internal.h:927
uint32_t CppHeapPointerHandle
Definition: v8-internal.h:383
constexpr uint64_t kCppHeapPointerPayloadShift
Definition: v8-internal.h:400
constexpr uint64_t kCppHeapPointerTagShift
Definition: v8-internal.h:399
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:860
#define V8_INLINE
Definition: v8config.h:513
#define V8_LIKELY(condition)
Definition: v8config.h:674