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
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());
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");
452 constexpr TagRange(Tag first, Tag last) : first(first), last(last) {}
460 : first(tag), last(tag) {}
466 constexpr bool IsEmpty()
const {
return first == 0 && last == 0; }
468 constexpr size_t Size()
const {
472 return last - first + 1;
480 return static_cast<uint32_t
>(tag) - first <=
481 static_cast<uint32_t
>(last) -
first;
489 return first == other.first && last == other.last;
493 static_assert(std::is_same_v<std::underlying_type_t<Tag>, uint16_t>);
494 return (
static_cast<size_t>(first) << 16) |
last;
767 "kTrustedPointerTableReservationSize and "
768 "kTrustedPointerHandleShift don't match");
816 "kCodePointerTableReservationSize and kCodePointerHandleShift don't match");
846 return mapword ^ kMapWordXorMask;
860#ifdef V8_COMPRESS_POINTERS
870#ifdef V8_ENABLE_SANDBOX
936#ifdef V8_COMPRESS_POINTERS
937 static const int kIsolateExternalPointerTableOffset =
939 static const int kIsolateSharedExternalPointerTableAddressOffset =
941 static const int kIsolateCppHeapPointerTableOffset =
943#ifdef V8_ENABLE_SANDBOX
944 static const int kIsolateTrustedCageBaseOffset =
946 static const int kIsolateTrustedPointerTableOffset =
948 static const int kIsolateSharedTrustedPointerTableAddressOffset =
950 static const int kIsolateTrustedPointerPublishingScopeOffset =
952 static const int kIsolateCodePointerTableBaseAddressOffset =
975#if V8_STATIC_ROOTS_BOOL
978#define EXPORTED_STATIC_ROOTS_PTR_LIST(V) \
979 V(UndefinedValue, 0x11) \
982 V(FalseValue, 0x55) \
983 V(EmptyString, 0x49) \
984 V(TheHoleValue, 0x761)
987 struct StaticReadOnlyRoot {
988#define DEF_ROOT(name, value) static constexpr Tagged_t k##name = value;
989 EXPORTED_STATIC_ROOTS_PTR_LIST(DEF_ROOT)
993 static constexpr Tagged_t kStringMapLowerBound = 0;
994 static constexpr Tagged_t kStringMapUpperBound = 0x425;
996#define PLUSONE(...) +1
997 static constexpr size_t kNumberOfExportedStaticRoots =
998 2 + EXPORTED_STATIC_ROOTS_PTR_LIST(PLUSONE);
1042#ifdef V8_MAP_PACKING
1043 static const uintptr_t kMapWordMetadataMask = 0xffffULL << 48;
1045 static const uintptr_t kMapWordSignature = 0b10;
1050 static const int kMapWordXorMask = 0b11;
1055#ifdef V8_ENABLE_CHECKS
1065 return PlatformSmiTagging::SmiToInt(value);
1069 return (value << (
kSmiTagSize + PlatformSmiTagging::kSmiShiftSize)) |
1077 template <
typename T,
1078 typename std::enable_if_t<std::is_integral_v<T>>* =
nullptr>
1083 template <
typename T,
1084 typename std::enable_if_t<std::is_integral_v<T>>* =
nullptr>
1086 return PlatformSmiTagging::IsValidSmi(value);
1089 template <
typename T,
1090 typename std::enable_if_t<std::is_integral_v<T>>* =
nullptr>
1092 if (
V8_LIKELY(PlatformSmiTagging::IsValidSmi(value))) {
1098#if V8_STATIC_ROOTS_BOOL
1100 return static_cast<Tagged_t>(obj) == constant;
1106#ifdef V8_MAP_PACKING
1107 map = UnpackMapWord(map);
1109 return map >= first_map && map <= last_map;
1115#ifdef V8_MAP_PACKING
1116 map = UnpackMapWord(map);
1124#ifdef V8_MAP_PACKING
1125 map = UnpackMapWord(map);
1146 (
static_cast<unsigned>(
static_cast<unsigned>(instance_type) -
1153 return *addr &
static_cast<uint8_t
>(1U << shift);
1158 uint8_t
mask =
static_cast<uint8_t
>(1U << shift);
1159 *addr =
static_cast<uint8_t
>((*addr & ~mask) | (value << shift));
1169 *addr =
static_cast<uint8_t
>((*addr & ~kNodeStateMask) |
value);
1176 *
reinterpret_cast<void**
>(addr) = data;
1183 return *
reinterpret_cast<void* const*
>(addr);
1189 ++(*
reinterpret_cast<size_t*
>(addr));
1195 return reinterpret_cast<Address*
>(addr);
1199#if V8_STATIC_ROOTS_BOOL
1203#define DECOMPRESS_ROOT(name, ...) \
1204 case k##name##RootIndex: \
1205 return base + StaticReadOnlyRoot::k##name;
1206 EXPORTED_STATIC_ROOTS_PTR_LIST(DECOMPRESS_ROOT)
1207#undef DECOMPRESS_ROOT
1208#undef EXPORTED_STATIC_ROOTS_PTR_LIST
1216#ifdef V8_ENABLE_SANDBOX
1219 kIsolateExternalPointerTableOffset +
1221 return *
reinterpret_cast<Address**
>(addr);
1227 kIsolateSharedExternalPointerTableAddressOffset;
1228 addr = *
reinterpret_cast<Address*
>(addr);
1230 return *
reinterpret_cast<Address**
>(addr);
1234 template <
typename T>
1237#ifdef V8_COMPRESS_POINTERS
1244 memcpy(&
r,
reinterpret_cast<void*
>(addr),
sizeof(T));
1248 return *
reinterpret_cast<const T*
>(addr);
1253#ifdef V8_COMPRESS_POINTERS
1264#ifdef V8_COMPRESS_POINTERS
1266 return static_cast<Address>(
static_cast<uintptr_t
>(
value));
1273#ifdef V8_ENABLE_SANDBOX
1282 template <ExternalPo
interTagRange tag_range>
1286#ifdef V8_ENABLE_SANDBOX
1287 static_assert(!tag_range.IsEmpty());
1291 ? GetSharedExternalPointerTableBase(isolate)
1292 : GetExternalPointerTableBase(isolate);
1295 uint32_t index =
handle >> kExternalPointerIndexShift;
1296 std::atomic<Address>* ptr =
1297 reinterpret_cast<std::atomic<Address>*
>(&table[
index]);
1298 Address entry = std::atomic_load_explicit(ptr, std::memory_order_relaxed);
1301 if (
V8_LIKELY(tag_range.Contains(actual_tag))) {
1312#ifdef V8_COMPRESS_POINTERS
1314 return addr & -
static_cast<intptr_t
>(kPtrComprCageBaseAlignment);
1318 return static_cast<uint32_t
>(
value);
1332template <
bool PerformCheck>
1351 !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
1372 return a.heap_ == b.
heap_;
1383 Address* allocate_impl(
size_t n);
1384 void deallocate_impl(Address* p,
size_t n)
noexcept;
1395template <
typename T>
1400 template <
typename HeapOrIsolateT>
1402 template <
typename U>
1405 using std::allocator<T>::allocate;
1406 using std::allocator<T>::deallocate;
1411template <
typename Iterator,
typename =
void>
1413template <
typename Iterator>
1415 Iterator, std::void_t<typename Iterator::iterator_concept>> =
true;
1417template <
typename Iterator,
typename =
void>
1419template <
typename Iterator>
1421 Iterator, std::void_t<typename Iterator::iterator_category>> =
true;
1426template <
typename Iterator,
typename =
void>
1429template <
typename Iterator>
1431 Iterator,
std::enable_if_t<kHaveIteratorConcept<Iterator>>> {
1435template <
typename Iterator>
1437 Iterator,
std::enable_if_t<kHaveIteratorCategory<Iterator> &&
1438 !kHaveIteratorConcept<Iterator>>> {
1444#if __has_include(<ranges>)
1445 using iterator_concept =
1446 typename std::iterator_traits<Iterator>::iterator_concept;
1454template <
typename Iterator,
typename ElementType =
void>
1458 std::is_void_v<ElementType> ||
1459 (std::is_convertible_v<typename std::iterator_traits<Iterator>::pointer,
1460 std::add_pointer_t<ElementType>> &&
1461 std::is_convertible_v<typename std::iterator_traits<Iterator>::reference,
1462 std::add_lvalue_reference_t<ElementType>>));
1465 typename std::iterator_traits<Iterator>::difference_type;
1467 std::conditional_t<std::is_void_v<ElementType>,
1468 typename std::iterator_traits<Iterator>::value_type,
1471 std::conditional_t<std::is_void_v<ElementType>,
1472 typename std::iterator_traits<Iterator>::pointer,
1473 std::add_pointer_t<ElementType>>;
1475 std::conditional_t<std::is_void_v<ElementType>,
1476 typename std::iterator_traits<Iterator>::reference,
1477 std::add_lvalue_reference_t<ElementType>>;
1479 typename std::iterator_traits<Iterator>::iterator_category;
1486 template <
typename OtherIterator,
typename OtherElementType,
1487 typename = std::enable_if_t<
1488 std::is_convertible_v<OtherIterator, Iterator>>>
1491 :
it_(other.base()) {}
1495 if constexpr (std::is_pointer_v<Iterator>) {
1498 return it_.operator->();
1502 template <
typename OtherIterator,
typename OtherElementType>
1506 return it_ == other.base();
1508#if V8_HAVE_SPACESHIP_OPERATOR
1509 template <
typename OtherIterator,
typename OtherElementType>
1510 [[nodiscard]]
constexpr auto operator<=>(
1513 if constexpr (std::three_way_comparable_with<Iterator, OtherIterator>) {
1515 }
else if constexpr (std::totally_ordered_with<Iterator, OtherIterator>) {
1516 if (
it_ < other.base()) {
1517 return std::strong_ordering::less;
1519 return (
it_ > other.base()) ? std::strong_ordering::greater
1520 : std::strong_ordering::equal;
1522 if (
it_ < other.base()) {
1523 return std::partial_ordering::less;
1525 if (other.base() <
it_) {
1526 return std::partial_ordering::greater;
1528 return (
it_ == other.base()) ? std::partial_ordering::equivalent
1529 : std::partial_ordering::unordered;
1535 template <
typename OtherIterator,
typename OtherElementType>
1539 return it_ != other.base();
1542 template <
typename OtherIterator,
typename OtherElementType>
1546 return it_ < other.base();
1548 template <
typename OtherIterator,
typename OtherElementType>
1552 return it_ <= other.base();
1554 template <
typename OtherIterator,
typename OtherElementType>
1558 return it_ > other.base();
1560 template <
typename OtherIterator,
typename OtherElementType>
1564 return it_ >= other.base();
1608 template <
typename OtherIterator,
typename OtherElementType>
1612 return it_ - other.base();
1619 [[nodiscard]]
constexpr const Iterator&
base() const noexcept {
return it_; }
1636#ifdef V8_ENABLE_DIRECT_HANDLE
1646 template <
typename T>
1654 template <
template <
typename T,
typename... Ms>
typename H,
typename T,
1660#ifdef V8_ENABLE_DIRECT_HANDLE
1662 template <
typename T>
1667 template <
typename T,
bool check_null = true,
typename S>
1669 if (check_null && slot ==
nullptr) {
1672 return *
reinterpret_cast<T**
>(slot);
1675 template <
typename T>
1680 template <
typename T>
1682 return reinterpret_cast<T*
>(repr);
1687 template <
typename T>
1692 template <
typename T,
bool check_null = true,
typename S>
1694 return reinterpret_cast<T*
>(slot);
1697 template <
typename T>
1703 template <
typename T>
1705 return reinterpret_cast<T*
>(repr);
1726 template <
typename T1,
typename T2>
1728 if (lhs.IsEmpty())
return rhs.IsEmpty();
1729 if (rhs.IsEmpty())
return false;
1730 return lhs.ptr() == rhs.ptr();
static V8_INLINE bool EqualHandles(const T1 &lhs, const T2 &rhs)
static V8_INLINE Address LoadMap(Address obj)
static constexpr size_t kExternalAllocationSoftLimit
static V8_INLINE constexpr bool HasHeapObjectTag(Address value)
static const int kIsolateCageBaseOffset
static const int kEmbedderDataArrayHeaderSize
static const int kHeapObjectMapOffset
static const int kEmbedderDataSlotSize
static const int kIsolateApiCallbackThunkArgumentOffset
static const int kJSAPIObjectWithEmbedderSlotsHeaderSize
static const int kOddballType
static V8_INLINE void * GetEmbedderData(const v8::Isolate *isolate, uint32_t slot)
static const int kInferShouldThrowMode
static const int kNewAllocationInfoOffset
static const int kStringEncodingMask
static const int kIsolateFastCCallCallerPcOffset
static V8_INLINE void CheckInitialized(v8::Isolate *isolate)
static const int kIsolateThreadLocalTopOffset
static V8_INLINE Address GetRoot(v8::Isolate *isolate, int index)
static const uint32_t kNumIsolateDataSlots
static const int kForeignType
static V8_INLINE constexpr bool CanHaveInternalField(int instance_type)
static V8_INLINE T ReadRawField(Address heap_object_ptr, int offset)
static const int kFirstEmbedderJSApiObjectType
static const int kNumberOfBooleanFlags
static V8_INLINE constexpr Address IntToSmi(int value)
static const int kThreadLocalTopSize
static const int kIsolateRootsOffset
static V8_INLINE Address ReadTaggedPointerField(Address heap_object_ptr, int offset)
static const int kExternalPointerTableSize
static const int kUndefinedOddballKind
static const int kMapInstanceTypeOffset
static V8_INLINE uint8_t GetNodeFlag(Address *obj, int shift)
static const int kIsolateStackGuardOffset
static const int kLinearAllocationAreaSize
static const int kFastCCallAlignmentPaddingSize
static const int kDisallowGarbageCollectionAlign
static const int kIsolateFastCCallCallerFpOffset
static const int kErrorMessageParamSize
static const int kJSObjectType
static const int kBuiltinTier0TableOffset
static V8_INLINE constexpr Address IntegralToSmi(T value)
static const int kIsolateLongTaskStatsCounterOffset
static const int kNativeContextEmbedderDataOffset
static const int kLastJSApiObjectType
static const int kIsolateHandleScopeDataOffset
static const int kFirstNonstringType
static const int kEmptyStringRootIndex
static const int kBuiltinTier0EntryTableOffset
static const int kFixedArrayHeaderSize
static const int kNullOddballKind
static const int kUndefinedValueRootIndex
static const int kExternalTwoByteRepresentationTag
static const int kDontThrow
static V8_INLINE int GetOddballKind(Address obj)
static const int kStackGuardSize
static V8_INLINE Address * GetRootSlot(v8::Isolate *isolate, int index)
static const int kNodeStateMask
static V8_INLINE int GetInstanceType(Address obj)
static V8_INLINE void UpdateNodeFlag(Address *obj, bool value, int shift)
static const int kNodeStateIsWeakValue
static const int kFirstJSApiObjectType
static const int kStringResourceOffset
static const int kErrorMessageParamOffset
static const int kExternalPointerTableBasePointerOffset
static const int kFalseValueRootIndex
static const int kIsolateRegexpExecVectorArgumentOffset
static const int kIsolateFastApiCallTargetOffset
static const int kTrueValueRootIndex
static const int kThrowOnError
static const int kOddballKindOffset
static const int kBuiltinTier0TableSize
static V8_INLINE Address ReadTaggedSignedField(Address heap_object_ptr, int offset)
static const int kContinuationPreservedEmbedderDataOffset
static V8_INLINE constexpr int SmiValue(Address value)
static const int kNullValueRootIndex
static V8_INLINE void SetEmbedderData(v8::Isolate *isolate, uint32_t slot, void *data)
static const int kTrustedPointerTableSize
static const int kTheHoleValueRootIndex
static V8_INLINE void UpdateNodeState(Address *obj, uint8_t value)
static const int kTablesAlignmentPaddingSize
static V8_EXPORT void CheckInitializedImpl(v8::Isolate *isolate)
static V8_INLINE constexpr Address AddressToSmi(Address value)
static V8_INLINE Address ReadExternalPointerField(v8::Isolate *isolate, Address heap_object_ptr, int offset)
static const int kHandleScopeDataSize
static const int kExternalOneByteRepresentationTag
static const int kBuiltinTier0EntryTableSize
static const int kDisallowGarbageCollectionSize
static const int kOldAllocationInfoOffset
static const int kIsolateEmbedderDataOffset
static V8_INLINE uint8_t GetNodeState(Address *obj)
static const int kEmbedderDataSlotExternalPointerOffset
static const int kNodeFlagsOffset
static const int kTrustedPointerTableBasePointerOffset
static const int kRegExpStaticResultOffsetsVectorSize
static const int kLastEmbedderJSApiObjectType
static const int kVariousBooleanFlagsOffset
static constexpr std::optional< Address > TryIntegralToSmi(T value)
static const int kNodeClassIdOffset
static const int kStringRepresentationAndEncodingMask
static const int kJSObjectHeaderSize
static V8_INLINE void IncrementLongTasksStatsCounter(v8::Isolate *isolate)
static const int kJSSpecialApiObjectType
static V8_INLINE bool IsExternalTwoByteString(int instance_type)
static V8_INLINE constexpr bool IsValidSmi(T value)
static V8_INLINE v8::Isolate * GetIsolateForSandbox(Address obj)
friend bool operator==(const StrongRootAllocatorBase &a, const StrongRootAllocatorBase &b)
StrongRootAllocatorBase(Heap *heap)
StrongRootAllocator(HeapOrIsolateT *)
StrongRootAllocator(const StrongRootAllocator< U > &other) noexcept
static V8_INLINE Address ValueAsAddress(const T *value)
static V8_INLINE T * SlotAsValue(S *slot)
internal::Address * InternalRepresentationType
static V8_INLINE bool IsEmpty(T *value)
static V8_INLINE InternalRepresentationType ValueAsRepr(const T *value)
static V8_INLINE T * HandleAsValue(const H< T, Ms... > &handle)
static V8_INLINE T * ReprAsValue(InternalRepresentationType repr)
static constexpr InternalRepresentationType kEmpty
std::conditional_t< std::is_void_v< ElementType >, typename std::iterator_traits< Iterator >::pointer, std::add_pointer_t< ElementType > > pointer
constexpr WrappedIterator & operator-=(difference_type n) noexcept
constexpr WrappedIterator operator--(int) noexcept
constexpr WrappedIterator & operator+=(difference_type n) noexcept
constexpr const Iterator & base() const noexcept
constexpr WrappedIterator & operator++() noexcept
constexpr pointer operator->() const noexcept
typename std::iterator_traits< Iterator >::difference_type difference_type
std::conditional_t< std::is_void_v< ElementType >, typename std::iterator_traits< Iterator >::reference, std::add_lvalue_reference_t< ElementType > > reference
constexpr reference operator[](difference_type n) const noexcept
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--() noexcept
constexpr WrappedIterator() noexcept=default
typename std::iterator_traits< Iterator >::iterator_category iterator_category
constexpr bool operator<=(const WrappedIterator< OtherIterator, OtherElementType > &other) const noexcept
constexpr WrappedIterator(const WrappedIterator< OtherIterator, OtherElementType > &other) noexcept
constexpr bool operator>(const WrappedIterator< OtherIterator, OtherElementType > &other) const noexcept
constexpr reference operator*() const noexcept
constexpr auto operator-(const WrappedIterator< OtherIterator, OtherElementType > &other) const noexcept
friend constexpr WrappedIterator operator+(difference_type n, const WrappedIterator &x) noexcept
constexpr WrappedIterator operator+(difference_type n) const noexcept
constexpr WrappedIterator operator++(int) noexcept
constexpr WrappedIterator operator-(difference_type n) const noexcept
constexpr bool operator==(const WrappedIterator< OtherIterator, OtherElementType > &other) const noexcept
std::conditional_t< std::is_void_v< ElementType >, typename std::iterator_traits< Iterator >::value_type, ElementType > value_type
ZoneVector< RpoNumber > & result
const intptr_t kHeapObjectTagMask
V8_INLINE IndirectHandle< T > handle(Tagged< T > object, Isolate *isolate)
constexpr uint64_t kCppHeapPointerMarkBit
constexpr int kCodePointerTableEntrySizeLog2
constexpr bool kRuntimeGeneratedCodeObjectsLiveInTrustedSpace
IndirectPointerHandle TrustedPointerHandle
constexpr uint64_t kExternalPointerTagShift
const int kApiSystemPointerSize
constexpr Address kTaggedNullAddress
constexpr bool SandboxIsEnabled()
constexpr size_t kMaxCppHeapPointers
constexpr intptr_t kIntptrAllBitsSet
V8_INLINE constexpr PtrComprCageBase GetPtrComprCageBaseFromOnHeapAddress(Address address)
void VerifyHandleIsNonEmpty(bool is_empty)
const int kForwardingTagSize
static V8_INLINE constexpr bool IsSharedExternalPointerType(ExternalPointerTagRange tag_range)
const intptr_t kForwardingTagMask
void PrintPropertyCallbackInfo(void *property_callback_info)
constexpr ExternalPointerTagRange kAnyManagedResourceExternalPointerTag(kFirstManagedResourceTag, kLastManagedResourceTag)
constexpr uint64_t kExternalPointerPayloadMask
constexpr ExternalPointerTagRange kAnyExternalPointerTagRange(kFirstExternalPointerTag, kLastExternalPointerTag)
constexpr uint64_t kExternalPointerTagMask
constexpr int kCodePointerTableEntryCodeObjectOffset
constexpr int kTrustedPointerTableEntrySizeLog2
constexpr int kTrustedPointerTableEntrySize
constexpr uint64_t kCppHeapPointerPayloadShift
constexpr ExternalPointer_t kNullExternalPointer
IndirectPointerHandle CodePointerHandle
constexpr CppHeapPointer_t kNullCppHeapPointer
constexpr ExternalPointerTagRange kAnySharedExternalPointerTagRange(kFirstSharedExternalPointerTag, kLastSharedExternalPointerTag)
V8_EXPORT internal::Isolate * IsolateFromNeverReadOnlySpaceObject(Address obj)
Address SandboxedPointer_t
constexpr uint64_t kExternalPointerTagAndMarkbitMask
constexpr int kCodePointerTableEntryEntrypointOffset
constexpr size_t kMaxExternalPointers
constexpr size_t kCodePointerTableReservationSize
constexpr TrustedPointerHandle kNullTrustedPointerHandle
uint32_t IndirectPointerHandle
const int kWeakHeapObjectTag
constexpr ExternalPointerHandle kNullExternalPointerHandle
constexpr ExternalPointerTagRange kAnyMaybeReadOnlyExternalPointerTagRange(kFirstMaybeReadOnlyExternalPointerTag, kLastMaybeReadOnlyExternalPointerTag)
Address ExternalPointer_t
constexpr uintptr_t kUintptrAllBitsSet
const intptr_t kHeapObjectReferenceTagMask
constexpr bool SmiValuesAre31Bits()
constexpr size_t kMaxTrustedPointers
constexpr uint64_t kCppHeapPointerTagShift
constexpr ExternalPointerTagRange kAnyInterceptorInfoExternalPointerTagRange(kFirstInterceptorInfoExternalPointerTag, kLastInterceptorInfoExternalPointerTag)
static V8_INLINE constexpr bool IsMaybeReadOnlyExternalPointerType(ExternalPointerTagRange tag_range)
constexpr bool kBuiltinCodeObjectsLiveInTrustedSpace
constexpr uint32_t kTrustedPointerHandleShift
V8_INLINE void PerformCastCheck(T *data)
constexpr uint32_t kCodePointerHandleShift
constexpr ExternalPointerTagRange kAnyManagedExternalPointerTagRange(kFirstManagedExternalPointerTag, kLastManagedExternalPointerTag)
constexpr size_t kMaxCodePointers
constexpr bool kHaveIteratorCategory
@ kLastForeignExternalPointerTag
@ kApiIndexedPropertyDescriptorCallbackTag
@ kFirstMaybeReadOnlyExternalPointerTag
@ kExternalPointerEvacuationEntryTag
@ kFirstSharedExternalPointerTag
@ kApiNamedPropertyDefinerCallbackTag
@ kWasmExportedFunctionDataSignatureTag
@ kLastSharedExternalPointerTag
@ kApiIndexedPropertySetterCallbackTag
@ kLastExternalPointerTag
@ kMicrotaskCallbackDataTag
@ kApiIndexedPropertyGetterCallbackTag
@ kApiNamedPropertyDescriptorCallbackTag
@ kIcuSimpleDateFormatTag
@ kApiIndexedPropertyDefinerCallbackTag
@ kD8ModuleEmbedderDataTag
@ kExternalStringResourceTag
@ kExternalObjectValueTag
@ kApiNamedPropertyDeleterCallbackTag
@ kWasmIndirectFunctionTargetTag
@ kApiAccessCheckCallbackTag
@ kApiAbortScriptExecutionCallbackTag
@ kIcuLocalizedNumberFormatterTag
@ kApiNamedPropertyGetterCallbackTag
@ kApiIndexedPropertyEnumeratorCallbackTag
@ kWasmInternalFunctionCallTargetTag
@ kExternalPointerFreeEntryTag
@ kFirstInterceptorInfoExternalPointerTag
@ kLastManagedExternalPointerTag
@ kExternalPointerNullTag
@ kExternalStringResourceDataTag
@ kLastManagedResourceTag
@ kExternalPointerZappedEntryTag
@ kApiNamedPropertyQueryCallbackTag
@ kWasmTypeInfoNativeTypeTag
@ kEmbedderDataSlotPayloadTag
@ kFirstForeignExternalPointerTag
@ kDisplayNamesInternalTag
@ kFirstManagedResourceTag
@ kFirstManagedExternalPointerTag
@ kApiIndexedPropertyQueryCallbackTag
@ kApiIndexedPropertyDeleterCallbackTag
@ kLastInterceptorInfoExternalPointerTag
@ kIcuRelativeDateTimeFormatterTag
@ kNativeContextMicrotaskQueueTag
@ kLastMaybeReadOnlyExternalPointerTag
@ kArrayBufferExtensionTag
@ kIcuDateIntervalFormatTag
@ kFirstExternalPointerTag
@ kApiNamedPropertyEnumeratorCallbackTag
@ kFunctionTemplateInfoCallbackTag
kApiNamedPropertySetterCallbackTag
constexpr ExternalPointerTagRange kAnyForeignExternalPointerTagRange(kFirstForeignExternalPointerTag, kLastForeignExternalPointerTag)
constexpr bool SmiValuesAre32Bits()
constexpr IndirectPointerHandle kNullIndirectPointerHandle
static V8_INLINE constexpr bool IsManagedExternalPointerType(ExternalPointerTagRange tag_range)
void PrintFunctionCallbackInfo(void *function_callback_info)
uint32_t ExternalPointerHandle
constexpr size_t kTrustedPointerTableReservationSize
const intptr_t kSmiTagMask
const int kHeapObjectTagSize
constexpr bool kAllCodeObjectsLiveInTrustedSpace
uint32_t CppHeapPointerHandle
constexpr CodePointerHandle kNullCodePointerHandle
static constexpr Address kNullAddress
constexpr CppHeapPointerHandle kNullCppHeapPointerHandle
constexpr int kGarbageCollectionReasonMaxValue
constexpr int kCodePointerTableEntrySize
static V8_INLINE constexpr Address IntToSmi(int value)
SmiTagging< kApiTaggedSize > PlatformSmiTagging
constexpr uint32_t kCodePointerHandleMarker
V8_EXPORT bool ShouldThrowOnError(internal::Isolate *isolate)
constexpr bool kHaveIteratorConcept
too high values may cause the compiler to set high thresholds for inlining to as much as possible avoid inlined allocation of objects that cannot escape trace load stores from virtual maglev objects use TurboFan fast string builder analyze liveness of environment slots and zap dead values trace TurboFan load elimination emit data about basic block usage in builtins to this enable builtin reordering when run mksnapshot flag for emit warnings when applying builtin profile data verify register allocation in TurboFan randomly schedule instructions to stress dependency tracking enable store store elimination in TurboFan rewrite far to near simulate GC compiler thread race related to allow float parameters to be passed in simulator mode JS Wasm Run additional turbo_optimize_inlined_js_wasm_wrappers enable experimental feedback collection in generic lowering enable Turboshaft s WasmLoadElimination enable Turboshaft s low level load elimination for JS enable Turboshaft s escape analysis for string concatenation use enable Turbolev features that we want to ship in the not too far future trace individual Turboshaft reduction steps trace intermediate Turboshaft reduction steps invocation count threshold for early optimization Enables optimizations which favor memory size over execution speed Enables sampling allocation profiler with X as a sample interval min size of a semi the new space consists of two semi spaces max size of the Collect garbage after Collect garbage after keeps maps alive for< n > old space garbage collections print one detailed trace line in allocation gc speed threshold for starting incremental marking via a task in percent of available threshold for starting incremental marking immediately in percent of available Use a single schedule for determining a marking schedule between JS and C objects schedules the minor GC task with kUserVisible priority max worker number of concurrent for NumberOfWorkerThreads start background threads that allocate memory concurrent_array_buffer_sweeping use parallel threads to clear weak refs in the atomic pause trace progress of the incremental marking trace object counts and memory usage * MB
constexpr uint64_t kExternalPointerShiftedTagMask
constexpr uint64_t kExternalPointerMarkBit
static V8_INLINE constexpr bool ExternalPointerCanBeEmpty(ExternalPointerTagRange tag_range)
constexpr bool PointerCompressionIsEnabled()
static void Perform(T *data)
typename Iterator::iterator_concept iterator_concept
static V8_INLINE constexpr bool IsValidSmi(uint64_t value)
static V8_INLINE constexpr bool IsValidSmi(int64_t value)
static V8_INLINE constexpr int SmiToInt(Address value)
static V8_INLINE constexpr bool IsValidSmi(T value)
static V8_INLINE constexpr bool IsValidSmi(T value)
static V8_INLINE constexpr int SmiToInt(Address value)
constexpr size_t Size() const
constexpr bool IsEmpty() const
constexpr bool operator==(const TagRange other) const
constexpr bool Contains(Tag tag) const
constexpr TagRange(Tag tag)
constexpr size_t hash_value() const
constexpr TagRange(Tag first, Tag last)
constexpr bool Contains(TagRange tag_range) const
#define T1(name, string, precedence)
#define T2(name, string, precedence)
#define V8_LIKELY(condition)