5#ifndef INCLUDE_V8_INTERNAL_H_
6#define INCLUDE_V8_INTERNAL_H_
32static constexpr Address kNullAddress = 0;
34constexpr int KB = 1024;
35constexpr int MB =
KB * 1024;
36constexpr int GB =
MB * 1024;
37#ifdef V8_TARGET_ARCH_X64
38constexpr size_t TB =
size_t{
GB} * 1024;
69template <
size_t tagged_ptr_size>
88 return static_cast<int32_t
>(
static_cast<uint32_t
>(value)) >> shift_bits;
94 return (
static_cast<uintptr_t
>(value) -
113 return static_cast<int>(
static_cast<intptr_t
>(value) >> shift_bits);
117 return (value ==
static_cast<int32_t
>(value));
121#ifdef V8_COMPRESS_POINTERS
124constexpr size_t kPtrComprCageReservationSize =
size_t{1} << 32;
125constexpr size_t kPtrComprCageBaseAlignment =
size_t{1} << 32;
129 "Pointer compression can be enabled only for 64-bit architectures");
139#ifdef V8_31BIT_SMIS_ON_64BIT_ARCH
149const int kSmiMinValue =
static_cast<int>(PlatformSmiTagging::kSmiMinValue);
150const int kSmiMaxValue =
static_cast<int>(PlatformSmiTagging::kSmiMaxValue);
164#ifdef V8_ENABLE_SANDBOX
175#ifdef V8_ENABLE_SANDBOX
178#if defined(V8_TARGET_OS_ANDROID)
182constexpr size_t kSandboxSizeLog2 = 37;
183#elif defined(V8_TARGET_ARCH_LOONG64)
186constexpr size_t kSandboxSizeLog2 = 38;
189constexpr size_t kSandboxSizeLog2 = 40;
191constexpr size_t kSandboxSize = 1ULL << kSandboxSizeLog2;
198constexpr size_t kSandboxAlignment = kPtrComprCageBaseAlignment;
204constexpr uint64_t kSandboxedPointerShift = 64 - kSandboxSizeLog2;
209constexpr size_t kSandboxGuardRegionSize = 32ULL *
GB;
211static_assert((kSandboxGuardRegionSize % kSandboxAlignment) == 0,
212 "The size of the guard regions around the sandbox must be a "
213 "multiple of its required alignment.");
225constexpr size_t kSandboxMinimumReservationSize = 8ULL *
GB;
227static_assert(kSandboxMinimumReservationSize > kPtrComprCageReservationSize,
228 "The minimum reservation size for a sandbox must be larger than "
229 "the pointer compression cage contained within it.");
235constexpr size_t kMaxSafeBufferSizeForSandbox = 32ULL *
GB - 1;
236static_assert(kMaxSafeBufferSizeForSandbox <= kSandboxGuardRegionSize,
237 "The maximum allowed buffer size must not be larger than the "
238 "sandbox's guard regions");
240constexpr size_t kBoundedSizeShift = 29;
241static_assert(1ULL << (64 - kBoundedSizeShift) ==
242 kMaxSafeBufferSizeForSandbox + 1,
243 "The maximum size of a BoundedSize must be synchronized with the "
244 "kMaxSafeBufferSizeForSandbox");
248#ifdef V8_COMPRESS_POINTERS
250#ifdef V8_TARGET_OS_ANDROID
256constexpr size_t kExternalPointerTableReservationSize = 256 *
MB;
261constexpr uint32_t kExternalPointerIndexShift = 7;
263constexpr size_t kExternalPointerTableReservationSize = 512 *
MB;
264constexpr uint32_t kExternalPointerIndexShift = 6;
268constexpr int kExternalPointerTableEntrySize = 8;
269constexpr int kExternalPointerTableEntrySizeLog2 = 3;
271 kExternalPointerTableReservationSize / kExternalPointerTableEntrySize;
273 "kExternalPointerTableReservationSize and "
274 "kExternalPointerIndexShift don't match");
295#ifdef V8_ENABLE_SANDBOX
315#ifdef V8_COMPRESS_POINTERS
333#ifdef V8_ENABLE_SANDBOX
339#ifdef V8_TARGET_OS_ANDROID
363 "kExternalBufferTableReservationSize and "
364 "kExternalBufferHandleShift don't match");
446 0b00001111, 0b00010111, 0b00011011, 0b00011101, 0b00011110, 0b00100111,
447 0b00101011, 0b00101101, 0b00101110, 0b00110011, 0b00110101, 0b00110110,
448 0b00111001, 0b00111010, 0b00111100, 0b01000111, 0b01001011, 0b01001101,
449 0b01001110, 0b01010011, 0b01010101, 0b01010110, 0b01011001, 0b01011010,
450 0b01011100, 0b01100011, 0b01100101, 0b01100110, 0b01101001, 0b01101010,
451 0b01101100, 0b01110001, 0b01110010, 0b01110100, 0b01111000, 0b10000111,
452 0b10001011, 0b10001101, 0b10001110, 0b10010011, 0b10010101, 0b10010110,
453 0b10011001, 0b10011010, 0b10011100, 0b10100011, 0b10100101, 0b10100110,
454 0b10101001, 0b10101010, 0b10101100, 0b10110001, 0b10110010, 0b10110100,
455 0b10111000, 0b11000011, 0b11000101, 0b11000110, 0b11001001, 0b11001010,
456 0b11001100, 0b11010001, 0b11010010, 0b11010100, 0b11011000, 0b11100001,
457 0b11100010, 0b11100100, 0b11101000, 0b11110000};
460 ((kAllExternalPointerTypeTags[i] << kExternalPointerTagShift) | \
461 kExternalPointerMarkBit)
473#define SHARED_EXTERNAL_POINTER_TAGS(V) \
474 V(kFirstSharedTag, TAG(0)) \
475 V(kWaiterQueueNodeTag, TAG(0)) \
476 V(kExternalStringResourceTag, TAG(1)) \
477 V(kExternalStringResourceDataTag, TAG(2)) \
478 V(kLastSharedTag, TAG(2))
482#define PER_ISOLATE_EXTERNAL_POINTER_TAGS(V) \
483 V(kNativeContextMicrotaskQueueTag, TAG(10)) \
484 V(kEmbedderDataSlotPayloadTag, TAG(11)) \
488 V(kExternalObjectValueTag, TAG(12)) \
489 V(kFunctionTemplateInfoCallbackTag, TAG(13)) \
490 V(kAccessorInfoGetterTag, TAG(14)) \
491 V(kAccessorInfoSetterTag, TAG(15)) \
492 V(kWasmInternalFunctionCallTargetTag, TAG(16)) \
493 V(kWasmTypeInfoNativeTypeTag, TAG(17)) \
494 V(kWasmExportedFunctionDataSignatureTag, TAG(18)) \
495 V(kWasmContinuationJmpbufTag, TAG(19)) \
496 V(kWasmIndirectFunctionTargetTag, TAG(20)) \
498 V(kGenericForeignTag, TAG(30)) \
500 V(kFirstManagedResourceTag, TAG(40)) \
501 V(kGenericManagedTag, TAG(40)) \
502 V(kWasmWasmStreamingTag, TAG(41)) \
503 V(kWasmFuncDataTag, TAG(42)) \
504 V(kWasmManagedDataTag, TAG(43)) \
505 V(kWasmNativeModuleTag, TAG(44)) \
506 V(kWasmStackMemoryTag, TAG(45)) \
507 V(kIcuBreakIteratorTag, TAG(46)) \
508 V(kIcuUnicodeStringTag, TAG(47)) \
509 V(kIcuListFormatterTag, TAG(48)) \
510 V(kIcuLocaleTag, TAG(49)) \
511 V(kIcuSimpleDateFormatTag, TAG(50)) \
512 V(kIcuDateIntervalFormatTag, TAG(51)) \
513 V(kIcuRelativeDateTimeFormatterTag, TAG(52)) \
514 V(kIcuLocalizedNumberFormatterTag, TAG(53)) \
515 V(kIcuPluralRulesTag, TAG(54)) \
516 V(kIcuCollatorTag, TAG(55)) \
517 V(kDisplayNamesInternalTag, TAG(56)) \
521 V(kLastManagedResourceTag, TAG(56)) \
522 V(kArrayBufferExtensionTag, TAG(57))
525#define ALL_EXTERNAL_POINTER_TAGS(V) \
526 SHARED_EXTERNAL_POINTER_TAGS(V) \
527 PER_ISOLATE_EXTERNAL_POINTER_TAGS(V)
529#define EXTERNAL_POINTER_TAG_ENUM(Name, Tag) Name = Tag,
530#define MAKE_TAG(HasMarkBit, TypeTag) \
531 ((static_cast<uint64_t>(TypeTag) << kExternalPointerTagShift) | \
532 (HasMarkBit ? kExternalPointerMarkBit : 0))
556#undef EXTERNAL_POINTER_TAG_ENUM
562V8_INLINE static constexpr bool IsSharedExternalPointerType(
570V8_INLINE static constexpr bool IsMaybeReadOnlyExternalPointerType(
580V8_INLINE static constexpr bool IsManagedExternalPointerType(
586#define CHECK_SHARED_EXTERNAL_POINTER_TAGS(Tag, ...) \
587 static_assert(IsSharedExternalPointerType(Tag));
588#define CHECK_NON_SHARED_EXTERNAL_POINTER_TAGS(Tag, ...) \
589 static_assert(!IsSharedExternalPointerType(Tag));
594#undef CHECK_NON_SHARED_EXTERNAL_POINTER_TAGS
595#undef CHECK_SHARED_EXTERNAL_POINTER_TAGS
597#undef SHARED_EXTERNAL_POINTER_TAGS
598#undef EXTERNAL_POINTER_TAGS
658 "kTrustedPointerTableReservationSize and "
659 "kTrustedPointerHandleShift don't match");
707 "kCodePointerTableReservationSize and kCodePointerHandleShift don't match");
737 return mapword ^ kMapWordXorMask;
751#ifdef V8_COMPRESS_POINTERS
761#ifdef V8_ENABLE_SANDBOX
826#ifdef V8_COMPRESS_POINTERS
827 static const int kIsolateExternalPointerTableOffset =
829 static const int kIsolateSharedExternalPointerTableAddressOffset =
831 static const int kIsolateCppHeapPointerTableOffset =
833#ifdef V8_ENABLE_SANDBOX
834 static const int kIsolateTrustedCageBaseOffset =
836 static const int kIsolateTrustedPointerTableOffset =
838 static const int kIsolateExternalBufferTableOffset =
840 static const int kIsolateSharedExternalBufferTableAddressOffset =
857#if V8_STATIC_ROOTS_BOOL
860#define EXPORTED_STATIC_ROOTS_PTR_LIST(V) \
861 V(UndefinedValue, 0x69) \
864 V(FalseValue, 0xad) \
865 V(EmptyString, 0xa1) \
866 V(TheHoleValue, 0x741)
868 using Tagged_t = uint32_t;
869 struct StaticReadOnlyRoot {
870#define DEF_ROOT(name, value) static constexpr Tagged_t k##name = value;
871 EXPORTED_STATIC_ROOTS_PTR_LIST(DEF_ROOT)
874 static constexpr Tagged_t kFirstStringMap = 0xe5;
875 static constexpr Tagged_t kLastStringMap = 0x47d;
877#define PLUSONE(...) +1
878 static constexpr size_t kNumberOfExportedStaticRoots =
879 2 + EXPORTED_STATIC_ROOTS_PTR_LIST(PLUSONE);
924 static const uintptr_t kMapWordMetadataMask = 0xffffULL << 48;
926 static const uintptr_t kMapWordSignature = 0b10;
931 static const int kMapWordXorMask = 0b11;
936#ifdef V8_ENABLE_CHECKS
946 return PlatformSmiTagging::SmiToInt(value);
950 return internal::IntToSmi(value);
954 return PlatformSmiTagging::IsValidSmi(value);
957#if V8_STATIC_ROOTS_BOOL
959 return static_cast<Tagged_t
>(obj) == constant;
962 V8_INLINE static bool CheckInstanceMapRange(
Address obj, Tagged_t first_map,
966 map = UnpackMapWord(map);
968 return map >= first_map && map <= last_map;
975 map = UnpackMapWord(map);
984 map = UnpackMapWord(map);
1005 (
static_cast<unsigned>(
static_cast<unsigned>(instance_type) -
1012 return *addr &
static_cast<uint8_t
>(1U << shift);
1017 uint8_t mask =
static_cast<uint8_t
>(1U << shift);
1018 *addr =
static_cast<uint8_t
>((*addr & ~mask) | (value << shift));
1028 *addr =
static_cast<uint8_t
>((*addr & ~kNodeStateMask) | value);
1035 *
reinterpret_cast<void**
>(addr) = data;
1042 return *
reinterpret_cast<void* const*
>(addr);
1048 ++(*
reinterpret_cast<size_t*
>(addr));
1054 return reinterpret_cast<Address*
>(addr);
1058#if V8_STATIC_ROOTS_BOOL
1062#define DECOMPRESS_ROOT(name, ...) \
1063 case k##name##RootIndex: \
1064 return base + StaticReadOnlyRoot::k##name;
1065 EXPORTED_STATIC_ROOTS_PTR_LIST(DECOMPRESS_ROOT)
1066#undef DECOMPRESS_ROOT
1067#undef EXPORTED_STATIC_ROOTS_PTR_LIST
1075#ifdef V8_ENABLE_SANDBOX
1078 kIsolateExternalPointerTableOffset +
1080 return *
reinterpret_cast<Address**
>(addr);
1086 kIsolateSharedExternalPointerTableAddressOffset;
1087 addr = *
reinterpret_cast<Address*
>(addr);
1089 return *
reinterpret_cast<Address**
>(addr);
1093 template <
typename T>
1096#ifdef V8_COMPRESS_POINTERS
1103 memcpy(&r,
reinterpret_cast<void*
>(addr),
sizeof(T));
1107 return *
reinterpret_cast<const T*
>(addr);
1112#ifdef V8_COMPRESS_POINTERS
1113 uint32_t value = ReadRawField<uint32_t>(heap_object_ptr, offset);
1114 Address base = GetPtrComprCageBaseFromOnHeapAddress(heap_object_ptr);
1115 return base +
static_cast<Address>(
static_cast<uintptr_t
>(value));
1117 return ReadRawField<Address>(heap_object_ptr, offset);
1123#ifdef V8_COMPRESS_POINTERS
1124 uint32_t value = ReadRawField<uint32_t>(heap_object_ptr, offset);
1125 return static_cast<Address>(
static_cast<uintptr_t
>(value));
1127 return ReadRawField<Address>(heap_object_ptr, offset);
1132#ifdef V8_ENABLE_SANDBOX
1141 template <ExternalPo
interTag tag>
1145#ifdef V8_ENABLE_SANDBOX
1149 Address* table = IsSharedExternalPointerType(tag)
1150 ? GetSharedExternalPointerTableBase(isolate)
1151 : GetExternalPointerTableBase(isolate);
1153 ReadRawField<ExternalPointerHandle>(heap_object_ptr, offset);
1154 uint32_t index = handle >> kExternalPointerIndexShift;
1155 std::atomic<Address>* ptr =
1156 reinterpret_cast<std::atomic<Address>*
>(&table[index]);
1157 Address entry = std::atomic_load_explicit(ptr, std::memory_order_relaxed);
1158 return entry & ~tag;
1160 return ReadRawField<Address>(heap_object_ptr, offset);
1164#ifdef V8_COMPRESS_POINTERS
1166 return addr & -
static_cast<intptr_t
>(kPtrComprCageBaseAlignment);
1170 return static_cast<uint32_t
>(value);
1175 Address base = GetPtrComprCageBaseFromOnHeapAddress(heap_object_ptr);
1176 return base +
static_cast<Address>(
static_cast<uintptr_t
>(value));
1184template <
bool PerformCheck>
1202 CastCheck<std::is_base_of<Data, T>::value &&
1203 !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
1218 Heap* heap()
const {
return heap_; }
1221 return heap_ == other.heap_;
1224 return heap_ != other.heap_;
1232 Address* allocate_impl(
size_t n);
1233 void deallocate_impl(
Address* p,
size_t n)
noexcept;
1244template <
typename T>
1251 explicit StrongRootAllocator(
v8::Isolate* isolate) {}
1252 template <
typename U>
1253 StrongRootAllocator(
const StrongRootAllocator<U>& other)
noexcept {}
1255 using std::allocator<T>::allocate;
1256 using std::allocator<T>::deallocate;
1263template <
typename Iterator,
typename ElementType =
void>
1267 !std::is_void_v<ElementType> ||
1268 (std::is_convertible_v<typename std::iterator_traits<Iterator>::pointer,
1270 std::is_convertible_v<typename std::iterator_traits<Iterator>::reference,
1274 typename std::iterator_traits<Iterator>::iterator_category;
1276 typename std::iterator_traits<Iterator>::difference_type;
1278 std::conditional_t<std::is_void_v<ElementType>,
1279 typename std::iterator_traits<Iterator>::value_type,
1282 std::conditional_t<std::is_void_v<ElementType>,
1283 typename std::iterator_traits<Iterator>::pointer,
1286 std::conditional_t<std::is_void_v<ElementType>,
1287 typename std::iterator_traits<Iterator>::reference,
1293 template <
typename OtherIterator,
typename OtherElementType,
1294 std::enable_if_t<std::is_convertible_v<OtherIterator, Iterator>,
1332 return *
this + (-n);
1342 constexpr Iterator
base() const noexcept {
return it_; }
1345 template <
typename OtherIterator,
typename OtherElementType>
1352template <
typename Iterator,
typename ElementType,
typename OtherIterator,
1353 typename OtherElementType>
1355 const WrappedIterator<Iterator, ElementType>& x,
1356 const WrappedIterator<OtherIterator, OtherElementType>& y)
noexcept {
1357 return x.base() == y.base();
1360template <
typename Iterator,
typename ElementType,
typename OtherIterator,
1361 typename OtherElementType>
1363 const WrappedIterator<Iterator, ElementType>& x,
1364 const WrappedIterator<OtherIterator, OtherElementType>& y)
noexcept {
1365 return x.base() < y.base();
1368template <
typename Iterator,
typename ElementType,
typename OtherIterator,
1369 typename OtherElementType>
1371 const WrappedIterator<Iterator, ElementType>& x,
1372 const WrappedIterator<OtherIterator, OtherElementType>& y)
noexcept {
1376template <
typename Iterator,
typename ElementType,
typename OtherIterator,
1377 typename OtherElementType>
1379 const WrappedIterator<Iterator, ElementType>& x,
1380 const WrappedIterator<OtherIterator, OtherElementType>& y)
noexcept {
1384template <
typename Iterator,
typename ElementType,
typename OtherIterator,
1385 typename OtherElementType>
1387 const WrappedIterator<Iterator, ElementType>& x,
1388 const WrappedIterator<OtherIterator, OtherElementType>& y)
noexcept {
1392template <
typename Iterator,
typename ElementType,
typename OtherIterator,
1393 typename OtherElementType>
1395 const WrappedIterator<Iterator, ElementType>& x,
1396 const WrappedIterator<OtherIterator, OtherElementType>& y)
noexcept {
1400template <
typename Iterator,
typename ElementType,
typename OtherIterator,
1401 typename OtherElementType>
1403 const WrappedIterator<Iterator, ElementType>& x,
1404 const WrappedIterator<OtherIterator, OtherElementType>& y)
noexcept
1405 ->
decltype(x.base() - y.base()) {
1406 return x.base() - y.base();
1409template <
typename Iterator,
typename ElementType>
1410constexpr WrappedIterator<Iterator>
operator+(
1412 const WrappedIterator<Iterator, ElementType>& x)
noexcept {
1422#ifdef V8_ENABLE_DIRECT_LOCAL
1423 static constexpr Address kTaggedNullAddress = 1;
1429 template <
typename T>
1437 template <
template <
typename T,
typename... Ms>
typename H,
typename T,
1440 return handle.template value<T>();
1443#ifdef V8_ENABLE_DIRECT_LOCAL
1445 template <
typename T>
1447 return reinterpret_cast<Address>(value);
1450 template <
typename T,
bool check_null = true,
typename S>
1452 if (check_null && slot ==
nullptr) {
1453 return reinterpret_cast<T*
>(kTaggedNullAddress);
1455 return *
reinterpret_cast<T**
>(slot);
1460 template <
typename T>
1465 template <
typename T,
bool check_null = true,
typename S>
1467 return reinterpret_cast<T*
>(slot);
1488 template <
typename T1,
typename T2>
1490 if (lhs.IsEmpty())
return rhs.IsEmpty();
1491 if (rhs.IsEmpty())
return false;
1492 return lhs.ptr() == rhs.ptr();
Definition: v8-isolate.h:210
Definition: v8-internal.h:1204
Definition: v8-internal.h:1472
static bool EqualHandles(const T1 &lhs, const T2 &rhs)
Definition: v8-internal.h:1485
Definition: v8-internal.h:729
static Address LoadMap(Address obj)
Definition: v8-internal.h:976
static bool IsExternalTwoByteString(int instance_type)
Definition: v8-internal.h:989
static const int kIsolateCageBaseOffset
Definition: v8-internal.h:788
static const int kEmbedderDataArrayHeaderSize
Definition: v8-internal.h:755
static const int kHeapObjectMapOffset
Definition: v8-internal.h:740
static const int kEmbedderDataSlotSize
Definition: v8-internal.h:756
static const int kIsolateApiCallbackThunkArgumentOffset
Definition: v8-internal.h:845
static Address ReadExternalPointerField(v8::Isolate *isolate, Address heap_object_ptr, int offset)
Definition: v8-internal.h:1138
static const int kJSAPIObjectWithEmbedderSlotsHeaderSize
Definition: v8-internal.h:751
static constexpr bool HasHeapObjectTag(Address value)
Definition: v8-internal.h:937
static const int kOddballType
Definition: v8-internal.h:894
static const int kInferShouldThrowMode
Definition: v8-internal.h:913
static const int kNewAllocationInfoOffset
Definition: v8-internal.h:800
static Address GetRoot(v8::Isolate *isolate, int index)
Definition: v8-internal.h:1053
static const int kStringEncodingMask
Definition: v8-internal.h:764
static const int kIsolateFastCCallCallerPcOffset
Definition: v8-internal.h:810
static uint8_t GetNodeFlag(Address *obj, int shift)
Definition: v8-internal.h:1006
static const int kIsolateThreadLocalTopOffset
Definition: v8-internal.h:816
static const uint32_t kNumIsolateDataSlots
Definition: v8-internal.h:768
static const int kForeignType
Definition: v8-internal.h:895
static const int kFirstEmbedderJSApiObjectType
Definition: v8-internal.h:902
static const int kNumberOfBooleanFlags
Definition: v8-internal.h:770
static uint8_t GetNodeState(Address *obj)
Definition: v8-internal.h:1017
static const int kThreadLocalTopSize
Definition: v8-internal.h:776
static const int kIsolateRootsOffset
Definition: v8-internal.h:850
static const int kExternalPointerTableSize
Definition: v8-internal.h:782
static const int kUndefinedOddballKind
Definition: v8-internal.h:906
static const int kMapInstanceTypeOffset
Definition: v8-internal.h:741
static const int kIsolateStackGuardOffset
Definition: v8-internal.h:789
static const int kLinearAllocationAreaSize
Definition: v8-internal.h:775
static const int kFastCCallAlignmentPaddingSize
Definition: v8-internal.h:805
static const int kIsolateFastCCallCallerFpOffset
Definition: v8-internal.h:807
static const int kErrorMessageParamSize
Definition: v8-internal.h:771
static void CheckInitialized(v8::Isolate *isolate)
Definition: v8-internal.h:931
static void UpdateNodeState(Address *obj, uint8_t value)
Definition: v8-internal.h:1022
static const int kJSObjectType
Definition: v8-internal.h:897
static const int kBuiltinTier0TableOffset
Definition: v8-internal.h:798
static const int kIsolateLongTaskStatsCounterOffset
Definition: v8-internal.h:814
static const int kNativeContextEmbedderDataOffset
Definition: v8-internal.h:762
static const int kLastJSApiObjectType
Definition: v8-internal.h:899
static constexpr bool CanHaveInternalField(int instance_type)
Definition: v8-internal.h:994
static const int kIsolateHandleScopeDataOffset
Definition: v8-internal.h:818
static const int kFirstNonstringType
Definition: v8-internal.h:893
static const int kEmptyStringRootIndex
Definition: v8-internal.h:886
static const int kBuiltinTier0EntryTableOffset
Definition: v8-internal.h:795
static const int kFixedArrayHeaderSize
Definition: v8-internal.h:754
static const int kNullOddballKind
Definition: v8-internal.h:907
static const int kUndefinedValueRootIndex
Definition: v8-internal.h:881
static const int kExternalTwoByteRepresentationTag
Definition: v8-internal.h:765
static const int kExternalBufferTableSize
Definition: v8-internal.h:783
static constexpr Address IntToSmi(int value)
Definition: v8-internal.h:945
static const int kDontThrow
Definition: v8-internal.h:912
static void CheckInitializedImpl(v8::Isolate *isolate)
static void * GetEmbedderData(const v8::Isolate *isolate, uint32_t slot)
Definition: v8-internal.h:1034
static const int kStackGuardSize
Definition: v8-internal.h:769
static const int kNodeStateMask
Definition: v8-internal.h:890
static const int kNodeStateIsWeakValue
Definition: v8-internal.h:891
static const int kFirstJSApiObjectType
Definition: v8-internal.h:898
static const int kStringResourceOffset
Definition: v8-internal.h:742
static const int kErrorMessageParamOffset
Definition: v8-internal.h:793
static const int kExternalPointerTableBasePointerOffset
Definition: v8-internal.h:781
static const int kFalseValueRootIndex
Definition: v8-internal.h:885
static const int kIsolateFastApiCallTargetOffset
Definition: v8-internal.h:812
static const int kTrueValueRootIndex
Definition: v8-internal.h:884
static int GetInstanceType(Address obj)
Definition: v8-internal.h:968
static const int kThrowOnError
Definition: v8-internal.h:911
static Address ReadTaggedSignedField(Address heap_object_ptr, int offset)
Definition: v8-internal.h:1117
static const int kOddballKindOffset
Definition: v8-internal.h:745
static const int kBuiltinTier0TableSize
Definition: v8-internal.h:774
static const int kContinuationPreservedEmbedderDataOffset
Definition: v8-internal.h:848
static Address ReadTaggedPointerField(Address heap_object_ptr, int offset)
Definition: v8-internal.h:1106
static constexpr bool IsValidSmi(intptr_t value)
Definition: v8-internal.h:949
static const int kNullValueRootIndex
Definition: v8-internal.h:883
static void SetEmbedderData(v8::Isolate *isolate, uint32_t slot, void *data)
Definition: v8-internal.h:1027
static Address * GetRootSlot(v8::Isolate *isolate, int index)
Definition: v8-internal.h:1047
static const int kTrustedPointerTableSize
Definition: v8-internal.h:784
static const int kTheHoleValueRootIndex
Definition: v8-internal.h:882
static constexpr int SmiValue(Address value)
Definition: v8-internal.h:941
static const int kTablesAlignmentPaddingSize
Definition: v8-internal.h:772
static const int kHandleScopeDataSize
Definition: v8-internal.h:777
static const int kExternalOneByteRepresentationTag
Definition: v8-internal.h:766
static const int kBuiltinTier0EntryTableSize
Definition: v8-internal.h:773
static void UpdateNodeFlag(Address *obj, bool value, int shift)
Definition: v8-internal.h:1011
static void IncrementLongTasksStatsCounter(v8::Isolate *isolate)
Definition: v8-internal.h:1041
static const int kOldAllocationInfoOffset
Definition: v8-internal.h:802
static const int kIsolateEmbedderDataOffset
Definition: v8-internal.h:820
static T ReadRawField(Address heap_object_ptr, int offset)
Definition: v8-internal.h:1090
static const int kEmbedderDataSlotExternalPointerOffset
Definition: v8-internal.h:760
static int GetOddballKind(Address obj)
Definition: v8-internal.h:985
static const int kNodeFlagsOffset
Definition: v8-internal.h:889
static const int kTrustedPointerTableBasePointerOffset
Definition: v8-internal.h:785
static const int kLastEmbedderJSApiObjectType
Definition: v8-internal.h:903
static const int kVariousBooleanFlagsOffset
Definition: v8-internal.h:791
static const int kNodeClassIdOffset
Definition: v8-internal.h:888
static const int kStringRepresentationAndEncodingMask
Definition: v8-internal.h:763
static constexpr int kExternalAllocationSoftLimit
Definition: v8-internal.h:917
static const int kJSObjectHeaderSize
Definition: v8-internal.h:746
static v8::Isolate * GetIsolateForSandbox(Address obj)
Definition: v8-internal.h:1127
static const int kJSSpecialApiObjectType
Definition: v8-internal.h:896
Definition: v8-internal.h:1212
Definition: v8-internal.h:1241
T value_type
Definition: v8-internal.h:1243
StrongRootAllocator(const StrongRootAllocator< U > &other) noexcept
Definition: v8-internal.h:1249
Definition: v8-internal.h:1416
static Address ValueAsAddress(const T *value)
Definition: v8-internal.h:1457
static constexpr Address kEmpty
Definition: v8-internal.h:1422
static T * SlotAsValue(S *slot)
Definition: v8-internal.h:1462
static T * HandleAsValue(const H< T, Ms... > &handle)
Definition: v8-internal.h:1435
static bool IsEmpty(T *value)
Definition: v8-internal.h:1426
Definition: v8-internal.h:1260
constexpr WrappedIterator & operator-=(difference_type n) noexcept
Definition: v8-internal.h:1330
constexpr WrappedIterator operator--(int) noexcept
Definition: v8-internal.h:1313
constexpr WrappedIterator & operator+=(difference_type n) noexcept
Definition: v8-internal.h:1323
constexpr Iterator base() const noexcept
Definition: v8-internal.h:1338
std::conditional_t< std::is_void_v< ElementType >, typename std::iterator_traits< Iterator >::reference, ElementType & > reference
Definition: v8-internal.h:1284
std::conditional_t< std::is_void_v< ElementType >, typename std::iterator_traits< Iterator >::value_type, ElementType > value_type
Definition: v8-internal.h:1276
constexpr WrappedIterator & operator++() noexcept
Definition: v8-internal.h:1299
constexpr pointer operator->() const noexcept
Definition: v8-internal.h:1297
constexpr reference operator[](difference_type n) const noexcept
Definition: v8-internal.h:1334
typename std::iterator_traits< Iterator >::difference_type difference_type
Definition: v8-internal.h:1272
std::conditional_t< std::is_void_v< ElementType >, typename std::iterator_traits< Iterator >::pointer, ElementType * > pointer
Definition: v8-internal.h:1280
constexpr WrappedIterator & operator--() noexcept
Definition: v8-internal.h:1309
typename std::iterator_traits< Iterator >::iterator_category iterator_category
Definition: v8-internal.h:1270
constexpr reference operator*() const noexcept
Definition: v8-internal.h:1296
constexpr WrappedIterator operator+(difference_type n) const noexcept
Definition: v8-internal.h:1318
constexpr WrappedIterator operator++(int) noexcept
Definition: v8-internal.h:1303
constexpr WrappedIterator operator-(difference_type n) const noexcept
Definition: v8-internal.h:1327
friend class WrappedIterator
Definition: v8-internal.h:1342
const intptr_t kHeapObjectTagMask
Definition: v8-internal.h:54
constexpr int kCodePointerTableEntrySizeLog2
Definition: v8-internal.h:698
constexpr bool kRuntimeGeneratedCodeObjectsLiveInTrustedSpace
Definition: v8-internal.h:710
uint32_t ExternalBufferHandle
Definition: v8-internal.h:328
internal::Isolate * IsolateFromNeverReadOnlySpaceObject(Address obj)
constexpr uint64_t kExternalPointerTagShift
Definition: v8-internal.h:439
IndirectPointerHandle TrustedPointerHandle
Definition: v8-internal.h:633
const int kApiSystemPointerSize
Definition: v8-internal.h:44
constexpr bool SandboxIsEnabled()
Definition: v8-internal.h:163
constexpr size_t kExternalBufferTableReservationSize
Definition: v8-internal.h:349
const int kApiDoubleSize
Definition: v8-internal.h:45
constexpr bool operator<=(const WrappedIterator< Iterator, ElementType > &x, const WrappedIterator< OtherIterator, OtherElementType > &y) noexcept
Definition: v8-internal.h:1390
constexpr intptr_t kIntptrAllBitsSet
Definition: v8-internal.h:72
constexpr int GB
Definition: v8-internal.h:36
void VerifyHandleIsNonEmpty(bool is_empty)
const int kApiInt32Size
Definition: v8-internal.h:46
const int kForwardingTagSize
Definition: v8-internal.h:61
uint32_t CppHeapPointerHandle
Definition: v8-internal.h:309
const intptr_t kForwardingTagMask
Definition: v8-internal.h:62
IndirectPointerHandle CodePointerHandle
Definition: v8-internal.h:671
constexpr size_t kMaxExternalBufferPointers
Definition: v8-internal.h:359
const int kSmiTagSize
Definition: v8-internal.h:66
const int kApiInt64Size
Definition: v8-internal.h:47
constexpr int kExternalBufferTableEntrySizeLog2
Definition: v8-internal.h:358
constexpr uint64_t kExternalPointerTagMask
Definition: v8-internal.h:437
constexpr int kCodePointerTableEntryCodeObjectOffset
Definition: v8-internal.h:706
constexpr int kTrustedPointerTableEntrySizeLog2
Definition: v8-internal.h:650
constexpr int kTrustedPointerTableEntrySize
Definition: v8-internal.h:649
constexpr ExternalPointer_t kNullExternalPointer
Definition: v8-internal.h:301
constexpr bool operator>(const WrappedIterator< Iterator, ElementType > &x, const WrappedIterator< OtherIterator, OtherElementType > &y) noexcept
Definition: v8-internal.h:1374
Address ExternalPointer_t
Definition: v8-internal.h:298
constexpr WrappedIterator< Iterator > operator+(typename WrappedIterator< Iterator, ElementType >::difference_type n, const WrappedIterator< Iterator, ElementType > &x) noexcept
Definition: v8-internal.h:1406
uint32_t IndirectPointerHandle
Definition: v8-internal.h:613
constexpr CppHeapPointer_t kNullCppHeapPointer
Definition: v8-internal.h:321
const int kApiSizetSize
Definition: v8-internal.h:48
constexpr int kCodePointerTableEntryEntrypointOffset
Definition: v8-internal.h:705
constexpr size_t kMaxExternalPointers
Definition: v8-internal.h:279
constexpr uint64_t kExternalPointerTagMaskWithoutMarkBit
Definition: v8-internal.h:438
constexpr size_t kCodePointerTableReservationSize
Definition: v8-internal.h:676
constexpr TrustedPointerHandle kNullTrustedPointerHandle
Definition: v8-internal.h:645
constexpr ExternalBufferHandle kNullExternalBufferHandle
Definition: v8-internal.h:354
constexpr uint64_t kAllExternalPointerTypeTags[]
Definition: v8-internal.h:445
const int kWeakHeapObjectTag
Definition: v8-internal.h:52
constexpr ExternalPointerHandle kNullExternalPointerHandle
Definition: v8-internal.h:302
constexpr bool operator<(const WrappedIterator< Iterator, ElementType > &x, const WrappedIterator< OtherIterator, OtherElementType > &y) noexcept
Definition: v8-internal.h:1358
constexpr bool operator!=(const WrappedIterator< Iterator, ElementType > &x, const WrappedIterator< OtherIterator, OtherElementType > &y) noexcept
Definition: v8-internal.h:1366
constexpr uintptr_t kUintptrAllBitsSet
Definition: v8-internal.h:73
const int kForwardingTag
Definition: v8-internal.h:60
const intptr_t kHeapObjectReferenceTagMask
Definition: v8-internal.h:55
constexpr bool SmiValuesAre31Bits()
Definition: v8-internal.h:151
constexpr size_t kMaxTrustedPointers
Definition: v8-internal.h:651
bool ShouldThrowOnError(internal::Isolate *isolate)
constexpr auto operator-(const WrappedIterator< Iterator, ElementType > &x, const WrappedIterator< OtherIterator, OtherElementType > &y) noexcept -> decltype(x.base() - y.base())
Definition: v8-internal.h:1398
constexpr int KB
Definition: v8-internal.h:34
constexpr bool kBuiltinCodeObjectsLiveInTrustedSpace
Definition: v8-internal.h:711
constexpr bool operator>=(const WrappedIterator< Iterator, ElementType > &x, const WrappedIterator< OtherIterator, OtherElementType > &y) noexcept
Definition: v8-internal.h:1382
constexpr uint32_t kTrustedPointerHandleShift
Definition: v8-internal.h:642
constexpr uint32_t kCodePointerHandleShift
Definition: v8-internal.h:680
const int kHeapObjectTag
Definition: v8-internal.h:51
const int kSmiShiftSize
Definition: v8-internal.h:147
constexpr size_t kMaxCodePointers
Definition: v8-internal.h:699
SmiTagging< kApiTaggedSize > PlatformSmiTagging
Definition: v8-internal.h:142
const int kSmiValueSize
Definition: v8-internal.h:148
constexpr bool SmiValuesAre32Bits()
Definition: v8-internal.h:152
constexpr IndirectPointerHandle kNullIndirectPointerHandle
Definition: v8-internal.h:616
uintptr_t Address
Definition: v8-internal.h:31
void PerformCastCheck(T *data)
Definition: v8-internal.h:1197
constexpr size_t kTrustedPointerTableReservationSize
Definition: v8-internal.h:638
uint32_t ExternalPointerHandle
Definition: v8-internal.h:290
const intptr_t kSmiTagMask
Definition: v8-internal.h:67
constexpr uint32_t kExternalBufferHandleShift
Definition: v8-internal.h:350
const int kHeapObjectTagSize
Definition: v8-internal.h:53
const int kSmiMaxValue
Definition: v8-internal.h:150
Address ExternalBuffer_t
Definition: v8-internal.h:336
constexpr bool Is64()
Definition: v8-internal.h:153
constexpr bool kAllCodeObjectsLiveInTrustedSpace
Definition: v8-internal.h:712
constexpr bool operator==(const WrappedIterator< Iterator, ElementType > &x, const WrappedIterator< OtherIterator, OtherElementType > &y) noexcept
Definition: v8-internal.h:1350
const int kSmiTag
Definition: v8-internal.h:65
constexpr CodePointerHandle kNullCodePointerHandle
Definition: v8-internal.h:683
Address CppHeapPointer_t
Definition: v8-internal.h:318
constexpr CppHeapPointerHandle kNullCppHeapPointerHandle
Definition: v8-internal.h:322
constexpr int kGarbageCollectionReasonMaxValue
Definition: v8-internal.h:1208
constexpr int kCodePointerTableEntrySize
Definition: v8-internal.h:697
constexpr int kExternalBufferTableEntrySize
Definition: v8-internal.h:357
ExternalPointerTag
Definition: v8-internal.h:533
@ kExternalPointerEvacuationEntryTag
Definition: v8-internal.h:546
@ kAccessorInfoGetterTag
Definition: v8-internal.h:551
@ kFirstSharedTag
Definition: v8-internal.h:551
@ kAccessorInfoSetterTag
Definition: v8-internal.h:551
@ kAnyForeignTag
Definition: v8-internal.h:540
@ kExternalPointerFreeEntryTag
Definition: v8-internal.h:544
@ kAnyExternalPointerTag
Definition: v8-internal.h:537
@ kLastSharedTag
Definition: v8-internal.h:551
@ kExternalPointerNullTag
Definition: v8-internal.h:535
@ kLastManagedResourceTag
Definition: v8-internal.h:551
@ kExternalPointerZappedEntryTag
Definition: v8-internal.h:549
@ kFirstManagedResourceTag
Definition: v8-internal.h:551
@ kFunctionTemplateInfoCallbackTag
Definition: v8-internal.h:551
constexpr uint32_t kCodePointerHandleMarker
Definition: v8-internal.h:692
const int kSmiMinValue
Definition: v8-internal.h:149
constexpr int MB
Definition: v8-internal.h:35
constexpr uint64_t kExternalPointerMarkBit
Definition: v8-internal.h:436
Address SandboxedPointer_t
Definition: v8-internal.h:173
const int kApiTaggedSize
Definition: v8-internal.h:132
constexpr bool PointerCompressionIsEnabled()
Definition: v8-internal.h:135
Definition: libplatform.h:15
Definition: v8-internal.h:1181
static void Perform(T *data)
static constexpr int SmiToInt(Address value)
Definition: v8-internal.h:85
static constexpr bool IsValidSmi(intptr_t value)
Definition: v8-internal.h:90
static constexpr int SmiToInt(Address value)
Definition: v8-internal.h:110
static constexpr bool IsValidSmi(intptr_t value)
Definition: v8-internal.h:115
Definition: v8-internal.h:70
#define EXTERNAL_POINTER_TAG_ENUM(Name, Tag)
Definition: v8-internal.h:529
#define ALL_EXTERNAL_POINTER_TAGS(V)
Definition: v8-internal.h:525
#define CHECK_NON_SHARED_EXTERNAL_POINTER_TAGS(Tag,...)
Definition: v8-internal.h:587
#define SHARED_EXTERNAL_POINTER_TAGS(V)
Definition: v8-internal.h:473
#define MAKE_TAG(HasMarkBit, TypeTag)
Definition: v8-internal.h:530
#define PER_ISOLATE_EXTERNAL_POINTER_TAGS(V)
Definition: v8-internal.h:482
#define CHECK_SHARED_EXTERNAL_POINTER_TAGS(Tag,...)
Definition: v8-internal.h:585
#define V8_EXPORT
Definition: v8config.h:762
#define V8_INLINE
Definition: v8config.h:477