5#ifndef INCLUDE_V8_SANDBOX_H_
6#define INCLUDE_V8_SANDBOX_H_
26#ifdef V8_COMPRESS_POINTERS
29 Internals::kIsolateCppHeapPointerTableOffset +
31 return *
reinterpret_cast<Address**
>(addr);
35template <CppHeapPo
interTag tag,
typename T>
39#ifdef V8_COMPRESS_POINTERS
44 Internals::ReadRawField<CppHeapPointerHandle>(heap_object_ptr, offset);
46 return reinterpret_cast<T*
>(kNullAddress);
48 const uint32_t index = handle >> kExternalPointerIndexShift;
49 const Address* table = GetCppHeapPointerTableBase(isolate);
50 const std::atomic<Address>* ptr =
51 reinterpret_cast<const std::atomic<Address>*
>(&table[index]);
52 Address entry = std::atomic_load_explicit(ptr, std::memory_order_relaxed);
53 return reinterpret_cast<T*
>(entry & ~static_cast<uint64_t>(tag));
55 return reinterpret_cast<T*
>(
56 Internals::ReadRawField<Address>(heap_object_ptr, offset));
Definition: v8-isolate.h:210
static const int kExternalPointerTableBasePointerOffset
Definition: v8-internal.h:781
uint32_t CppHeapPointerHandle
Definition: v8-internal.h:309
uintptr_t Address
Definition: v8-internal.h:31
@ kExternalObjectValueTag
Definition: v8-internal.h:551
@ kExternalPointerNullTag
Definition: v8-internal.h:535
Definition: libplatform.h:15
CppHeapPointerTag
Definition: v8-sandbox.h:20
#define V8_INLINE
Definition: v8config.h:477