5#ifndef INCLUDE_V8_INTERNAL_H_
6#define INCLUDE_V8_INTERNAL_H_
34static constexpr Address kNullAddress = 0;
36constexpr int KB = 1024;
37constexpr int MB =
KB * 1024;
38constexpr int GB =
MB * 1024;
39#ifdef V8_TARGET_ARCH_X64
40constexpr size_t TB =
size_t{
GB} * 1024;
71template <
size_t tagged_ptr_size>
90 return static_cast<int32_t
>(
static_cast<uint32_t
>(value)) >> shift_bits;
93 template <
class T,
typename std::enable_if_t<std::is_
integral_v<T> &&
94 std::is_
signed_v<T>>* =
nullptr>
99 return (
static_cast<uintptr_t
>(value) -
106 typename std::enable_if_t<std::is_integral_v<T> &&
107 std::is_unsigned_v<T>>* =
nullptr>
109 static_assert(kSmiMaxValue <= std::numeric_limits<uintptr_t>::max());
116 return (
static_cast<uint64_t
>(value) -
123 static_assert(kSmiMaxValue <= std::numeric_limits<uint64_t>::max());
140 return static_cast<int>(
static_cast<intptr_t
>(value) >> shift_bits);
143 template <
class T,
typename std::enable_if_t<std::is_
integral_v<T> &&
144 std::is_
signed_v<T>>* =
nullptr>
147 return (value ==
static_cast<int32_t
>(value));
151 typename std::enable_if_t<std::is_integral_v<T> &&
152 std::is_unsigned_v<T>>* =
nullptr>
154 return (
static_cast<uintptr_t
>(value) ==
155 static_cast<uintptr_t
>(
static_cast<int32_t
>(value)));
159#ifdef V8_COMPRESS_POINTERS
162constexpr size_t kPtrComprCageReservationSize =
size_t{1} << 32;
163constexpr size_t kPtrComprCageBaseAlignment =
size_t{1} << 32;
167 "Pointer compression can be enabled only for 64-bit architectures");
177#ifdef V8_31BIT_SMIS_ON_64BIT_ARCH
187const int kSmiMinValue =
static_cast<int>(PlatformSmiTagging::kSmiMinValue);
188const int kSmiMaxValue =
static_cast<int>(PlatformSmiTagging::kSmiMaxValue);
202#ifdef V8_ENABLE_SANDBOX
213#ifdef V8_ENABLE_SANDBOX
216#if defined(V8_TARGET_OS_ANDROID)
220constexpr size_t kSandboxSizeLog2 = 37;
221#elif defined(V8_TARGET_ARCH_LOONG64)
224constexpr size_t kSandboxSizeLog2 = 38;
227constexpr size_t kSandboxSizeLog2 = 40;
229constexpr size_t kSandboxSize = 1ULL << kSandboxSizeLog2;
236constexpr size_t kSandboxAlignment = kPtrComprCageBaseAlignment;
242constexpr uint64_t kSandboxedPointerShift = 64 - kSandboxSizeLog2;
247constexpr size_t kSandboxGuardRegionSize = 32ULL *
GB;
249static_assert((kSandboxGuardRegionSize % kSandboxAlignment) == 0,
250 "The size of the guard regions around the sandbox must be a "
251 "multiple of its required alignment.");
263constexpr size_t kSandboxMinimumReservationSize = 8ULL *
GB;
265static_assert(kSandboxMinimumReservationSize > kPtrComprCageReservationSize,
266 "The minimum reservation size for a sandbox must be larger than "
267 "the pointer compression cage contained within it.");
273constexpr size_t kMaxSafeBufferSizeForSandbox = 32ULL *
GB - 1;
274static_assert(kMaxSafeBufferSizeForSandbox <= kSandboxGuardRegionSize,
275 "The maximum allowed buffer size must not be larger than the "
276 "sandbox's guard regions");
278constexpr size_t kBoundedSizeShift = 29;
279static_assert(1ULL << (64 - kBoundedSizeShift) ==
280 kMaxSafeBufferSizeForSandbox + 1,
281 "The maximum size of a BoundedSize must be synchronized with the "
282 "kMaxSafeBufferSizeForSandbox");
286#ifdef V8_COMPRESS_POINTERS
288#ifdef V8_TARGET_OS_ANDROID
294constexpr size_t kExternalPointerTableReservationSize = 256 *
MB;
299constexpr uint32_t kExternalPointerIndexShift = 7;
301constexpr size_t kExternalPointerTableReservationSize = 512 *
MB;
302constexpr uint32_t kExternalPointerIndexShift = 6;
306constexpr int kExternalPointerTableEntrySize = 8;
307constexpr int kExternalPointerTableEntrySizeLog2 = 3;
309 kExternalPointerTableReservationSize / kExternalPointerTableEntrySize;
311 "kExternalPointerTableReservationSize and "
312 "kExternalPointerIndexShift don't match");
333#ifdef V8_ENABLE_SANDBOX
353#ifdef V8_COMPRESS_POINTERS
366#ifdef V8_COMPRESS_POINTERS
370constexpr size_t kCppHeapPointerTableReservationSize =
371 kExternalPointerTableReservationSize;
372constexpr uint32_t kCppHeapPointerIndexShift = kExternalPointerIndexShift;
374constexpr int kCppHeapPointerTableEntrySize = 8;
375constexpr int kCppHeapPointerTableEntrySizeLog2 = 3;
377 kCppHeapPointerTableReservationSize / kCppHeapPointerTableEntrySize;
379 "kCppHeapPointerTableReservationSize and "
380 "kCppHeapPointerIndexShift don't match");
398#ifdef V8_ENABLE_SANDBOX
404#ifdef V8_TARGET_OS_ANDROID
428 "kExternalBufferTableReservationSize and "
429 "kExternalBufferHandleShift don't match");
511 0b00001111, 0b00010111, 0b00011011, 0b00011101, 0b00011110, 0b00100111,
512 0b00101011, 0b00101101, 0b00101110, 0b00110011, 0b00110101, 0b00110110,
513 0b00111001, 0b00111010, 0b00111100, 0b01000111, 0b01001011, 0b01001101,
514 0b01001110, 0b01010011, 0b01010101, 0b01010110, 0b01011001, 0b01011010,
515 0b01011100, 0b01100011, 0b01100101, 0b01100110, 0b01101001, 0b01101010,
516 0b01101100, 0b01110001, 0b01110010, 0b01110100, 0b01111000, 0b10000111,
517 0b10001011, 0b10001101, 0b10001110, 0b10010011, 0b10010101, 0b10010110,
518 0b10011001, 0b10011010, 0b10011100, 0b10100011, 0b10100101, 0b10100110,
519 0b10101001, 0b10101010, 0b10101100, 0b10110001, 0b10110010, 0b10110100,
520 0b10111000, 0b11000011, 0b11000101, 0b11000110, 0b11001001, 0b11001010,
521 0b11001100, 0b11010001, 0b11010010, 0b11010100, 0b11011000, 0b11100001,
522 0b11100010, 0b11100100, 0b11101000, 0b11110000};
525 ((kAllTagsForAndBasedTypeChecking[i] << kExternalPointerTagShift) | \
526 kExternalPointerMarkBit)
538#define SHARED_EXTERNAL_POINTER_TAGS(V) \
539 V(kFirstSharedTag, TAG(0)) \
540 V(kWaiterQueueNodeTag, TAG(0)) \
541 V(kExternalStringResourceTag, TAG(1)) \
542 V(kExternalStringResourceDataTag, TAG(2)) \
543 V(kLastSharedTag, TAG(2))
548#define PER_ISOLATE_EXTERNAL_POINTER_TAGS(V) \
549 V(kNativeContextMicrotaskQueueTag, TAG(5)) \
550 V(kEmbedderDataSlotPayloadTag, TAG(6)) \
554 V(kExternalObjectValueTag, TAG(7)) \
555 V(kFunctionTemplateInfoCallbackTag, TAG(8)) \
556 V(kAccessorInfoGetterTag, TAG(9)) \
557 V(kAccessorInfoSetterTag, TAG(10)) \
558 V(kWasmInternalFunctionCallTargetTag, TAG(11)) \
559 V(kWasmTypeInfoNativeTypeTag, TAG(12)) \
560 V(kWasmExportedFunctionDataSignatureTag, TAG(13)) \
561 V(kWasmContinuationJmpbufTag, TAG(14)) \
562 V(kWasmStackMemoryTag, TAG(15)) \
563 V(kWasmIndirectFunctionTargetTag, TAG(16)) \
565 V(kGenericForeignTag, TAG(20)) \
566 V(kApiNamedPropertyQueryCallbackTag, TAG(21)) \
567 V(kApiNamedPropertyGetterCallbackTag, TAG(22)) \
568 V(kApiNamedPropertySetterCallbackTag, TAG(23)) \
569 V(kApiNamedPropertyDescriptorCallbackTag, TAG(24)) \
570 V(kApiNamedPropertyDefinerCallbackTag, TAG(25)) \
571 V(kApiNamedPropertyDeleterCallbackTag, TAG(26)) \
572 V(kApiIndexedPropertyQueryCallbackTag, TAG(27)) \
573 V(kApiIndexedPropertyGetterCallbackTag, TAG(28)) \
574 V(kApiIndexedPropertySetterCallbackTag, TAG(29)) \
575 V(kApiIndexedPropertyDescriptorCallbackTag, TAG(30)) \
576 V(kApiIndexedPropertyDefinerCallbackTag, TAG(31)) \
577 V(kApiIndexedPropertyDeleterCallbackTag, TAG(32)) \
578 V(kApiIndexedPropertyEnumeratorCallbackTag, TAG(33)) \
579 V(kApiAccessCheckCallbackTag, TAG(34)) \
580 V(kApiAbortScriptExecutionCallbackTag, TAG(35)) \
581 V(kSyntheticModuleTag, TAG(36)) \
582 V(kMicrotaskCallbackTag, TAG(37)) \
583 V(kMicrotaskCallbackDataTag, TAG(38)) \
584 V(kCFunctionTag, TAG(39)) \
585 V(kCFunctionInfoTag, TAG(40)) \
586 V(kMessageListenerTag, TAG(41)) \
587 V(kWaiterQueueForeignTag, TAG(42)) \
589 V(kFirstManagedResourceTag, TAG(50)) \
590 V(kGenericManagedTag, TAG(50)) \
591 V(kWasmWasmStreamingTag, TAG(51)) \
592 V(kWasmFuncDataTag, TAG(52)) \
593 V(kWasmManagedDataTag, TAG(53)) \
594 V(kWasmNativeModuleTag, TAG(54)) \
595 V(kIcuBreakIteratorTag, TAG(55)) \
596 V(kIcuUnicodeStringTag, TAG(56)) \
597 V(kIcuListFormatterTag, TAG(57)) \
598 V(kIcuLocaleTag, TAG(58)) \
599 V(kIcuSimpleDateFormatTag, TAG(59)) \
600 V(kIcuDateIntervalFormatTag, TAG(60)) \
601 V(kIcuRelativeDateTimeFormatterTag, TAG(61)) \
602 V(kIcuLocalizedNumberFormatterTag, TAG(62)) \
603 V(kIcuPluralRulesTag, TAG(63)) \
604 V(kIcuCollatorTag, TAG(64)) \
605 V(kDisplayNamesInternalTag, TAG(65)) \
609 V(kArrayBufferExtensionTag, TAG(66)) \
610 V(kLastManagedResourceTag, TAG(66)) \
613#define ALL_EXTERNAL_POINTER_TAGS(V) \
614 SHARED_EXTERNAL_POINTER_TAGS(V) \
615 PER_ISOLATE_EXTERNAL_POINTER_TAGS(V)
617#define EXTERNAL_POINTER_TAG_ENUM(Name, Tag) Name = Tag,
618#define MAKE_TAG(HasMarkBit, TypeTag) \
619 ((static_cast<uint64_t>(TypeTag) << kExternalPointerTagShift) | \
620 (HasMarkBit ? kExternalPointerMarkBit : 0))
644#undef EXTERNAL_POINTER_TAG_ENUM
650V8_INLINE static constexpr bool IsSharedExternalPointerType(
658V8_INLINE static constexpr bool IsMaybeReadOnlyExternalPointerType(
668V8_INLINE static constexpr bool IsManagedExternalPointerType(
674#define CHECK_SHARED_EXTERNAL_POINTER_TAGS(Tag, ...) \
675 static_assert(IsSharedExternalPointerType(Tag));
676#define CHECK_NON_SHARED_EXTERNAL_POINTER_TAGS(Tag, ...) \
677 static_assert(!IsSharedExternalPointerType(Tag));
682#undef CHECK_NON_SHARED_EXTERNAL_POINTER_TAGS
683#undef CHECK_SHARED_EXTERNAL_POINTER_TAGS
685#undef SHARED_EXTERNAL_POINTER_TAGS
686#undef EXTERNAL_POINTER_TAGS
746 "kTrustedPointerTableReservationSize and "
747 "kTrustedPointerHandleShift don't match");
795 "kCodePointerTableReservationSize and kCodePointerHandleShift don't match");
828 "kJSDispatchTableReservationSize and kJSDispatchEntryHandleShift "
848 return mapword ^ kMapWordXorMask;
862#ifdef V8_COMPRESS_POINTERS
872#ifdef V8_ENABLE_SANDBOX
937#ifdef V8_COMPRESS_POINTERS
938 static const int kIsolateExternalPointerTableOffset =
940 static const int kIsolateSharedExternalPointerTableAddressOffset =
942 static const int kIsolateCppHeapPointerTableOffset =
944#ifdef V8_ENABLE_SANDBOX
945 static const int kIsolateTrustedCageBaseOffset =
947 static const int kIsolateTrustedPointerTableOffset =
949 static const int kIsolateExternalBufferTableOffset =
951 static const int kIsolateSharedExternalBufferTableAddressOffset =
972#if V8_STATIC_ROOTS_BOOL
975#define EXPORTED_STATIC_ROOTS_PTR_LIST(V) \
976 V(UndefinedValue, 0x69) \
979 V(FalseValue, 0xad) \
980 V(EmptyString, 0xa1) \
981 V(TheHoleValue, 0x741)
983 using Tagged_t = uint32_t;
984 struct StaticReadOnlyRoot {
985#define DEF_ROOT(name, value) static constexpr Tagged_t k##name = value;
986 EXPORTED_STATIC_ROOTS_PTR_LIST(DEF_ROOT)
990 static constexpr Tagged_t kStringMapLowerBound = 0;
991 static constexpr Tagged_t kStringMapUpperBound = 0x47d;
993#define PLUSONE(...) +1
994 static constexpr size_t kNumberOfExportedStaticRoots =
995 2 + EXPORTED_STATIC_ROOTS_PTR_LIST(PLUSONE);
1039#ifdef V8_MAP_PACKING
1040 static const uintptr_t kMapWordMetadataMask = 0xffffULL << 48;
1042 static const uintptr_t kMapWordSignature = 0b10;
1047 static const int kMapWordXorMask = 0b11;
1052#ifdef V8_ENABLE_CHECKS
1062 return PlatformSmiTagging::SmiToInt(value);
1074 template <
typename T,
1075 typename std::enable_if_t<std::is_integral_v<T>>* =
nullptr>
1080 template <
typename T,
1081 typename std::enable_if_t<std::is_integral_v<T>>* =
nullptr>
1083 return PlatformSmiTagging::IsValidSmi(value);
1086 template <
typename T,
1087 typename std::enable_if_t<std::is_integral_v<T>>* =
nullptr>
1089 if (
V8_LIKELY(PlatformSmiTagging::IsValidSmi(value))) {
1095#if V8_STATIC_ROOTS_BOOL
1097 return static_cast<Tagged_t
>(obj) == constant;
1100 V8_INLINE static bool CheckInstanceMapRange(
Address obj, Tagged_t first_map,
1101 Tagged_t last_map) {
1103#ifdef V8_MAP_PACKING
1104 map = UnpackMapWord(map);
1106 return map >= first_map && map <= last_map;
1112#ifdef V8_MAP_PACKING
1113 map = UnpackMapWord(map);
1121#ifdef V8_MAP_PACKING
1122 map = UnpackMapWord(map);
1143 (
static_cast<unsigned>(
static_cast<unsigned>(instance_type) -
1150 return *addr &
static_cast<uint8_t
>(1U << shift);
1155 uint8_t mask =
static_cast<uint8_t
>(1U << shift);
1156 *addr =
static_cast<uint8_t
>((*addr & ~mask) | (value << shift));
1166 *addr =
static_cast<uint8_t
>((*addr & ~kNodeStateMask) | value);
1173 *
reinterpret_cast<void**
>(addr) = data;
1180 return *
reinterpret_cast<void* const*
>(addr);
1186 ++(*
reinterpret_cast<size_t*
>(addr));
1192 return reinterpret_cast<Address*
>(addr);
1196#if V8_STATIC_ROOTS_BOOL
1200#define DECOMPRESS_ROOT(name, ...) \
1201 case k##name##RootIndex: \
1202 return base + StaticReadOnlyRoot::k##name;
1203 EXPORTED_STATIC_ROOTS_PTR_LIST(DECOMPRESS_ROOT)
1204#undef DECOMPRESS_ROOT
1205#undef EXPORTED_STATIC_ROOTS_PTR_LIST
1213#ifdef V8_ENABLE_SANDBOX
1216 kIsolateExternalPointerTableOffset +
1218 return *
reinterpret_cast<Address**
>(addr);
1224 kIsolateSharedExternalPointerTableAddressOffset;
1225 addr = *
reinterpret_cast<Address*
>(addr);
1227 return *
reinterpret_cast<Address**
>(addr);
1231 template <
typename T>
1234#ifdef V8_COMPRESS_POINTERS
1241 memcpy(&r,
reinterpret_cast<void*
>(addr),
sizeof(T));
1245 return *
reinterpret_cast<const T*
>(addr);
1250#ifdef V8_COMPRESS_POINTERS
1251 uint32_t value = ReadRawField<uint32_t>(heap_object_ptr, offset);
1252 Address base = GetPtrComprCageBaseFromOnHeapAddress(heap_object_ptr);
1253 return base +
static_cast<Address>(
static_cast<uintptr_t
>(value));
1255 return ReadRawField<Address>(heap_object_ptr, offset);
1261#ifdef V8_COMPRESS_POINTERS
1262 uint32_t value = ReadRawField<uint32_t>(heap_object_ptr, offset);
1263 return static_cast<Address>(
static_cast<uintptr_t
>(value));
1265 return ReadRawField<Address>(heap_object_ptr, offset);
1270#ifdef V8_ENABLE_SANDBOX
1279 template <ExternalPo
interTag tag>
1283#ifdef V8_ENABLE_SANDBOX
1287 Address* table = IsSharedExternalPointerType(tag)
1288 ? GetSharedExternalPointerTableBase(isolate)
1289 : GetExternalPointerTableBase(isolate);
1291 ReadRawField<ExternalPointerHandle>(heap_object_ptr, offset);
1292 uint32_t index = handle >> kExternalPointerIndexShift;
1293 std::atomic<Address>* ptr =
1294 reinterpret_cast<std::atomic<Address>*
>(&table[index]);
1295 Address entry = std::atomic_load_explicit(ptr, std::memory_order_relaxed);
1296 return entry & ~tag;
1298 return ReadRawField<Address>(heap_object_ptr, offset);
1302#ifdef V8_COMPRESS_POINTERS
1304 return addr & -
static_cast<intptr_t
>(kPtrComprCageBaseAlignment);
1308 return static_cast<uint32_t
>(value);
1313 Address base = GetPtrComprCageBaseFromOnHeapAddress(heap_object_ptr);
1314 return base +
static_cast<Address>(
static_cast<uintptr_t
>(value));
1322template <
bool PerformCheck>
1340 CastCheck<std::is_base_of<Data, T>::value &&
1341 !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
1356 Heap* heap()
const {
return heap_; }
1359 return heap_ == other.heap_;
1362 return heap_ != other.heap_;
1370 Address* allocate_impl(
size_t n);
1371 void deallocate_impl(
Address* p,
size_t n)
noexcept;
1382template <
typename T>
1389 explicit StrongRootAllocator(
v8::Isolate* isolate) {}
1390 template <
typename U>
1391 StrongRootAllocator(
const StrongRootAllocator<U>& other)
noexcept {}
1393 using std::allocator<T>::allocate;
1394 using std::allocator<T>::deallocate;
1401template <
typename Iterator,
typename ElementType =
void>
1405 !std::is_void_v<ElementType> ||
1406 (std::is_convertible_v<typename std::iterator_traits<Iterator>::pointer,
1408 std::is_convertible_v<typename std::iterator_traits<Iterator>::reference,
1412 typename std::iterator_traits<Iterator>::iterator_category;
1414 typename std::iterator_traits<Iterator>::difference_type;
1416 std::conditional_t<std::is_void_v<ElementType>,
1417 typename std::iterator_traits<Iterator>::value_type,
1420 std::conditional_t<std::is_void_v<ElementType>,
1421 typename std::iterator_traits<Iterator>::pointer,
1424 std::conditional_t<std::is_void_v<ElementType>,
1425 typename std::iterator_traits<Iterator>::reference,
1431 template <
typename OtherIterator,
typename OtherElementType,
1432 std::enable_if_t<std::is_convertible_v<OtherIterator, Iterator>,
1470 return *
this + (-n);
1480 constexpr Iterator
base() const noexcept {
return it_; }
1483 template <
typename OtherIterator,
typename OtherElementType>
1490template <
typename Iterator,
typename ElementType,
typename OtherIterator,
1491 typename OtherElementType>
1493 const WrappedIterator<Iterator, ElementType>& x,
1494 const WrappedIterator<OtherIterator, OtherElementType>& y)
noexcept {
1495 return x.base() == y.base();
1498template <
typename Iterator,
typename ElementType,
typename OtherIterator,
1499 typename OtherElementType>
1501 const WrappedIterator<Iterator, ElementType>& x,
1502 const WrappedIterator<OtherIterator, OtherElementType>& y)
noexcept {
1503 return x.base() < y.base();
1506template <
typename Iterator,
typename ElementType,
typename OtherIterator,
1507 typename OtherElementType>
1509 const WrappedIterator<Iterator, ElementType>& x,
1510 const WrappedIterator<OtherIterator, OtherElementType>& y)
noexcept {
1514template <
typename Iterator,
typename ElementType,
typename OtherIterator,
1515 typename OtherElementType>
1517 const WrappedIterator<Iterator, ElementType>& x,
1518 const WrappedIterator<OtherIterator, OtherElementType>& y)
noexcept {
1522template <
typename Iterator,
typename ElementType,
typename OtherIterator,
1523 typename OtherElementType>
1525 const WrappedIterator<Iterator, ElementType>& x,
1526 const WrappedIterator<OtherIterator, OtherElementType>& y)
noexcept {
1530template <
typename Iterator,
typename ElementType,
typename OtherIterator,
1531 typename OtherElementType>
1533 const WrappedIterator<Iterator, ElementType>& x,
1534 const WrappedIterator<OtherIterator, OtherElementType>& y)
noexcept {
1538template <
typename Iterator,
typename ElementType,
typename OtherIterator,
1539 typename OtherElementType>
1541 const WrappedIterator<Iterator, ElementType>& x,
1542 const WrappedIterator<OtherIterator, OtherElementType>& y)
noexcept
1543 ->
decltype(x.base() - y.base()) {
1544 return x.base() - y.base();
1547template <
typename Iterator,
typename ElementType>
1548constexpr WrappedIterator<Iterator>
operator+(
1550 const WrappedIterator<Iterator, ElementType>& x)
noexcept {
1560#ifdef V8_ENABLE_DIRECT_HANDLE
1561 static constexpr Address kTaggedNullAddress = 1;
1567 template <
typename T>
1575 template <
template <
typename T,
typename... Ms>
typename H,
typename T,
1578 return handle.template value<T>();
1581#ifdef V8_ENABLE_DIRECT_HANDLE
1583 template <
typename T>
1585 return reinterpret_cast<Address>(value);
1588 template <
typename T,
bool check_null = true,
typename S>
1590 if (check_null && slot ==
nullptr) {
1591 return reinterpret_cast<T*
>(kTaggedNullAddress);
1593 return *
reinterpret_cast<T**
>(slot);
1598 template <
typename T>
1603 template <
typename T,
bool check_null = true,
typename S>
1605 return reinterpret_cast<T*
>(slot);
1626 template <
typename T1,
typename T2>
1628 if (lhs.IsEmpty())
return rhs.IsEmpty();
1629 if (rhs.IsEmpty())
return false;
1630 return lhs.ptr() == rhs.ptr();
Definition: v8-isolate.h:211
Definition: v8-internal.h:1342
Definition: v8-internal.h:1610
static bool EqualHandles(const T1 &lhs, const T2 &rhs)
Definition: v8-internal.h:1623
Definition: v8-internal.h:840
static Address LoadMap(Address obj)
Definition: v8-internal.h:1114
static bool IsExternalTwoByteString(int instance_type)
Definition: v8-internal.h:1127
static const int kIsolateCageBaseOffset
Definition: v8-internal.h:899
static const int kEmbedderDataArrayHeaderSize
Definition: v8-internal.h:866
static const int kHeapObjectMapOffset
Definition: v8-internal.h:851
static const int kEmbedderDataSlotSize
Definition: v8-internal.h:867
static const int kIsolateApiCallbackThunkArgumentOffset
Definition: v8-internal.h:956
static Address ReadExternalPointerField(v8::Isolate *isolate, Address heap_object_ptr, int offset)
Definition: v8-internal.h:1276
static const int kJSAPIObjectWithEmbedderSlotsHeaderSize
Definition: v8-internal.h:862
static constexpr bool HasHeapObjectTag(Address value)
Definition: v8-internal.h:1053
static const int kOddballType
Definition: v8-internal.h:1010
static const int kInferShouldThrowMode
Definition: v8-internal.h:1029
static const int kNewAllocationInfoOffset
Definition: v8-internal.h:911
static Address GetRoot(v8::Isolate *isolate, int index)
Definition: v8-internal.h:1191
static const int kStringEncodingMask
Definition: v8-internal.h:875
static const int kIsolateFastCCallCallerPcOffset
Definition: v8-internal.h:921
static uint8_t GetNodeFlag(Address *obj, int shift)
Definition: v8-internal.h:1144
static const int kIsolateThreadLocalTopOffset
Definition: v8-internal.h:927
static const uint32_t kNumIsolateDataSlots
Definition: v8-internal.h:879
static const int kForeignType
Definition: v8-internal.h:1011
static const int kFirstEmbedderJSApiObjectType
Definition: v8-internal.h:1018
static const int kNumberOfBooleanFlags
Definition: v8-internal.h:881
static uint8_t GetNodeState(Address *obj)
Definition: v8-internal.h:1155
static const int kThreadLocalTopSize
Definition: v8-internal.h:887
static const int kIsolateRootsOffset
Definition: v8-internal.h:961
static const int kExternalPointerTableSize
Definition: v8-internal.h:893
static const int kUndefinedOddballKind
Definition: v8-internal.h:1022
static const int kMapInstanceTypeOffset
Definition: v8-internal.h:852
static constexpr Address AddressToSmi(Address value)
Definition: v8-internal.h:1061
static const int kIsolateStackGuardOffset
Definition: v8-internal.h:900
static const int kLinearAllocationAreaSize
Definition: v8-internal.h:886
static const int kFastCCallAlignmentPaddingSize
Definition: v8-internal.h:916
static const int kDisallowGarbageCollectionAlign
Definition: v8-internal.h:965
static const int kIsolateFastCCallCallerFpOffset
Definition: v8-internal.h:918
static const int kErrorMessageParamSize
Definition: v8-internal.h:882
static void CheckInitialized(v8::Isolate *isolate)
Definition: v8-internal.h:1047
static void UpdateNodeState(Address *obj, uint8_t value)
Definition: v8-internal.h:1160
static constexpr Address IntegralToSmi(T value)
Definition: v8-internal.h:1072
static constexpr bool IsValidSmi(T value)
Definition: v8-internal.h:1078
static const int kJSObjectType
Definition: v8-internal.h:1013
static const int kBuiltinTier0TableOffset
Definition: v8-internal.h:909
static const int kIsolateLongTaskStatsCounterOffset
Definition: v8-internal.h:925
static const int kNativeContextEmbedderDataOffset
Definition: v8-internal.h:873
static const int kLastJSApiObjectType
Definition: v8-internal.h:1015
static constexpr bool CanHaveInternalField(int instance_type)
Definition: v8-internal.h:1132
static const int kIsolateHandleScopeDataOffset
Definition: v8-internal.h:929
static const int kFirstNonstringType
Definition: v8-internal.h:1009
static const int kEmptyStringRootIndex
Definition: v8-internal.h:1002
static const int kBuiltinTier0EntryTableOffset
Definition: v8-internal.h:906
static const int kFixedArrayHeaderSize
Definition: v8-internal.h:865
static const int kNullOddballKind
Definition: v8-internal.h:1023
static const int kUndefinedValueRootIndex
Definition: v8-internal.h:997
static const int kExternalTwoByteRepresentationTag
Definition: v8-internal.h:876
static const int kExternalBufferTableSize
Definition: v8-internal.h:894
static constexpr Address IntToSmi(int value)
Definition: v8-internal.h:1066
static const int kDontThrow
Definition: v8-internal.h:1027
static void CheckInitializedImpl(v8::Isolate *isolate)
static void * GetEmbedderData(const v8::Isolate *isolate, uint32_t slot)
Definition: v8-internal.h:1172
static const int kStackGuardSize
Definition: v8-internal.h:880
static const int kNodeStateMask
Definition: v8-internal.h:1006
static const int kNodeStateIsWeakValue
Definition: v8-internal.h:1007
static const int kFirstJSApiObjectType
Definition: v8-internal.h:1014
static const int kStringResourceOffset
Definition: v8-internal.h:853
static const int kErrorMessageParamOffset
Definition: v8-internal.h:904
static const int kExternalPointerTableBasePointerOffset
Definition: v8-internal.h:892
static const int kFalseValueRootIndex
Definition: v8-internal.h:1001
static const int kIsolateFastApiCallTargetOffset
Definition: v8-internal.h:923
static const int kTrueValueRootIndex
Definition: v8-internal.h:1000
static int GetInstanceType(Address obj)
Definition: v8-internal.h:1106
static const int kThrowOnError
Definition: v8-internal.h:1028
static Address ReadTaggedSignedField(Address heap_object_ptr, int offset)
Definition: v8-internal.h:1255
static const int kOddballKindOffset
Definition: v8-internal.h:856
static const int kBuiltinTier0TableSize
Definition: v8-internal.h:885
static const int kContinuationPreservedEmbedderDataOffset
Definition: v8-internal.h:959
static Address ReadTaggedPointerField(Address heap_object_ptr, int offset)
Definition: v8-internal.h:1244
static const int kNullValueRootIndex
Definition: v8-internal.h:999
static void SetEmbedderData(v8::Isolate *isolate, uint32_t slot, void *data)
Definition: v8-internal.h:1165
static Address * GetRootSlot(v8::Isolate *isolate, int index)
Definition: v8-internal.h:1185
static const int kTrustedPointerTableSize
Definition: v8-internal.h:895
static const int kTheHoleValueRootIndex
Definition: v8-internal.h:998
static constexpr int SmiValue(Address value)
Definition: v8-internal.h:1057
static const int kTablesAlignmentPaddingSize
Definition: v8-internal.h:883
static const int kHandleScopeDataSize
Definition: v8-internal.h:888
static const int kExternalOneByteRepresentationTag
Definition: v8-internal.h:877
static const int kBuiltinTier0EntryTableSize
Definition: v8-internal.h:884
static void UpdateNodeFlag(Address *obj, bool value, int shift)
Definition: v8-internal.h:1149
static void IncrementLongTasksStatsCounter(v8::Isolate *isolate)
Definition: v8-internal.h:1179
static const int kDisallowGarbageCollectionSize
Definition: v8-internal.h:966
static const int kOldAllocationInfoOffset
Definition: v8-internal.h:913
static const int kIsolateEmbedderDataOffset
Definition: v8-internal.h:931
static T ReadRawField(Address heap_object_ptr, int offset)
Definition: v8-internal.h:1228
static const int kEmbedderDataSlotExternalPointerOffset
Definition: v8-internal.h:871
static int GetOddballKind(Address obj)
Definition: v8-internal.h:1123
static const int kNodeFlagsOffset
Definition: v8-internal.h:1005
static const int kTrustedPointerTableBasePointerOffset
Definition: v8-internal.h:896
static const int kLastEmbedderJSApiObjectType
Definition: v8-internal.h:1019
static const int kVariousBooleanFlagsOffset
Definition: v8-internal.h:902
static constexpr std::optional< Address > TryIntegralToSmi(T value)
Definition: v8-internal.h:1084
static const int kNodeClassIdOffset
Definition: v8-internal.h:1004
static const int kStringRepresentationAndEncodingMask
Definition: v8-internal.h:874
static constexpr int kExternalAllocationSoftLimit
Definition: v8-internal.h:1033
static const int kJSObjectHeaderSize
Definition: v8-internal.h:857
static v8::Isolate * GetIsolateForSandbox(Address obj)
Definition: v8-internal.h:1265
static const int kJSSpecialApiObjectType
Definition: v8-internal.h:1012
Definition: v8-internal.h:1350
Definition: v8-internal.h:1379
T value_type
Definition: v8-internal.h:1381
StrongRootAllocator(const StrongRootAllocator< U > &other) noexcept
Definition: v8-internal.h:1387
Definition: v8-internal.h:1554
static Address ValueAsAddress(const T *value)
Definition: v8-internal.h:1595
static constexpr Address kEmpty
Definition: v8-internal.h:1560
static T * SlotAsValue(S *slot)
Definition: v8-internal.h:1600
static T * HandleAsValue(const H< T, Ms... > &handle)
Definition: v8-internal.h:1573
static bool IsEmpty(T *value)
Definition: v8-internal.h:1564
Definition: v8-internal.h:1398
constexpr WrappedIterator & operator-=(difference_type n) noexcept
Definition: v8-internal.h:1468
constexpr WrappedIterator operator--(int) noexcept
Definition: v8-internal.h:1451
constexpr WrappedIterator & operator+=(difference_type n) noexcept
Definition: v8-internal.h:1461
constexpr Iterator base() const noexcept
Definition: v8-internal.h:1476
std::conditional_t< std::is_void_v< ElementType >, typename std::iterator_traits< Iterator >::reference, ElementType & > reference
Definition: v8-internal.h:1422
std::conditional_t< std::is_void_v< ElementType >, typename std::iterator_traits< Iterator >::value_type, ElementType > value_type
Definition: v8-internal.h:1414
constexpr WrappedIterator & operator++() noexcept
Definition: v8-internal.h:1437
constexpr pointer operator->() const noexcept
Definition: v8-internal.h:1435
constexpr reference operator[](difference_type n) const noexcept
Definition: v8-internal.h:1472
typename std::iterator_traits< Iterator >::difference_type difference_type
Definition: v8-internal.h:1410
std::conditional_t< std::is_void_v< ElementType >, typename std::iterator_traits< Iterator >::pointer, ElementType * > pointer
Definition: v8-internal.h:1418
constexpr WrappedIterator & operator--() noexcept
Definition: v8-internal.h:1447
typename std::iterator_traits< Iterator >::iterator_category iterator_category
Definition: v8-internal.h:1408
constexpr reference operator*() const noexcept
Definition: v8-internal.h:1434
constexpr WrappedIterator operator+(difference_type n) const noexcept
Definition: v8-internal.h:1456
constexpr WrappedIterator operator++(int) noexcept
Definition: v8-internal.h:1441
constexpr WrappedIterator operator-(difference_type n) const noexcept
Definition: v8-internal.h:1465
friend class WrappedIterator
Definition: v8-internal.h:1480
const intptr_t kHeapObjectTagMask
Definition: v8-internal.h:56
constexpr uint64_t kCppHeapPointerMarkBit
Definition: v8-internal.h:362
constexpr int kCodePointerTableEntrySizeLog2
Definition: v8-internal.h:786
constexpr bool kRuntimeGeneratedCodeObjectsLiveInTrustedSpace
Definition: v8-internal.h:798
uint32_t ExternalBufferHandle
Definition: v8-internal.h:393
internal::Isolate * IsolateFromNeverReadOnlySpaceObject(Address obj)
constexpr uint64_t kExternalPointerTagShift
Definition: v8-internal.h:504
IndirectPointerHandle TrustedPointerHandle
Definition: v8-internal.h:721
const int kApiSystemPointerSize
Definition: v8-internal.h:46
constexpr bool SandboxIsEnabled()
Definition: v8-internal.h:201
constexpr size_t kExternalBufferTableReservationSize
Definition: v8-internal.h:414
const int kApiDoubleSize
Definition: v8-internal.h:47
constexpr bool operator<=(const WrappedIterator< Iterator, ElementType > &x, const WrappedIterator< OtherIterator, OtherElementType > &y) noexcept
Definition: v8-internal.h:1528
constexpr size_t kMaxCppHeapPointers
Definition: v8-internal.h:385
constexpr intptr_t kIntptrAllBitsSet
Definition: v8-internal.h:74
constexpr int GB
Definition: v8-internal.h:38
void VerifyHandleIsNonEmpty(bool is_empty)
const int kApiInt32Size
Definition: v8-internal.h:48
constexpr uint32_t kJSDispatchHandleShift
Definition: v8-internal.h:816
const int kForwardingTagSize
Definition: v8-internal.h:63
uint32_t CppHeapPointerHandle
Definition: v8-internal.h:347
const intptr_t kForwardingTagMask
Definition: v8-internal.h:64
void PrintPropertyCallbackInfo(void *property_callback_info)
IndirectPointerHandle CodePointerHandle
Definition: v8-internal.h:759
constexpr size_t kMaxExternalBufferPointers
Definition: v8-internal.h:424
const int kSmiTagSize
Definition: v8-internal.h:68
const int kApiInt64Size
Definition: v8-internal.h:49
constexpr int kExternalBufferTableEntrySizeLog2
Definition: v8-internal.h:423
constexpr uint64_t kExternalPointerTagMask
Definition: v8-internal.h:502
constexpr int kCodePointerTableEntryCodeObjectOffset
Definition: v8-internal.h:794
constexpr int kTrustedPointerTableEntrySizeLog2
Definition: v8-internal.h:738
constexpr size_t kJSDispatchTableReservationSize
Definition: v8-internal.h:815
constexpr int kTrustedPointerTableEntrySize
Definition: v8-internal.h:737
constexpr uint64_t kCppHeapPointerPayloadShift
Definition: v8-internal.h:364
constexpr ExternalPointer_t kNullExternalPointer
Definition: v8-internal.h:339
constexpr bool operator>(const WrappedIterator< Iterator, ElementType > &x, const WrappedIterator< OtherIterator, OtherElementType > &y) noexcept
Definition: v8-internal.h:1512
Address ExternalPointer_t
Definition: v8-internal.h:336
constexpr WrappedIterator< Iterator > operator+(typename WrappedIterator< Iterator, ElementType >::difference_type n, const WrappedIterator< Iterator, ElementType > &x) noexcept
Definition: v8-internal.h:1544
uint32_t IndirectPointerHandle
Definition: v8-internal.h:701
constexpr CppHeapPointer_t kNullCppHeapPointer
Definition: v8-internal.h:359
const int kApiSizetSize
Definition: v8-internal.h:50
constexpr int kCodePointerTableEntryEntrypointOffset
Definition: v8-internal.h:793
constexpr size_t kMaxExternalPointers
Definition: v8-internal.h:317
constexpr uint64_t kExternalPointerTagMaskWithoutMarkBit
Definition: v8-internal.h:503
constexpr size_t kCodePointerTableReservationSize
Definition: v8-internal.h:764
constexpr TrustedPointerHandle kNullTrustedPointerHandle
Definition: v8-internal.h:733
constexpr ExternalBufferHandle kNullExternalBufferHandle
Definition: v8-internal.h:419
const int kWeakHeapObjectTag
Definition: v8-internal.h:54
constexpr ExternalPointerHandle kNullExternalPointerHandle
Definition: v8-internal.h:340
constexpr bool operator<(const WrappedIterator< Iterator, ElementType > &x, const WrappedIterator< OtherIterator, OtherElementType > &y) noexcept
Definition: v8-internal.h:1496
constexpr bool operator!=(const WrappedIterator< Iterator, ElementType > &x, const WrappedIterator< OtherIterator, OtherElementType > &y) noexcept
Definition: v8-internal.h:1504
constexpr uintptr_t kUintptrAllBitsSet
Definition: v8-internal.h:75
uint32_t JSDispatchHandle
Definition: v8-internal.h:808
const int kForwardingTag
Definition: v8-internal.h:62
const intptr_t kHeapObjectReferenceTagMask
Definition: v8-internal.h:57
constexpr bool SmiValuesAre31Bits()
Definition: v8-internal.h:189
constexpr size_t kMaxTrustedPointers
Definition: v8-internal.h:739
bool ShouldThrowOnError(internal::Isolate *isolate)
constexpr uint64_t kCppHeapPointerTagShift
Definition: v8-internal.h:363
constexpr auto operator-(const WrappedIterator< Iterator, ElementType > &x, const WrappedIterator< OtherIterator, OtherElementType > &y) noexcept -> decltype(x.base() - y.base())
Definition: v8-internal.h:1536
constexpr int KB
Definition: v8-internal.h:36
constexpr uint64_t kAllTagsForAndBasedTypeChecking[]
Definition: v8-internal.h:510
constexpr bool kBuiltinCodeObjectsLiveInTrustedSpace
Definition: v8-internal.h:799
constexpr bool operator>=(const WrappedIterator< Iterator, ElementType > &x, const WrappedIterator< OtherIterator, OtherElementType > &y) noexcept
Definition: v8-internal.h:1520
constexpr uint32_t kTrustedPointerHandleShift
Definition: v8-internal.h:730
constexpr uint32_t kCodePointerHandleShift
Definition: v8-internal.h:768
const int kHeapObjectTag
Definition: v8-internal.h:53
const int kSmiShiftSize
Definition: v8-internal.h:185
constexpr size_t kMaxCodePointers
Definition: v8-internal.h:787
SmiTagging< kApiTaggedSize > PlatformSmiTagging
Definition: v8-internal.h:180
const int kSmiValueSize
Definition: v8-internal.h:186
constexpr size_t kMaxJSDispatchEntries
Definition: v8-internal.h:821
constexpr bool SmiValuesAre32Bits()
Definition: v8-internal.h:190
constexpr IndirectPointerHandle kNullIndirectPointerHandle
Definition: v8-internal.h:704
uintptr_t Address
Definition: v8-internal.h:33
constexpr int kJSDispatchTableEntrySizeLog2
Definition: v8-internal.h:820
void PerformCastCheck(T *data)
Definition: v8-internal.h:1335
void PrintFunctionCallbackInfo(void *function_callback_info)
constexpr size_t kTrustedPointerTableReservationSize
Definition: v8-internal.h:726
uint32_t ExternalPointerHandle
Definition: v8-internal.h:328
const intptr_t kSmiTagMask
Definition: v8-internal.h:69
constexpr uint32_t kExternalBufferHandleShift
Definition: v8-internal.h:415
const int kHeapObjectTagSize
Definition: v8-internal.h:55
const int kSmiMaxValue
Definition: v8-internal.h:188
Address ExternalBuffer_t
Definition: v8-internal.h:401
constexpr bool Is64()
Definition: v8-internal.h:191
constexpr bool kAllCodeObjectsLiveInTrustedSpace
Definition: v8-internal.h:800
constexpr bool operator==(const WrappedIterator< Iterator, ElementType > &x, const WrappedIterator< OtherIterator, OtherElementType > &y) noexcept
Definition: v8-internal.h:1488
const int kSmiTag
Definition: v8-internal.h:67
constexpr CodePointerHandle kNullCodePointerHandle
Definition: v8-internal.h:771
Address CppHeapPointer_t
Definition: v8-internal.h:356
constexpr CppHeapPointerHandle kNullCppHeapPointerHandle
Definition: v8-internal.h:360
constexpr int kGarbageCollectionReasonMaxValue
Definition: v8-internal.h:1346
constexpr int kCodePointerTableEntrySize
Definition: v8-internal.h:785
constexpr int kExternalBufferTableEntrySize
Definition: v8-internal.h:422
ExternalPointerTag
Definition: v8-internal.h:621
@ kExternalPointerEvacuationEntryTag
Definition: v8-internal.h:634
@ kAccessorInfoGetterTag
Definition: v8-internal.h:639
@ kFirstSharedTag
Definition: v8-internal.h:639
@ kAccessorInfoSetterTag
Definition: v8-internal.h:639
@ kAnyForeignTag
Definition: v8-internal.h:628
@ kExternalPointerFreeEntryTag
Definition: v8-internal.h:632
@ kAnyExternalPointerTag
Definition: v8-internal.h:625
@ kLastSharedTag
Definition: v8-internal.h:639
@ kExternalPointerNullTag
Definition: v8-internal.h:623
@ kLastManagedResourceTag
Definition: v8-internal.h:639
@ kExternalPointerZappedEntryTag
Definition: v8-internal.h:637
@ kFirstManagedResourceTag
Definition: v8-internal.h:639
@ kFunctionTemplateInfoCallbackTag
Definition: v8-internal.h:639
constexpr uint32_t kCodePointerHandleMarker
Definition: v8-internal.h:780
constexpr JSDispatchHandle kNullJSDispatchHandle
Definition: v8-internal.h:810
const int kSmiMinValue
Definition: v8-internal.h:187
constexpr int kJSDispatchTableEntrySize
Definition: v8-internal.h:819
constexpr int MB
Definition: v8-internal.h:37
constexpr uint64_t kExternalPointerMarkBit
Definition: v8-internal.h:501
Address SandboxedPointer_t
Definition: v8-internal.h:211
const int kApiTaggedSize
Definition: v8-internal.h:170
constexpr bool PointerCompressionIsEnabled()
Definition: v8-internal.h:173
Definition: libplatform.h:15
Definition: v8-internal.h:1319
static void Perform(T *data)
static constexpr bool IsValidSmi(uint64_t value)
Definition: v8-internal.h:122
static constexpr bool IsValidSmi(int64_t value)
Definition: v8-internal.h:115
static constexpr bool IsValidSmi(T value)
Definition: v8-internal.h:95
static constexpr int SmiToInt(Address value)
Definition: v8-internal.h:87
static constexpr bool IsValidSmi(T value)
Definition: v8-internal.h:145
static constexpr int SmiToInt(Address value)
Definition: v8-internal.h:137
Definition: v8-internal.h:72
#define EXTERNAL_POINTER_TAG_ENUM(Name, Tag)
Definition: v8-internal.h:617
#define ALL_EXTERNAL_POINTER_TAGS(V)
Definition: v8-internal.h:613
#define CHECK_NON_SHARED_EXTERNAL_POINTER_TAGS(Tag,...)
Definition: v8-internal.h:675
#define SHARED_EXTERNAL_POINTER_TAGS(V)
Definition: v8-internal.h:538
#define MAKE_TAG(HasMarkBit, TypeTag)
Definition: v8-internal.h:618
#define PER_ISOLATE_EXTERNAL_POINTER_TAGS(V)
Definition: v8-internal.h:548
#define CHECK_SHARED_EXTERNAL_POINTER_TAGS(Tag,...)
Definition: v8-internal.h:673
#define V8_EXPORT
Definition: v8config.h:779
#define V8_INLINE
Definition: v8config.h:493
#define V8_LIKELY(condition)
Definition: v8config.h:644