5#ifndef INCLUDE_V8_INTERNAL_H_
6#define INCLUDE_V8_INTERNAL_H_
23#if __has_include(<version>)
26#if defined(__cpp_lib_three_way_comparison) && \
27 __cpp_lib_three_way_comparison >= 201711L && \
28 defined(__cpp_lib_concepts) && __cpp_lib_concepts >= 202002L
32#define V8_HAVE_SPACESHIP_OPERATOR 1
34#define V8_HAVE_SPACESHIP_OPERATOR 0
53static constexpr Address kNullAddress = 0;
55constexpr int KB = 1024;
56constexpr int MB =
KB * 1024;
57constexpr int GB =
MB * 1024;
58#ifdef V8_TARGET_ARCH_X64
59constexpr size_t TB =
size_t{
GB} * 1024;
90template <
size_t tagged_ptr_size>
109 return static_cast<int32_t
>(
static_cast<uint32_t
>(value)) >> shift_bits;
112 template <
class T,
typename std::enable_if_t<std::is_
integral_v<T> &&
113 std::is_
signed_v<T>>* =
nullptr>
118 return (
static_cast<uintptr_t
>(value) -
125 typename std::enable_if_t<std::is_integral_v<T> &&
126 std::is_unsigned_v<T>>* =
nullptr>
128 static_assert(kSmiMaxValue <= std::numeric_limits<uintptr_t>::max());
135 return (
static_cast<uint64_t
>(value) -
142 static_assert(kSmiMaxValue <= std::numeric_limits<uint64_t>::max());
159 return static_cast<int>(
static_cast<intptr_t
>(value) >> shift_bits);
162 template <
class T,
typename std::enable_if_t<std::is_
integral_v<T> &&
163 std::is_
signed_v<T>>* =
nullptr>
166 return std::numeric_limits<int32_t>::min() <= value &&
167 value <= std::numeric_limits<int32_t>::max();
171 typename std::enable_if_t<std::is_integral_v<T> &&
172 std::is_unsigned_v<T>>* =
nullptr>
174 return value <= std::numeric_limits<int32_t>::max();
178#ifdef V8_COMPRESS_POINTERS
181constexpr size_t kPtrComprCageReservationSize =
size_t{1} << 32;
182constexpr size_t kPtrComprCageBaseAlignment =
size_t{1} << 32;
186 "Pointer compression can be enabled only for 64-bit architectures");
196#ifdef V8_31BIT_SMIS_ON_64BIT_ARCH
206const int kSmiMinValue =
static_cast<int>(PlatformSmiTagging::kSmiMinValue);
207const int kSmiMaxValue =
static_cast<int>(PlatformSmiTagging::kSmiMaxValue);
221#ifdef V8_ENABLE_SANDBOX
232#ifdef V8_ENABLE_SANDBOX
235#if defined(V8_TARGET_OS_ANDROID)
239constexpr size_t kSandboxSizeLog2 = 37;
242constexpr size_t kSandboxSizeLog2 = 40;
244constexpr size_t kSandboxSize = 1ULL << kSandboxSizeLog2;
251constexpr size_t kSandboxAlignment = kPtrComprCageBaseAlignment;
257constexpr uint64_t kSandboxedPointerShift = 64 - kSandboxSizeLog2;
265constexpr size_t kSandboxGuardRegionSize = 32ULL *
GB + 4ULL *
GB;
267static_assert((kSandboxGuardRegionSize % kSandboxAlignment) == 0,
268 "The size of the guard regions around the sandbox must be a "
269 "multiple of its required alignment.");
281constexpr size_t kSandboxMinimumReservationSize = 8ULL *
GB;
283static_assert(kSandboxMinimumReservationSize > kPtrComprCageReservationSize,
284 "The minimum reservation size for a sandbox must be larger than "
285 "the pointer compression cage contained within it.");
291constexpr size_t kMaxSafeBufferSizeForSandbox = 32ULL *
GB - 1;
292static_assert(kMaxSafeBufferSizeForSandbox <= kSandboxGuardRegionSize,
293 "The maximum allowed buffer size must not be larger than the "
294 "sandbox's guard regions");
296constexpr size_t kBoundedSizeShift = 29;
297static_assert(1ULL << (64 - kBoundedSizeShift) ==
298 kMaxSafeBufferSizeForSandbox + 1,
299 "The maximum size of a BoundedSize must be synchronized with the "
300 "kMaxSafeBufferSizeForSandbox");
304#ifdef V8_COMPRESS_POINTERS
306#ifdef V8_TARGET_OS_ANDROID
312constexpr size_t kExternalPointerTableReservationSize = 256 *
MB;
318constexpr uint32_t kExternalPointerIndexShift = 7;
320constexpr size_t kExternalPointerTableReservationSize = 512 *
MB;
321constexpr uint32_t kExternalPointerIndexShift = 6;
325constexpr int kExternalPointerTableEntrySize = 8;
326constexpr int kExternalPointerTableEntrySizeLog2 = 3;
328 kExternalPointerTableReservationSize / kExternalPointerTableEntrySize;
330 "kExternalPointerTableReservationSize and "
331 "kExternalPointerIndexShift don't match");
362#ifdef V8_ENABLE_SANDBOX
382#ifdef V8_COMPRESS_POINTERS
395#ifdef V8_COMPRESS_POINTERS
399constexpr size_t kCppHeapPointerTableReservationSize =
400 kExternalPointerTableReservationSize;
401constexpr uint32_t kCppHeapPointerIndexShift = kExternalPointerIndexShift;
403constexpr int kCppHeapPointerTableEntrySize = 8;
404constexpr int kCppHeapPointerTableEntrySizeLog2 = 3;
406 kCppHeapPointerTableReservationSize / kCppHeapPointerTableEntrySize;
408 "kCppHeapPointerTableReservationSize and "
409 "kCppHeapPointerIndexShift don't match");
445template <
typename Tag>
447 static_assert(std::is_enum_v<Tag> &&
448 std::is_same_v<std::underlying_type_t<Tag>, uint16_t>,
449 "Tag parameter must be an enum with base type uint16_t");
468 constexpr size_t Size()
const {
480 return static_cast<uint32_t
>(tag) -
first <=
493 static_assert(std::is_same_v<std::underlying_type_t<Tag>, uint16_t>);
494 return (
static_cast<size_t>(
first) << 16) |
last;
662V8_INLINE static constexpr bool IsSharedExternalPointerType(
670V8_INLINE static constexpr bool IsMaybeReadOnlyExternalPointerType(
679V8_INLINE static constexpr bool IsManagedExternalPointerType(
691V8_INLINE static constexpr bool ExternalPointerCanBeEmpty(
754 "kTrustedPointerTableReservationSize and "
755 "kTrustedPointerHandleShift don't match");
803 "kCodePointerTableReservationSize and kCodePointerHandleShift don't match");
833 return mapword ^ kMapWordXorMask;
847#ifdef V8_COMPRESS_POINTERS
857#ifdef V8_ENABLE_SANDBOX
923#ifdef V8_COMPRESS_POINTERS
924 static const int kIsolateExternalPointerTableOffset =
926 static const int kIsolateSharedExternalPointerTableAddressOffset =
928 static const int kIsolateCppHeapPointerTableOffset =
930#ifdef V8_ENABLE_SANDBOX
931 static const int kIsolateTrustedCageBaseOffset =
933 static const int kIsolateTrustedPointerTableOffset =
935 static const int kIsolateSharedTrustedPointerTableAddressOffset =
937 static const int kIsolateTrustedPointerPublishingScopeOffset =
939 static const int kIsolateCodePointerTableBaseAddressOffset =
962#if V8_STATIC_ROOTS_BOOL
965#define EXPORTED_STATIC_ROOTS_PTR_LIST(V) \
966 V(UndefinedValue, 0x11) \
969 V(FalseValue, 0x55) \
970 V(EmptyString, 0x49) \
971 V(TheHoleValue, 0x761)
973 using Tagged_t = uint32_t;
974 struct StaticReadOnlyRoot {
975#define DEF_ROOT(name, value) static constexpr Tagged_t k##name = value;
976 EXPORTED_STATIC_ROOTS_PTR_LIST(DEF_ROOT)
980 static constexpr Tagged_t kStringMapLowerBound = 0;
981 static constexpr Tagged_t kStringMapUpperBound = 0x425;
983#define PLUSONE(...) +1
984 static constexpr size_t kNumberOfExportedStaticRoots =
985 2 + EXPORTED_STATIC_ROOTS_PTR_LIST(PLUSONE);
1029#ifdef V8_MAP_PACKING
1030 static const uintptr_t kMapWordMetadataMask = 0xffffULL << 48;
1032 static const uintptr_t kMapWordSignature = 0b10;
1037 static const int kMapWordXorMask = 0b11;
1042#ifdef V8_ENABLE_CHECKS
1052 return PlatformSmiTagging::SmiToInt(value);
1056 return (value << (
kSmiTagSize + PlatformSmiTagging::kSmiShiftSize)) |
1064 template <
typename T,
1065 typename std::enable_if_t<std::is_integral_v<T>>* =
nullptr>
1070 template <
typename T,
1071 typename std::enable_if_t<std::is_integral_v<T>>* =
nullptr>
1073 return PlatformSmiTagging::IsValidSmi(value);
1076 template <
typename T,
1077 typename std::enable_if_t<std::is_integral_v<T>>* =
nullptr>
1079 if (
V8_LIKELY(PlatformSmiTagging::IsValidSmi(value))) {
1085#if V8_STATIC_ROOTS_BOOL
1087 return static_cast<Tagged_t
>(obj) == constant;
1090 V8_INLINE static bool CheckInstanceMapRange(
Address obj, Tagged_t first_map,
1091 Tagged_t last_map) {
1093#ifdef V8_MAP_PACKING
1094 map = UnpackMapWord(map);
1096 return map >= first_map && map <= last_map;
1102#ifdef V8_MAP_PACKING
1103 map = UnpackMapWord(map);
1111#ifdef V8_MAP_PACKING
1112 map = UnpackMapWord(map);
1133 (
static_cast<unsigned>(
static_cast<unsigned>(instance_type) -
1140 return *addr &
static_cast<uint8_t
>(1U << shift);
1145 uint8_t mask =
static_cast<uint8_t
>(1U << shift);
1146 *addr =
static_cast<uint8_t
>((*addr & ~mask) | (value << shift));
1163 *
reinterpret_cast<void**
>(addr) = data;
1170 return *
reinterpret_cast<void* const*
>(addr);
1176 ++(*
reinterpret_cast<size_t*
>(addr));
1182 return reinterpret_cast<Address*
>(addr);
1186#if V8_STATIC_ROOTS_BOOL
1190#define DECOMPRESS_ROOT(name, ...) \
1191 case k##name##RootIndex: \
1192 return base + StaticReadOnlyRoot::k##name;
1193 EXPORTED_STATIC_ROOTS_PTR_LIST(DECOMPRESS_ROOT)
1194#undef DECOMPRESS_ROOT
1195#undef EXPORTED_STATIC_ROOTS_PTR_LIST
1203#ifdef V8_ENABLE_SANDBOX
1206 kIsolateExternalPointerTableOffset +
1208 return *
reinterpret_cast<Address**
>(addr);
1214 kIsolateSharedExternalPointerTableAddressOffset;
1215 addr = *
reinterpret_cast<Address*
>(addr);
1217 return *
reinterpret_cast<Address**
>(addr);
1221 template <
typename T>
1224#ifdef V8_COMPRESS_POINTERS
1231 memcpy(&r,
reinterpret_cast<void*
>(addr),
sizeof(T));
1235 return *
reinterpret_cast<const T*
>(addr);
1240#ifdef V8_COMPRESS_POINTERS
1242 Address base = GetPtrComprCageBaseFromOnHeapAddress(heap_object_ptr);
1243 return base +
static_cast<Address>(
static_cast<uintptr_t
>(value));
1251#ifdef V8_COMPRESS_POINTERS
1253 return static_cast<Address>(
static_cast<uintptr_t
>(value));
1260#ifdef V8_ENABLE_SANDBOX
1269 template <ExternalPo
interTagRange tag_range>
1273#ifdef V8_ENABLE_SANDBOX
1274 static_assert(!tag_range.IsEmpty());
1277 Address* table = IsSharedExternalPointerType(tag_range)
1278 ? GetSharedExternalPointerTableBase(isolate)
1279 : GetExternalPointerTableBase(isolate);
1282 uint32_t index = handle >> kExternalPointerIndexShift;
1283 std::atomic<Address>* ptr =
1284 reinterpret_cast<std::atomic<Address>*
>(&table[index]);
1285 Address entry = std::atomic_load_explicit(ptr, std::memory_order_relaxed);
1288 if (
V8_LIKELY(tag_range.Contains(actual_tag))) {
1299#ifdef V8_COMPRESS_POINTERS
1301 return addr & -
static_cast<intptr_t
>(kPtrComprCageBaseAlignment);
1305 return static_cast<uint32_t
>(value);
1310 Address base = GetPtrComprCageBaseFromOnHeapAddress(heap_object_ptr);
1311 return base +
static_cast<Address>(
static_cast<uintptr_t
>(value));
1319template <
bool PerformCheck>
1338 !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
1353 Heap*
heap()
const {
return heap_; }
1359 return a.heap_ == b.heap_;
1382template <
typename T>
1387 template <
typename HeapOrIsolateT>
1389 template <
typename U>
1392 using std::allocator<T>::allocate;
1393 using std::allocator<T>::deallocate;
1398template <
typename Iterator,
typename =
void>
1400template <
typename Iterator>
1402 Iterator, std::void_t<typename Iterator::iterator_concept>> =
true;
1404template <
typename Iterator,
typename =
void>
1406template <
typename Iterator>
1408 Iterator, std::void_t<typename Iterator::iterator_category>> =
true;
1413template <
typename Iterator,
typename =
void>
1416template <
typename Iterator>
1418 Iterator, std::enable_if_t<kHaveIteratorConcept<Iterator>>> {
1422template <
typename Iterator>
1424 Iterator, std::enable_if_t<kHaveIteratorCategory<Iterator> &&
1425 !kHaveIteratorConcept<Iterator>>> {
1431#if __has_include(<ranges>)
1432 using iterator_concept =
1433 typename std::iterator_traits<Iterator>::iterator_concept;
1441template <
typename Iterator,
typename ElementType =
void>
1445 std::is_void_v<ElementType> ||
1446 (std::is_convertible_v<typename std::iterator_traits<Iterator>::pointer,
1447 std::add_pointer_t<ElementType>> &&
1448 std::is_convertible_v<typename std::iterator_traits<Iterator>::reference,
1449 std::add_lvalue_reference_t<ElementType>>));
1452 typename std::iterator_traits<Iterator>::difference_type;
1454 std::conditional_t<std::is_void_v<ElementType>,
1455 typename std::iterator_traits<Iterator>::value_type,
1458 std::conditional_t<std::is_void_v<ElementType>,
1459 typename std::iterator_traits<Iterator>::pointer,
1460 std::add_pointer_t<ElementType>>;
1462 std::conditional_t<std::is_void_v<ElementType>,
1463 typename std::iterator_traits<Iterator>::reference,
1464 std::add_lvalue_reference_t<ElementType>>;
1466 typename std::iterator_traits<Iterator>::iterator_category;
1473 template <
typename OtherIterator,
typename OtherElementType,
1474 typename = std::enable_if_t<
1475 std::is_convertible_v<OtherIterator, Iterator>>>
1478 : it_(other.base()) {}
1482 if constexpr (std::is_pointer_v<Iterator>) {
1485 return it_.operator->();
1489 template <
typename OtherIterator,
typename OtherElementType>
1493 return it_ == other.base();
1495#if V8_HAVE_SPACESHIP_OPERATOR
1496 template <
typename OtherIterator,
typename OtherElementType>
1497 [[nodiscard]]
constexpr auto operator<=>(
1500 if constexpr (std::three_way_comparable_with<Iterator, OtherIterator>) {
1501 return it_ <=> other.base();
1502 }
else if constexpr (std::totally_ordered_with<Iterator, OtherIterator>) {
1503 if (it_ < other.base()) {
1504 return std::strong_ordering::less;
1506 return (it_ > other.base()) ? std::strong_ordering::greater
1507 : std::strong_ordering::equal;
1509 if (it_ < other.base()) {
1510 return std::partial_ordering::less;
1512 if (other.base() < it_) {
1513 return std::partial_ordering::greater;
1515 return (it_ == other.base()) ? std::partial_ordering::equivalent
1516 : std::partial_ordering::unordered;
1522 template <
typename OtherIterator,
typename OtherElementType>
1526 return it_ != other.base();
1529 template <
typename OtherIterator,
typename OtherElementType>
1533 return it_ < other.base();
1535 template <
typename OtherIterator,
typename OtherElementType>
1539 return it_ <= other.base();
1541 template <
typename OtherIterator,
typename OtherElementType>
1545 return it_ > other.base();
1547 template <
typename OtherIterator,
typename OtherElementType>
1551 return it_ >= other.base();
1595 template <
typename OtherIterator,
typename OtherElementType>
1599 return it_ - other.base();
1606 [[nodiscard]]
constexpr const Iterator&
base() const noexcept {
return it_; }
1623#ifdef V8_ENABLE_DIRECT_HANDLE
1624 static constexpr Address kTaggedNullAddress = 1;
1633 template <
typename T>
1641 template <
template <
typename T,
typename... Ms>
typename H,
typename T,
1644 return handle.template value<T>();
1647#ifdef V8_ENABLE_DIRECT_HANDLE
1649 template <
typename T>
1651 return reinterpret_cast<Address>(value);
1654 template <
typename T,
bool check_null = true,
typename S>
1656 if (check_null && slot ==
nullptr) {
1657 return reinterpret_cast<T*
>(kTaggedNullAddress);
1659 return *
reinterpret_cast<T**
>(slot);
1662 template <
typename T>
1667 template <
typename T>
1669 return reinterpret_cast<T*
>(repr);
1674 template <
typename T>
1676 return *
reinterpret_cast<const Address*
>(value);
1679 template <
typename T,
bool check_null = true,
typename S>
1681 return reinterpret_cast<T*
>(slot);
1684 template <
typename T>
1687 reinterpret_cast<const Address*
>(value));
1690 template <
typename T>
1692 return reinterpret_cast<T*
>(repr);
1713 template <
typename T1,
typename T2>
1715 if (lhs.IsEmpty())
return rhs.IsEmpty();
1716 if (rhs.IsEmpty())
return false;
1717 return lhs.ptr() == rhs.ptr();
static V8_INLINE bool EqualHandles(const T1 &lhs, const T2 &rhs)
static const int kTrustedPointerTableBasePointerOffset
static const int kIsolateCageBaseOffset
static V8_INLINE Address LoadMap(Address obj)
static const int kTrueValueRootIndex
static const int kInferShouldThrowMode
static V8_INLINE void UpdateNodeFlag(Address *obj, bool value, int shift)
static const int kJSSpecialApiObjectType
static V8_INLINE void IncrementLongTasksStatsCounter(v8::Isolate *isolate)
static const int kExternalPointerTableSize
static const int kOddballKindOffset
static const int kOldAllocationInfoOffset
static const int kFirstEmbedderJSApiObjectType
static const int kFastCCallAlignmentPaddingSize
static const int kErrorMessageParamSize
static const int kFalseValueRootIndex
static const int kIsolateStackGuardOffset
static const int kNullValueRootIndex
static const int kIsolateFastCCallCallerPcOffset
static const int kDontThrow
static const int kEmptyStringRootIndex
static V8_INLINE uint8_t GetNodeState(Address *obj)
static const int kNativeContextEmbedderDataOffset
static V8_INLINE uint8_t GetNodeFlag(Address *obj, int shift)
static const int kStringRepresentationAndEncodingMask
static const int kIsolateThreadLocalTopOffset
static const int kDisallowGarbageCollectionSize
static const int kIsolateLongTaskStatsCounterOffset
static const int kEmbedderDataArrayHeaderSize
static const int kExternalTwoByteRepresentationTag
static const int kNodeStateMask
static const int kUndefinedValueRootIndex
static const int kDisallowGarbageCollectionAlign
static const int kRegExpStaticResultOffsetsVectorSize
static V8_INLINE constexpr bool HasHeapObjectTag(Address value)
static const int kThrowOnError
static const int kEmbedderDataSlotExternalPointerOffset
static const int kBuiltinTier0TableSize
static const int kHandleScopeDataSize
static V8_INLINE Address ReadTaggedSignedField(Address heap_object_ptr, int offset)
static V8_INLINE constexpr Address AddressToSmi(Address value)
static V8_INLINE T ReadRawField(Address heap_object_ptr, int offset)
static V8_INLINE void CheckInitialized(v8::Isolate *isolate)
static const uint32_t kNumIsolateDataSlots
static const int kNumberOfBooleanFlags
static V8_INLINE Address * GetRootSlot(v8::Isolate *isolate, int index)
static const int kBuiltinTier0EntryTableSize
static const int kStackGuardSize
static const int kIsolateFastApiCallTargetOffset
static V8_INLINE constexpr bool CanHaveInternalField(int instance_type)
static V8_INLINE v8::Isolate * GetIsolateForSandbox(Address obj)
static constexpr size_t kExternalAllocationSoftLimit
static const int kNodeFlagsOffset
static const int kContinuationPreservedEmbedderDataOffset
static const int kLastJSApiObjectType
static const int kExternalOneByteRepresentationTag
static const int kNodeStateIsWeakValue
static V8_EXPORT void CheckInitializedImpl(v8::Isolate *isolate)
static const int kTrustedPointerTableSize
static const int kBuiltinTier0TableOffset
static const int kForeignType
static const int kNodeClassIdOffset
static V8_INLINE int GetInstanceType(Address obj)
static const int kIsolateRootsOffset
static const int kIsolateApiCallbackThunkArgumentOffset
static const int kExternalPointerTableBasePointerOffset
static const int kFirstJSApiObjectType
static const int kOddballType
static const int kMapInstanceTypeOffset
static const int kLinearAllocationAreaSize
static const int kIsolateEmbedderDataOffset
static V8_INLINE int GetOddballKind(Address obj)
static V8_INLINE void * GetEmbedderData(const v8::Isolate *isolate, uint32_t slot)
static const int kNewAllocationInfoOffset
static V8_INLINE constexpr int SmiValue(Address value)
static const int kUndefinedOddballKind
static const int kEmbedderDataSlotSize
static const int kHeapObjectMapOffset
static V8_INLINE Address ReadTaggedPointerField(Address heap_object_ptr, int offset)
static const int kNullOddballKind
static V8_INLINE bool IsExternalTwoByteString(int instance_type)
static constexpr std::optional< Address > TryIntegralToSmi(T value)
static V8_INLINE constexpr Address IntToSmi(int value)
static const int kFirstNonstringType
static V8_INLINE void UpdateNodeState(Address *obj, uint8_t value)
static const int kJSAPIObjectWithEmbedderSlotsHeaderSize
static const int kBuiltinTier0EntryTableOffset
static const int kStringEncodingMask
static const int kIsolateRegexpExecVectorArgumentOffset
static V8_INLINE Address GetRoot(v8::Isolate *isolate, int index)
static const int kLastEmbedderJSApiObjectType
static const int kVariousBooleanFlagsOffset
static V8_INLINE constexpr Address IntegralToSmi(T value)
static const int kThreadLocalTopSize
static const int kTablesAlignmentPaddingSize
static V8_INLINE constexpr bool IsValidSmi(T value)
static const int kJSObjectHeaderSize
static V8_INLINE void SetEmbedderData(v8::Isolate *isolate, uint32_t slot, void *data)
static const int kFixedArrayHeaderSize
static const int kJSObjectType
static const int kTheHoleValueRootIndex
static V8_INLINE Address ReadExternalPointerField(v8::Isolate *isolate, Address heap_object_ptr, int offset)
static const int kStringResourceOffset
static const int kIsolateHandleScopeDataOffset
static const int kIsolateFastCCallCallerFpOffset
static const int kErrorMessageParamOffset
friend bool operator==(const StrongRootAllocatorBase &a, const StrongRootAllocatorBase &b)
StrongRootAllocatorBase(Isolate *isolate)
Address * allocate_impl(size_t n)
void deallocate_impl(Address *p, size_t n) noexcept
StrongRootAllocatorBase(LocalHeap *heap)
StrongRootAllocatorBase(LocalIsolate *isolate)
StrongRootAllocatorBase(v8::Isolate *isolate)
StrongRootAllocatorBase(Heap *heap)
StrongRootAllocator(HeapOrIsolateT *)
StrongRootAllocator(const StrongRootAllocator< U > &other) noexcept
static V8_INLINE Address ValueAsAddress(const T *value)
static constexpr InternalRepresentationType kEmpty
static V8_INLINE T * HandleAsValue(const H< T, Ms... > &handle)
static V8_INLINE T * SlotAsValue(S *slot)
static V8_INLINE bool IsEmpty(T *value)
internal::Address * InternalRepresentationType
static V8_INLINE T * ReprAsValue(InternalRepresentationType repr)
static V8_INLINE InternalRepresentationType ValueAsRepr(const T *value)
constexpr const Iterator & base() const noexcept
typename std::iterator_traits< Iterator >::iterator_category iterator_category
constexpr WrappedIterator(const WrappedIterator< OtherIterator, OtherElementType > &other) noexcept
std::conditional_t< std::is_void_v< ElementType >, typename std::iterator_traits< Iterator >::value_type, ElementType > value_type
constexpr WrappedIterator operator++(int) noexcept
constexpr bool operator>=(const WrappedIterator< OtherIterator, OtherElementType > &other) const noexcept
constexpr WrappedIterator operator-(difference_type n) const noexcept
constexpr reference operator[](difference_type n) const noexcept
constexpr pointer operator->() const noexcept
constexpr WrappedIterator operator+(difference_type n) const noexcept
typename std::iterator_traits< Iterator >::difference_type difference_type
constexpr auto operator-(const WrappedIterator< OtherIterator, OtherElementType > &other) const noexcept
constexpr WrappedIterator & operator--() noexcept
constexpr WrappedIterator operator--(int) noexcept
constexpr WrappedIterator() noexcept=default
std::conditional_t< std::is_void_v< ElementType >, typename std::iterator_traits< Iterator >::reference, std::add_lvalue_reference_t< ElementType > > reference
constexpr reference operator*() const noexcept
friend constexpr WrappedIterator operator+(difference_type n, const WrappedIterator &x) noexcept
constexpr WrappedIterator & operator+=(difference_type n) noexcept
constexpr bool operator<=(const WrappedIterator< OtherIterator, OtherElementType > &other) const noexcept
constexpr WrappedIterator & operator++() noexcept
constexpr bool operator!=(const WrappedIterator< OtherIterator, OtherElementType > &other) const noexcept
std::conditional_t< std::is_void_v< ElementType >, typename std::iterator_traits< Iterator >::pointer, std::add_pointer_t< ElementType > > pointer
constexpr bool operator==(const WrappedIterator< OtherIterator, OtherElementType > &other) const noexcept
constexpr bool operator>(const WrappedIterator< OtherIterator, OtherElementType > &other) const noexcept
constexpr bool operator<(const WrappedIterator< OtherIterator, OtherElementType > &other) const noexcept
constexpr WrappedIterator & operator-=(difference_type n) noexcept
constexpr bool PointerCompressionIsEnabled()
constexpr int kCodePointerTableEntryCodeObjectOffset
Address SandboxedPointer_t
TagRange< ExternalPointerTag > ExternalPointerTagRange
const int kApiSystemPointerSize
constexpr size_t kMaxTrustedPointers
constexpr ExternalPointerTagRange kAnyManagedResourceExternalPointerTag(kFirstManagedResourceTag, kLastManagedResourceTag)
V8_EXPORT void VerifyHandleIsNonEmpty(bool is_empty)
constexpr ExternalPointerTagRange kAnyManagedExternalPointerTagRange(kFirstManagedExternalPointerTag, kLastManagedExternalPointerTag)
constexpr IndirectPointerHandle kNullIndirectPointerHandle
constexpr int kTrustedPointerTableEntrySizeLog2
Address ExternalPointer_t
void PrintPropertyCallbackInfo(void *property_callback_info)
constexpr uint64_t kExternalPointerTagShift
constexpr uint64_t kExternalPointerTagAndMarkbitMask
const intptr_t kHeapObjectTagMask
constexpr bool kHaveIteratorCategory
constexpr CppHeapPointerHandle kNullCppHeapPointerHandle
constexpr int kCodePointerTableEntryEntrypointOffset
uint32_t CppHeapPointerHandle
constexpr size_t kMaxExternalPointers
constexpr ExternalPointerTagRange kAnyForeignExternalPointerTagRange(kFirstForeignExternalPointerTag, kLastForeignExternalPointerTag)
@ kExternalPointerNullTag
@ kDisplayNamesInternalTag
@ kApiIndexedPropertyDefinerCallbackTag
@ kLastManagedResourceTag
@ kFirstExternalPointerTag
@ kApiAbortScriptExecutionCallbackTag
@ kExternalPointerFreeEntryTag
@ kFirstManagedResourceTag
@ kExternalStringResourceDataTag
@ kWasmExportedFunctionDataSignatureTag
@ kApiNamedPropertyDefinerCallbackTag
@ kIcuLocalizedNumberFormatterTag
@ kLastExternalPointerTag
@ kFirstForeignExternalPointerTag
@ kExternalPointerZappedEntryTag
@ kIcuDateIntervalFormatTag
@ kEmbedderDataSlotPayloadTag
@ kLastMaybeReadOnlyExternalPointerTag
@ kWasmTypeInfoNativeTypeTag
@ kExternalPointerEvacuationEntryTag
@ kLastSharedExternalPointerTag
@ kFunctionTemplateInfoCallbackTag
@ kApiIndexedPropertyDescriptorCallbackTag
@ kApiNamedPropertyQueryCallbackTag
@ kLastManagedExternalPointerTag
@ kIcuRelativeDateTimeFormatterTag
@ kApiNamedPropertyDeleterCallbackTag
@ kExternalObjectValueTag
@ kApiIndexedPropertySetterCallbackTag
@ kD8ModuleEmbedderDataTag
@ kIcuSimpleDateFormatTag
@ kArrayBufferExtensionTag
@ kApiNamedPropertySetterCallbackTag
@ kApiNamedPropertyDescriptorCallbackTag
@ kFirstManagedExternalPointerTag
@ kExternalStringResourceTag
@ kApiNamedPropertyGetterCallbackTag
@ kFirstSharedExternalPointerTag
@ kFirstMaybeReadOnlyExternalPointerTag
@ kApiIndexedPropertyEnumeratorCallbackTag
@ kApiIndexedPropertyQueryCallbackTag
@ kLastForeignExternalPointerTag
@ kWasmInternalFunctionCallTargetTag
@ kWasmIndirectFunctionTargetTag
@ kNativeContextMicrotaskQueueTag
@ kApiAccessCheckCallbackTag
@ kApiIndexedPropertyGetterCallbackTag
@ kMicrotaskCallbackDataTag
@ kApiIndexedPropertyDeleterCallbackTag
const int kHeapObjectTagSize
constexpr size_t kTrustedPointerTableReservationSize
constexpr ExternalPointerTagRange kAnyExternalPointerTagRange(kFirstExternalPointerTag, kLastExternalPointerTag)
constexpr uint64_t kCppHeapPointerMarkBit
constexpr size_t kMaxCppHeapPointers
constexpr ExternalPointerHandle kNullExternalPointerHandle
constexpr uint32_t kCodePointerHandleMarker
const intptr_t kForwardingTagMask
constexpr uint32_t kCodePointerHandleShift
constexpr ExternalPointer_t kNullExternalPointer
constexpr int kCodePointerTableEntrySize
IndirectPointerHandle CodePointerHandle
constexpr bool kHaveIteratorConcept
constexpr ExternalPointerTagRange kAnySharedExternalPointerTagRange(kFirstSharedExternalPointerTag, kLastSharedExternalPointerTag)
constexpr bool kBuiltinCodeObjectsLiveInTrustedSpace
SmiTagging< kApiTaggedSize > PlatformSmiTagging
V8_EXPORT internal::Isolate * IsolateFromNeverReadOnlySpaceObject(Address obj)
constexpr bool SmiValuesAre32Bits()
constexpr bool SmiValuesAre31Bits()
void PrintFunctionCallbackInfo(void *function_callback_info)
constexpr ExternalPointerTagRange kAnyMaybeReadOnlyExternalPointerTagRange(kFirstMaybeReadOnlyExternalPointerTag, kLastMaybeReadOnlyExternalPointerTag)
constexpr uintptr_t kUintptrAllBitsSet
constexpr bool kAllCodeObjectsLiveInTrustedSpace
uint32_t ExternalPointerHandle
constexpr TrustedPointerHandle kNullTrustedPointerHandle
constexpr uint64_t kCppHeapPointerTagShift
uint32_t IndirectPointerHandle
constexpr uint64_t kExternalPointerTagMask
constexpr size_t kCodePointerTableReservationSize
constexpr int kTrustedPointerTableEntrySize
constexpr bool kRuntimeGeneratedCodeObjectsLiveInTrustedSpace
IndirectPointerHandle TrustedPointerHandle
const int kForwardingTagSize
V8_INLINE void PerformCastCheck(T *data)
constexpr bool SandboxIsEnabled()
constexpr int kCodePointerTableEntrySizeLog2
constexpr CppHeapPointer_t kNullCppHeapPointer
const int kWeakHeapObjectTag
V8_EXPORT bool ShouldThrowOnError(internal::Isolate *isolate)
constexpr intptr_t kIntptrAllBitsSet
constexpr uint64_t kExternalPointerPayloadMask
constexpr uint32_t kTrustedPointerHandleShift
const intptr_t kHeapObjectReferenceTagMask
constexpr size_t kMaxCodePointers
constexpr uint64_t kExternalPointerShiftedTagMask
constexpr CodePointerHandle kNullCodePointerHandle
constexpr uint64_t kCppHeapPointerPayloadShift
const intptr_t kSmiTagMask
constexpr uint64_t kExternalPointerMarkBit
constexpr int kGarbageCollectionReasonMaxValue
static void Perform(T *data)
typename Iterator::iterator_concept iterator_concept
static V8_INLINE constexpr bool IsValidSmi(int64_t value)
static V8_INLINE constexpr int SmiToInt(Address value)
static V8_INLINE constexpr bool IsValidSmi(uint64_t value)
static V8_INLINE constexpr bool IsValidSmi(T value)
static constexpr intptr_t kSmiMinValue
static constexpr intptr_t kSmiMaxValue
static V8_INLINE constexpr int SmiToInt(Address value)
static V8_INLINE constexpr bool IsValidSmi(T value)
static constexpr intptr_t kSmiMinValue
static constexpr intptr_t kSmiMaxValue
constexpr bool Contains(TagRange tag_range) const
constexpr bool IsEmpty() const
constexpr size_t hash_value() const
constexpr bool operator==(const TagRange other) const
constexpr TagRange(Tag first, Tag last)
constexpr size_t Size() const
constexpr TagRange(Tag tag)
const ExternalPointerTag first
const ExternalPointerTag last
constexpr bool Contains(Tag tag) const
#define V8_LIKELY(condition)