5#ifndef V8_OBJECTS_OBJECTS_INL_H_
6#define V8_OBJECTS_OBJECTS_INL_H_
101#define IS_TYPE_FUNCTION_DEF(type_) \
102 bool Is##type_(Tagged<Object> obj) { \
103 return IsHeapObject(obj) && Is##type_(Cast<HeapObject>(obj)); \
105 bool Is##type_(Tagged<Object> obj, PtrComprCageBase cage_base) { \
106 return IsHeapObject(obj) && Is##type_(Cast<HeapObject>(obj), cage_base); \
108 bool Is##type_(HeapObject obj) { \
109 static_assert(kTaggedCanConvertToRawObjects); \
110 return Is##type_(Tagged<HeapObject>(obj)); \
112 bool Is##type_(HeapObject obj, PtrComprCageBase cage_base) { \
113 static_assert(kTaggedCanConvertToRawObjects); \
114 return Is##type_(Tagged<HeapObject>(obj), cage_base); \
116 bool Is##type_(const HeapObjectLayout* obj) { \
117 return Is##type_(Tagged<HeapObject>(obj)); \
119 bool Is##type_(const HeapObjectLayout* obj, PtrComprCageBase cage_base) { \
120 return Is##type_(Tagged<HeapObject>(obj), cage_base); \
126#undef IS_TYPE_FUNCTION_DEF
129 return IsHole(obj, cage_base);
134#define IS_TYPE_FUNCTION_DEF(Type, Value, _) \
135 bool Is##Type(Tagged<Object> obj, Isolate* isolate) { \
136 return Is##Type(obj, ReadOnlyRoots(isolate)); \
138 bool Is##Type(Tagged<Object> obj, LocalIsolate* isolate) { \
139 return Is##Type(obj, ReadOnlyRoots(isolate)); \
141 bool Is##Type(Tagged<Object> obj) { \
142 return Is##Type(obj, GetReadOnlyRoots()); \
144 bool Is##Type(Tagged<HeapObject> obj) { \
145 return Is##Type(obj, GetReadOnlyRoots()); \
147 bool Is##Type(HeapObject obj) { \
148 static_assert(kTaggedCanConvertToRawObjects); \
149 return Is##Type(Tagged<HeapObject>(obj)); \
151 bool Is##Type(const HeapObjectLayout* obj, Isolate* isolate) { \
152 return Is##Type(Tagged<HeapObject>(obj), isolate); \
154 bool Is##Type(const HeapObjectLayout* obj) { \
155 return Is##Type(Tagged<HeapObject>(obj)); \
159#undef IS_TYPE_FUNCTION_DEF
161#if V8_STATIC_ROOTS_BOOL
162#define IS_TYPE_FUNCTION_DEF(Type, Value, CamelName) \
163 bool Is##Type(Tagged<Object> obj, ReadOnlyRoots roots) { \
164 SLOW_DCHECK(CheckObjectComparisonAllowed(obj.ptr(), roots.Value().ptr())); \
165 return V8HeapCompressionScheme::CompressObject(obj.ptr()) == \
166 StaticReadOnlyRoot::k##CamelName; \
169#define IS_TYPE_FUNCTION_DEF(Type, Value, _) \
170 bool Is##Type(Tagged<Object> obj, ReadOnlyRoots roots) { \
171 return obj == roots.Value(); \
176#undef IS_TYPE_FUNCTION_DEF
187 return IsNull(obj, roots) || IsUndefined(obj, roots);
214#define IS_HELPER_DEF(Type, ...) \
216 struct CastTraits<Type> { \
217 static inline bool AllowFrom(Tagged<Object> value) { \
218 return Is##Type(value); \
220 static inline bool AllowFrom(Tagged<HeapObject> value) { \
221 return Is##Type(value); \
229#define IS_HELPER_DEF_STRUCT(NAME, Name, name) IS_HELPER_DEF(Name)
231#undef IS_HELPER_DEF_STRUCT
236template <
typename... T>
239 return (
Is<T>(value) || ...);
242 return (
Is<T>(value) || ...);
265 template <
typename From>
291template <
typename T,
typename Base>
293template <
typename Base>
300 :
public CastTraits<TrustedWeakFixedArray> {};
312 requires((std::is_arithmetic_v<T> || std::is_enum_v<T>) &&
313 !std::is_floating_point_v<T>)
320 reinterpret_cast<AtomicT*
>(field_address(
offset))));
325 requires((std::is_arithmetic_v<T> || std::is_enum_v<T>) &&
326 !std::is_floating_point_v<T>)
333 reinterpret_cast<AtomicT*
>(field_address(
offset)),
334 static_cast<AtomicT
>(value));
339 requires((std::is_arithmetic_v<T> || std::is_enum_v<T>) &&
340 !std::is_floating_point_v<T>)
347 reinterpret_cast<AtomicT*
>(field_address(
offset))));
351template <
typename CompareAndSwapImpl>
354 CompareAndSwapImpl compare_and_swap_impl) {
357 Tagged<Object> old_value = compare_and_swap_impl(actual_expected, value);
358 if (old_value == actual_expected || !
IsNumber(old_value) ||
370 actual_expected = old_value;
375#if V8_STATIC_ROOTS_BOOL
388#ifdef V8_COMPRESS_POINTERS
399#ifdef V8_ENABLE_SANDBOX
415 const InstanceType instance_type = map->instance_type();
416 return InstanceTypeChecker::IsJSAPIObjectWithEmbedderSlots(instance_type) ||
417 InstanceTypeChecker::IsJSSpecialObject(instance_type);
425 return IsInternalizedString(obj, cage_base) || IsSymbol(obj, cage_base);
429 return obj->map(cage_base)->is_callable();
433 return IsCallable(obj, cage_base) && IsJSProxy(obj, cage_base);
437 InstanceType type = obj->map(cage_base)->instance_type();
438 return IsCallable(obj, cage_base) &&
439 (type == JS_API_OBJECT_TYPE || type == JS_SPECIAL_API_OBJECT_TYPE);
443 return IsForeign(obj, cage_base) &&
448 return obj->map(cage_base)->is_constructor();
456 if (!IsString(obj, cage_base))
return false;
461 if (!IsString(obj, cage_base))
return false;
466 if (!IsString(obj, cage_base))
return false;
471 if (!IsString(obj, cage_base))
return false;
476 if (!IsString(obj, cage_base))
return false;
481 if (!IsString(obj, cage_base))
return false;
486 if (!IsString(obj, cage_base))
return false;
491 if (!IsString(obj, cage_base))
return false;
496 if (
IsSmi(obj))
return true;
499 return IsHeapNumber(heap_object, cage_base);
503 return obj.
IsSmi() || IsHeapNumber(obj, cage_base);
507 if (
IsSmi(obj))
return true;
510 return IsHeapNumber(heap_object, cage_base) ||
511 IsBigInt(heap_object, cage_base);
515 return IsNumber(obj, cage_base) || IsBigInt(obj, cage_base);
519 return IsJSArray(obj, cage_base);
524 return IsJSObject(obj, cage_base);
527 return IsJSObject(obj, cage_base);
533 if (!IsProtectedFixedArray(obj, cage_base))
return false;
540 if (length == 0)
return true;
547 return IsFixedArrayExact(obj, cage_base);
551 return IsWeakArrayList(obj, cage_base);
555 return IsWeakFixedArray(obj, cage_base);
559 return IsJSPrimitiveWrapper(obj, cage_base) &&
564 return IsJSPrimitiveWrapper(obj, cage_base) &&
569 return IsJSPrimitiveWrapper(obj, cage_base) &&
574 return IsJSPrimitiveWrapper(obj, cage_base) &&
579 return IsJSPrimitiveWrapper(obj, cage_base) &&
584 return IsJSPrimitiveWrapper(obj, cage_base) &&
589 return IsHashTable(obj, cage_base);
593 return IsHashTable(obj, cage_base);
597 return IsHashTable(obj, cage_base);
601 return IsHashTable(obj, cage_base);
605 return IsHashTable(obj, cage_base);
609 return IsHashTable(obj, cage_base);
613 return IsHashTable(obj, cage_base);
618 if (obj.
IsSmi())
return true;
633 if (IsJSArray(*heap_object))
return Just(
true);
634 if (!IsJSProxy(*heap_object))
return Just(
false);
639 return obj->map(cage_base)->is_undetectable();
643 if (IsJSGlobalProxy(obj, cage_base)) {
646 proxy->GetIsolate()->context()->global_object();
647 return proxy->IsDetachedFrom(global);
649 return obj->map(cage_base)->is_access_check_needed();
652#define MAKE_STRUCT_PREDICATE(NAME, Name, name) \
653 bool Is##Name(Tagged<Object> obj) { \
654 return IsHeapObject(obj) && Is##Name(Cast<HeapObject>(obj)); \
656 bool Is##Name(Tagged<Object> obj, PtrComprCageBase cage_base) { \
657 return IsHeapObject(obj) && Is##Name(Cast<HeapObject>(obj), cage_base); \
659 bool Is##Name(HeapObject obj) { \
660 static_assert(kTaggedCanConvertToRawObjects); \
661 return Is##Name(Tagged<HeapObject>(obj)); \
663 bool Is##Name(HeapObject obj, PtrComprCageBase cage_base) { \
664 static_assert(kTaggedCanConvertToRawObjects); \
665 return Is##Name(Tagged<HeapObject>(obj), cage_base); \
667 bool Is##Name(const HeapObjectLayout* obj) { \
668 return Is##Name(Tagged<HeapObject>(obj)); \
670 bool Is##Name(const HeapObjectLayout* obj, PtrComprCageBase cage_base) { \
671 return Is##Name(Tagged<HeapObject>(obj), cage_base); \
675#undef MAKE_STRUCT_PREDICATE
696template <
typename T,
template <
typename>
typename HandleType>
714 if (value1_bits == value2_bits) {
719 return std::isnan(value1) && std::isnan(value2);
736 return IsFixedArray(obj) || IsFixedDoubleArray(obj) || IsByteArray(obj);
741 DCHECK(!IsPropertyCell(obj));
743 if (!IsSymbol(obj))
return true;
745 }
else if (IsSymbol(obj)) {
762 if (IsHeapNumber(heap_object, cage_base)) {
764 }
else if (IsUninitialized(heap_object)) {
775#ifdef V8_ENABLE_EXPERIMENTAL_UNDEFINED_DOUBLE
786 bool allow_coercion) {
787 if (representation.
IsSmi()) {
789 }
else if (representation.
IsDouble()) {
790 return allow_coercion ?
IsNumber(obj) : IsHeapNumber(obj);
793 }
else if (representation.
IsNone()) {
803 if (num < 0)
return false;
804 *value =
static_cast<uint32_t
>(num);
807 if (IsHeapNumber(obj)) {
815template <
typename T,
template <
typename>
typename HandleType>
818 Isolate* isolate, HandleType<T>
object,
const char* method_name) {
820 return ToObjectImpl(isolate,
object, method_name);
824template <
template <
typename>
typename HandleType>
826 HandleType<Object> input)
830 return ConvertToName(isolate, input);
834template <
typename T,
template <
typename>
typename HandleType>
837 Isolate* isolate, HandleType<T> value) {
839 return ConvertToPropertyKey(isolate, value);
843template <
typename T,
template <
typename>
typename HandleType>
852template <
typename T,
template <
typename>
typename HandleType>
855 HandleType<T> input) {
861template <
typename T,
template <
typename>
typename HandleType>
864 HandleType<T> input) {
865 if (
IsNumber(*input) || IsBigInt(*input))
return input;
870template <
typename T,
template <
typename>
typename HandleType>
873 HandleType<T> input) {
879template <
typename T,
template <
typename>
typename HandleType>
882 HandleType<T> input) {
888template <
typename T,
template <
typename>
typename HandleType>
891 HandleType<T> input) {
893 return typename HandleType<Number>::MaybeType(
900template <
typename T,
template <
typename>
typename HandleType>
903 HandleType<T> input) {
919template <
typename T,
template <
typename>
typename HandleType>
924 return ConvertToIndex(isolate,
Cast<Object>(input), error_index);
931 if (!it.IsFound())
return it.factory()->undefined_value();
939 if (!it.IsFound())
return it.factory()->undefined_value();
979template <ExternalPo
interTag tag>
990template <ExternalPo
interTagRange tag_range>
996template <CppHeapPo
interTag lower_bound, CppHeapPo
interTag upper_bound>
1009template <ExternalPo
interTag tag>
1017#ifdef V8_ENABLE_SANDBOX
1028#ifdef V8_ENABLE_SANDBOX
1039template <ExternalPo
interTag tag>
1042#ifdef V8_ENABLE_SANDBOX
1044 ExternalPointerTable& table = isolate.GetExternalPointerTableFor(tag);
1050 handle = table.AllocateAndInitializeEntry(
1051 isolate.GetExternalPointerTableSpaceFor(tag,
address()), value, tag);
1057 table.Set(
handle, value, tag);
1068template <CppHeapPo
interTag tag>
1082#if V8_ENABLE_SANDBOX
1084void HeapObject::InitSelfIndirectPointerField(
1087 DCHECK(IsExposedTrustedObject(*
this));
1091 opt_publishing_scope);
1095template <IndirectPo
interTag tag>
1103template <IndirectPo
interTag tag>
1109 DCHECK(IsExposedTrustedObject(
object));
1113template <IndirectPo
interTag tag>
1117#ifdef V8_ENABLE_SANDBOX
1125template <IndirectPo
interTag tag>
1130#ifdef V8_ENABLE_SANDBOX
1135 *
this,
static_cast<int>(
offset), value);
1140#ifdef V8_ENABLE_SANDBOX
1146 static_cast<int>(
offset)));
1152#ifdef V8_ENABLE_SANDBOX
1154 const TrustedPointerTable& table = isolate.GetTrustedPointerTableFor(tag);
1155 return table.IsUnpublished(
handle);
1162#ifdef V8_ENABLE_SANDBOX
1203template <
typename ObjectType>
1207#ifdef V8_ENABLE_LEAPTIERING
1208 JSDispatchTable::Space* space =
1209 isolate->GetJSDispatchTableSpaceFor(host->field_address(
offset));
1211 isolate->factory()->NewJSDispatchHandle(
parameter_count, code, space);
1236 int byte_offset)
const {
1256#ifdef V8_MAP_PACKING
1257 return MapWord(Pack(map.ptr()));
1264#ifdef V8_MAP_PACKING
1272#ifdef V8_EXTERNAL_CODE_SPACE
1284#ifdef V8_EXTERNAL_CODE_SPACE
1288 intptr_t diff =
static_cast<intptr_t
>(
object.ptr() - map_word_host.
ptr());
1301#ifdef V8_EXTERNAL_CODE_SPACE
1318void HeapObject::VerifyObjectField(
Isolate* isolate,
int offset) {
1319 Object::VerifyPointer(isolate,
1324void HeapObject::VerifyMaybeObjectField(
Isolate* isolate,
int offset) {
1325 Object::VerifyMaybeObjectPointer(
1330void HeapObject::VerifySmiField(
int offset) {
1351 return HeapObject::map(cage_base);
1354Tagged<Map> HeapObject::map(PtrComprCageBase cage_base)
const {
1378template <
typename IsolateT>
1385template <
typename IsolateT>
1399template <
typename IsolateT>
1406template <
typename IsolateT>
1412template <
typename IsolateT>
1423 isolate, value, tag);
1464#if V8_ENABLE_WEBASSEMBLY
1467 DCHECK(!IsWasmStructMap(value) && !IsWasmArrayMap(value));
1473 !LocalHeap::Current());
1474 if (
v8_flags.verify_heap && !value.is_null()) {
1485 Heap::NotifyObjectLayoutChangeDone(*
this);
1486#ifndef V8_DISABLE_WRITE_BARRIERS
1487 if (!value.is_null()) {
1493 SLOW_DCHECK(!WriteBarrier::IsRequired(*
this, value));
1499template <
typename IsolateT>
1507template <
typename IsolateT>
1511#ifndef V8_DISABLE_WRITE_BARRIERS
1513 DCHECK(!value.is_null());
1518 value.is_null() ? !isolate->read_only_heap()->roots_init_complete()
1519 : !WriteBarrier::IsRequired(*
this, value));
1544 return HeapObject::map_word(cage_base, tag);
1546MapWord HeapObject::map_word(PtrComprCageBase cage_base,
1567 return HeapObject::map_word(cage_base, tag);
1569MapWord HeapObject::map_word(PtrComprCageBase cage_base,
1599 *
this, old_map_word,
1607 *
this, old_map_word,
1615int HeapObject::Size()
const {
1618 return HeapObject::Size(cage_base);
1620int HeapObject::Size(PtrComprCageBase cage_base)
const {
1633 !
result, !map->has_named_interceptor() && !map->is_access_check_needed());
1661 if (num < 0)
return false;
1662 *index =
static_cast<size_t>(num);
1665 if (IsHeapNumber(obj)) {
1667 if (!(num >= 0))
return false;
1668 constexpr double max =
1671 static_cast<double>(std::numeric_limits<size_t>::max() - 1));
1672 if (num > max)
return false;
1673 size_t result =
static_cast<size_t>(num);
1674 if (num !=
result)
return false;
1698 int instance_type = map->instance_type();
1703 if (instance_type == FIXED_DOUBLE_ARRAY_TYPE)
return kDoubleAligned;
1728 switch (
result.FromJust()) {
1745 switch (
result.FromJust()) {
1762 switch (
result.FromJust()) {
1779 switch (
result.FromJust()) {
1809 value, should_throw, store_origin);
1824 if (
IsSmi(
object)) {
1829 if (InstanceTypeChecker::IsHeapNumber(instance_type)) {
1842 }
else if (InstanceTypeChecker::IsName(instance_type)) {
1843 uint32_t hash =
Cast<Name>(
object)->EnsureHash();
1845 }
else if (InstanceTypeChecker::IsOddball(instance_type)) {
1846 uint32_t hash =
Cast<Oddball>(
object)->to_string()->EnsureHash();
1848 }
else if (InstanceTypeChecker::IsBigInt(instance_type)) {
1851 }
else if (InstanceTypeChecker::IsSharedFunctionInfo(instance_type)) {
1854 }
else if (InstanceTypeChecker::IsScopeInfo(instance_type)) {
1857 }
else if (InstanceTypeChecker::IsScript(instance_type)) {
1860 }
else if (InstanceTypeChecker::IsTemplateInfo(instance_type)) {
1866 DCHECK(!InstanceTypeChecker::IsHole(instance_type));
1867 DCHECK(IsJSReceiver(
object));
1875 if (
IsSmi(hash))
return hash;
1878 CHECK(IsJSReceiver(obj));
1880 return receiver->GetIdentityHash();
1888 if (
IsSmi(obj))
return true;
1898 InstanceType instance_type =
object->map()->instance_type();
1899 if (InstanceTypeChecker::IsAlwaysSharedSpaceJSObject(instance_type)) {
1903 switch (instance_type) {
1918 if (
v8_flags.shared_string_table) {
1923 case HEAP_NUMBER_TYPE:
1931template <
typename T,
template <
typename>
typename HandleType>
1932 requires(std::is_convertible_v<HandleType<T>, DirectHandle<T>>)
1934 Isolate* isolate, HandleType<T> value,
1938 return ShareSlow(isolate,
Cast<HeapObject>(value), throw_if_cannot_be_shared);
1944 if (IsJSReceiver(obj)) {
1949 return !IsJSSharedStruct(obj) && !IsJSSharedArray(obj);
1953 return IsSymbol(obj) && !
Cast<Symbol>(obj)->is_in_public_symbol_table();
1963 prev_ = isolate->relocatable_top();
1964 isolate->set_relocatable_top(
this);
1986 return isolate->factory()->NewJSArrayWithElements(entry_storage,
1998 return isolate->factory()->NewJSArrayWithElements(entry_storage,
constexpr int kRegularPageSize
#define SLOW_DCHECK(condition)
static void Release_Store(T *addr, typename std::remove_reference< T >::type new_value)
static T Acquire_Load(T *addr)
static void Relaxed_Store(T *addr, typename std::remove_reference< T >::type new_value)
static T Relaxed_Load(T *addr)
static const int kDeoptEntrySize
static const int kFirstDeoptEntryIndex
static V8_EXPORT_PRIVATE Tagged< FieldType > Any()
static V8_EXPORT_PRIVATE Tagged< FieldType > None()
static V8_INLINE bool InWritableSharedSpace(Tagged< HeapObject > object)
static V8_INLINE bool InReadOnlySpace(Tagged< HeapObject > object)
static V8_INLINE bool InAnySharedSpace(Tagged< HeapObject > object)
static V8_INLINE bool InCodeSpace(Tagged< HeapObject > object)
void set_map_safe_transition_no_write_barrier(Isolate *isolate, Tagged< Map > value, RelaxedStoreTag=kRelaxedStore)
MapWord map_word(RelaxedLoadTag) const
WriteBarrierMode GetWriteBarrierMode(const DisallowGarbageCollection &promise)
void set_map_after_allocation(IsolateT *isolate, Tagged< Map > value, WriteBarrierMode mode=UPDATE_WRITE_BARRIER)
ReadOnlyRoots EarlyGetReadOnlyRoots() const
void set_map(Isolate *isolate, Tagged< Map > value)
Tagged< Map > map() const
void set_map_word_forwarded(Tagged< HeapObject > target_object, ReleaseStoreTag)
void set_map_safe_transition(IsolateT *isolate, Tagged< Map > value, ReleaseStoreTag)
void set_map_no_write_barrier(Isolate *isolate, Tagged< Map > value, RelaxedStoreTag=kRelaxedStore)
bool release_compare_and_swap_map_word_forwarded(MapWord old_map_word, Tagged< HeapObject > new_target_object)
ExternalPointerSlot RawExternalPointerField(int byte_offset, ExternalPointerTagRange tag_range) const
void WriteCodePointerField(size_t offset, Tagged< Code > value)
void Relaxed_WriteField(size_t offset, T value)
static Tagged< HeapObject > FromAddress(Address address)
T Acquire_ReadField(size_t offset) const
void WriteSandboxedPointerField(size_t offset, PtrComprCageBase cage_base, Address value)
ObjectSlot map_slot() const
void SetupLazilyInitializedCppHeapPointerField(size_t offset)
void WriteBoundedSizeField(size_t offset, size_t value)
void set_map_word(Tagged< Map > map, RelaxedStoreTag)
bool relaxed_compare_and_swap_map_word_forwarded(MapWord old_map_word, Tagged< HeapObject > new_target_object)
T Relaxed_ReadField(size_t offset) const
static Tagged< Object > SeqCst_CompareAndSwapField(Tagged< Object > expected_value, Tagged< Object > new_value, CompareAndSwapImpl compare_and_swap_impl)
Address ReadCppHeapPointerField(size_t offset, IsolateForPointerCompression isolate) const
Address ReadSandboxedPointerField(size_t offset, PtrComprCageBase cage_base) const
void InitExternalPointerField(size_t offset, IsolateForSandbox isolate, Address value, WriteBarrierMode mode=UPDATE_WRITE_BARRIER)
void WriteTrustedPointerField(size_t offset, Tagged< ExposedTrustedObject > value)
void WriteCodeEntrypointViaCodePointerField(size_t offset, Address value, CodeEntrypointTag tag)
Address ReadCodeEntrypointViaCodePointerField(size_t offset, CodeEntrypointTag tag) const
Address field_address(size_t offset) const
static void SetFillerMap(const WritableFreeSpace &writable_page, Tagged< Map > value)
static constexpr int kMapOffset
ObjectSlot RawField(int byte_offset) const
MaybeObjectSlot RawMaybeWeakField(int byte_offset) const
void WriteLazilyInitializedExternalPointerField(size_t offset, IsolateForSandbox isolate, Address value)
V8_EXPORT_PRIVATE int SizeFromMap(Tagged< Map > map) const
void set_map(Isolate *isolate, Tagged< Map > value)
static JSDispatchHandle AllocateAndInstallJSDispatchHandle(ObjectType host, size_t offset, Isolate *isolate, uint16_t parameter_count, DirectHandle< Code > code, WriteBarrierMode mode=WriteBarrierMode::UPDATE_WRITE_BARRIER)
Tagged< Object > ReadMaybeEmptyTrustedPointerField(size_t offset, IsolateForSandbox isolate, AcquireLoadTag) const
static AllocationAlignment RequiredAlignment(Tagged< Map > map)
size_t ReadBoundedSizeField(size_t offset) const
Address ReadExternalPointerField(size_t offset, IsolateForSandbox isolate) const
void set_map_safe_transition(IsolateT *isolate, Tagged< Map > value)
ReadOnlyRoots EarlyGetReadOnlyRoots() const
void ClearTrustedPointerField(size_t offest)
void set_map_after_allocation(IsolateT *isolate, Tagged< Map > value, WriteBarrierMode mode=UPDATE_WRITE_BARRIER)
void set_map_word_forwarded(Tagged< HeapObject > target_object, RelaxedStoreTag)
void set_map_safe_transition_no_write_barrier(Isolate *isolate, Tagged< Map > value, RelaxedStoreTag=kRelaxedStore)
Address GetFieldAddress(int field_offset) const
bool IsTrustedPointerFieldEmpty(size_t offset) const
void SetupLazilyInitializedExternalPointerField(size_t offset)
bool IsCodePointerFieldEmpty(size_t offset) const
Tagged< Code > ReadCodePointerField(size_t offset, IsolateForSandbox isolate) const
void set_map_no_write_barrier(Isolate *isolate, Tagged< Map > value, RelaxedStoreTag=kRelaxedStore)
void ClearCodePointerField(size_t offest)
WriteBarrierMode GetWriteBarrierMode(const DisallowGarbageCollection &promise)
CppHeapPointerSlot RawCppHeapPointerField(int byte_offset) const
bool CheckRequiredAlignment(PtrComprCageBase cage_base) const
Tagged< ExposedTrustedObject > ReadTrustedPointerField(size_t offset, IsolateForSandbox isolate) const
void WriteExternalPointerField(size_t offset, IsolateForSandbox isolate, Address value)
void WriteLazilyInitializedCppHeapPointerField(size_t offset, IsolateForPointerCompression isolate, Address value)
IndirectPointerSlot RawIndirectPointerField(int byte_offset, IndirectPointerTag tag) const
InstructionStreamSlot RawInstructionStreamField(int byte_offset) const
bool IsTrustedPointerFieldUnpublished(size_t offset, IndirectPointerTag tag, IsolateForSandbox isolate) const
bool IsLazilyInitializedExternalPointerFieldInitialized(size_t offset) const
static void VerifyObjectLayoutChange(Heap *heap, Tagged< HeapObject > object, Tagged< Map > new_map)
static void VerifySafeMapTransition(Heap *heap, Tagged< HeapObject > object, Tagged< Map > new_map)
static V8_WARN_UNUSED_RESULT Maybe< bool > IsArray(DirectHandle< JSProxy > proxy)
static V8_WARN_UNUSED_RESULT HandleType< Object >::MaybeType ToPrimitive(Isolate *isolate, HandleType< JSReceiver > receiver, ToPrimitiveHint hint=ToPrimitiveHint::kDefault)
static constexpr bool IsPacked(Address)
Tagged< Map > ToMap() const
constexpr Address ptr() const
bool IsForwardingAddress() const
constexpr MapWord(Address value)
static MapWord FromForwardingAddress(Tagged< HeapObject > map_word_host, Tagged< HeapObject > object)
static MapWord FromMap(const Tagged< Map > map)
Tagged< HeapObject > ToForwardingAddress(Tagged< HeapObject > map_word_host)
static constexpr uint32_t AddressToOffset(Address address)
static V8_INLINE MemoryChunk * FromHeapObject(Tagged< HeapObject > object)
static DirectHandle< Object > AsHandle(DirectHandle< Object > key)
static V8_WARN_UNUSED_RESULT MaybeHandle< Object > ToLength(Isolate *isolate, DirectHandle< Object > input)
static bool CanBeHeldWeakly(Tagged< Object > obj)
V8_EXPORT_PRIVATE static V8_WARN_UNUSED_RESULT MaybeHandle< Number > ConvertToLength(Isolate *isolate, DirectHandle< Object > input)
static V8_WARN_UNUSED_RESULT Maybe< bool > GreaterThan(Isolate *isolate, DirectHandle< Object > x, DirectHandle< Object > y)
static V8_WARN_UNUSED_RESULT bool ToArrayIndex(Tagged< Object > obj, uint32_t *index)
static bool ToArrayLength(Tagged< Object > obj, uint32_t *index)
static V8_WARN_UNUSED_RESULT HandleType< String >::MaybeType ToString(Isolate *isolate, HandleType< T > input)
V8_EXPORT_PRIVATE static V8_WARN_UNUSED_RESULT Maybe< bool > SetProperty(LookupIterator *it, DirectHandle< Object > value, StoreOrigin store_origin, Maybe< ShouldThrow > should_throw=Nothing< ShouldThrow >())
static V8_WARN_UNUSED_RESULT MaybeHandle< Object > GetPropertyOrElement(Isolate *isolate, DirectHandle< JSAny > object, DirectHandle< Name > name)
static V8_WARN_UNUSED_RESULT HandleType< Number >::MaybeType ToNumber(Isolate *isolate, HandleType< T > input)
static bool SameNumberValue(double number1, double number2)
static ElementsKind OptimalElementsKind(Tagged< Object > obj, PtrComprCageBase cage_base)
static V8_WARN_UNUSED_RESULT HandleType< Number >::MaybeType ToInteger(Isolate *isolate, HandleType< T > input)
static V8_WARN_UNUSED_RESULT HandleType< JSReceiver >::MaybeType ToObject(Isolate *isolate, HandleType< T > object, const char *method_name=nullptr)
static Representation OptimalRepresentation(Tagged< Object > obj, PtrComprCageBase cage_base)
static bool FilterKey(Tagged< Object > obj, PropertyFilter filter)
static V8_WARN_UNUSED_RESULT HandleType< Object >::MaybeType ToIndex(Isolate *isolate, HandleType< T > input, MessageTemplate error_index)
static V8_WARN_UNUSED_RESULT HandleType< Object >::MaybeType ToPropertyKey(Isolate *isolate, HandleType< T > value)
static V8_WARN_UNUSED_RESULT MaybeDirectHandle< Object > SetElement(Isolate *isolate, DirectHandle< JSAny > object, uint32_t index, DirectHandle< Object > value, ShouldThrow should_throw)
static V8_WARN_UNUSED_RESULT Maybe< bool > LessThan(Isolate *isolate, DirectHandle< Object > x, DirectHandle< Object > y)
static V8_WARN_UNUSED_RESULT MaybeDirectHandle< Object > SetPropertyOrElement(Isolate *isolate, DirectHandle< JSAny > object, DirectHandle< Name > name, DirectHandle< Object > value, Maybe< ShouldThrow > should_throw=Nothing< ShouldThrow >(), StoreOrigin store_origin=StoreOrigin::kMaybeKeyed)
static double NumberValue(Tagged< Number > obj)
static V8_WARN_UNUSED_RESULT Maybe< double > IntegerValue(Isolate *isolate, HandleType< T > input)
static V8_EXPORT_PRIVATE bool ToInt32(Tagged< Object > obj, int32_t *value)
static V8_WARN_UNUSED_RESULT Maybe< bool > GreaterThanOrEqual(Isolate *isolate, DirectHandle< Object > x, DirectHandle< Object > y)
static V8_WARN_UNUSED_RESULT HandleType< Object >::MaybeType ToPrimitive(Isolate *isolate, HandleType< T > input, ToPrimitiveHint hint=ToPrimitiveHint::kDefault)
static V8_WARN_UNUSED_RESULT Maybe< bool > LessThanOrEqual(Isolate *isolate, DirectHandle< Object > x, DirectHandle< Object > y)
static V8_WARN_UNUSED_RESULT HandleType< Name >::MaybeType ToName(Isolate *isolate, HandleType< Object > input)
V8_EXPORT_PRIVATE static V8_WARN_UNUSED_RESULT MaybeHandle< Object > GetProperty(LookupIterator *it, bool is_global_reference=false)
static bool ToUint32(Tagged< Object > obj, uint32_t *value)
static bool HasValidElements(Tagged< Object > obj)
static bool ToIntegerIndex(Tagged< Object > obj, size_t *index)
static bool FitsRepresentation(Tagged< Object > obj, Representation representation, bool allow_coercion=true)
static Tagged< Object > GetSimpleHash(Tagged< Object > object)
V8_EXPORT_PRIVATE static V8_WARN_UNUSED_RESULT Maybe< ComparisonResult > Compare(Isolate *isolate, DirectHandle< Object > x, DirectHandle< Object > y)
static HandleType< Object >::MaybeType Share(Isolate *isolate, HandleType< T > value, ShouldThrow throw_if_cannot_be_shared)
static V8_WARN_UNUSED_RESULT HandleType< Object >::MaybeType ToNumeric(Isolate *isolate, HandleType< T > input)
static V8_WARN_UNUSED_RESULT MaybeHandle< Object > GetElement(Isolate *isolate, DirectHandle< JSAny > object, uint32_t index)
detail::ArrayHeaderBase< HeapObjectLayout, true > Header
constexpr PropertyDetails(PropertyKind kind, PropertyAttributes attributes, PropertyCellType cell_type, int dictionary_index=0)
PropertyLocation location() const
int field_width_in_words() const
Tagged< Smi > AsSmi() const
static V8_EXPORT_PRIVATE ReadOnlyRoots EarlyGetReadOnlyRoots(Tagged< HeapObject > object)
Relocatable(Isolate *isolate)
constexpr bool IsHeapObject() const
constexpr bool IsNone() const
static constexpr Representation Double()
constexpr bool IsSmi() const
static constexpr Representation HeapObject()
static constexpr Representation None()
static constexpr Representation Smi()
constexpr bool IsDouble() const
static V8_EXPORT_PRIVATE constexpr Tagged< Smi > const kNoSharedNameSentinel
static constexpr int ToInt(const Tagged< Object > object)
static constexpr Tagged< Smi > FromInt(int value)
static constexpr Tagged< Smi > FromIntptr(intptr_t value)
static constexpr Tagged< Smi > ToUint32Smi(Tagged< Smi > smi)
static constexpr Tagged< Smi > zero()
static constexpr int kMaxValue
V8_INLINE bool IsThin() const
V8_INLINE bool IsExternalOneByte() const
V8_INLINE bool IsCons() const
V8_INLINE bool IsSliced() const
V8_INLINE bool IsExternalTwoByte() const
V8_INLINE bool IsSequentialOneByte() const
V8_INLINE bool IsSequentialTwoByte() const
V8_INLINE bool IsSequential() const
static Tagged_t Relaxed_CompareAndSwap(Tagged< HeapObject > host, PtrType old, PtrType value)
static void Release_Store(Tagged< HeapObject > host, PtrType value)
static PtrType load(Tagged< HeapObject > host, int offset=0)
static void Relaxed_Store_Map_Word(Tagged< HeapObject > host, PtrType value)
static Address address(Tagged< HeapObject > host, int offset=0)
static PtrType Acquire_Load_No_Unpack(PtrComprCageBase cage_base, Tagged< HeapObject > host, int offset=0)
static Tagged_t Release_CompareAndSwap(Tagged< HeapObject > host, PtrType old, PtrType value)
static PtrType Acquire_Load(Tagged< HeapObject > host, int offset=0)
static void Release_Store_Map_Word(Tagged< HeapObject > host, PtrType value)
static PtrType Relaxed_Load_Map_Word(PtrComprCageBase cage_base, Tagged< HeapObject > host)
V8_INLINE constexpr StorageType ptr() const
constexpr bool IsSmi() const
static bool constexpr IsValid(intptr_t value)
constexpr V8_INLINE bool IsSmi() const
static V8_INLINE constexpr Tagged_t CompressAny(Address tagged)
V8_INLINE void WriteHeaderSlot(Tagged< T > value, RelaxedStoreTag) const
static WriteBarrierMode GetWriteBarrierModeForObject(Tagged< HeapObject > object, const DisallowGarbageCollection &promise)
static void ForValue(Tagged< HeapObject > host, MaybeObjectSlot slot, Tagged< T > value, WriteBarrierMode mode)
#define V8_EXTERNAL_CODE_SPACE_BOOL
#define COMPRESS_POINTERS_BOOL
#define HAS_SMI_TAG(value)
#define USE_ALLOCATION_ALIGNMENT_BOOL
#define V8_ENABLE_SANDBOX_BOOL
#define ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, dst, call, value)
#define MAYBE_RETURN_NULL(call)
ZoneVector< RpoNumber > & result
constexpr uint64_t double_to_uint64(double d)
V8_INLINE Dest bit_cast(Source const &source)
V8_INLINE IndirectHandle< T > handle(Tagged< T > object, Isolate *isolate)
V8_INLINE void WriteExternalPointerField(Address field_address, IsolateForSandbox isolate, Address value)
V8_INLINE Address ReadCppHeapPointerField(Address field_address, IsolateForPointerCompression isolate)
V8_INLINE Address ReadCodeEntrypointViaCodePointerField(Address field_address, CodeEntrypointTag tag)
bool TryCast(Tagged< From > value, Tagged< To > *out)
constexpr int kTaggedSize
constexpr double kMaxSafeInteger
V8_INLINE void WriteIndirectPointerField(Address field_address, Tagged< ExposedTrustedObject > value, ReleaseStoreTag)
bool IsNaN(Tagged< Object > obj)
bool IsPrimitiveMap(Tagged< Map > map)
uint32_t ComputeLongHash(uint64_t key)
static DirectHandle< Object > MakeEntryPair(Isolate *isolate, size_t index, DirectHandle< Object > value)
bool DoubleToUint32IfEqualToSelf(double value, uint32_t *uint32_value)
bool IsNumeric(Tagged< Object > obj)
SlotTraits::TObjectSlot ObjectSlot
constexpr intptr_t kObjectAlignment
bool Is(IndirectHandle< U > value)
bool IsNumber(Tagged< Object > obj)
ReadOnlyRoots GetReadOnlyRoots()
bool IsAnyHole(Tagged< Object > obj, PtrComprCageBase cage_base)
const intptr_t kForwardingTagMask
bool IsSpecialReceiverInstanceType(InstanceType instance_type)
V8_INLINE Tagged< Object > ReadIndirectPointerField(Address field_address, IsolateForSandbox isolate, AcquireLoadTag)
V8_INLINE size_t ReadBoundedSizeField(Address field_address)
bool IsCustomElementsReceiverMap(Tagged< Map > map)
Tagged(T object) -> Tagged< T >
static void WriteMaybeUnalignedValue(Address p, V value)
double DoubleToInteger(double x)
uint32_t ComputeUnseededHash(uint32_t key)
V8_INLINE Address ReadSandboxedPointerField(Address field_address, PtrComprCageBase cage_base)
V8_INLINE void WriteLazilyInitializedCppHeapPointerField(Address field_address, IsolateForPointerCompression isolate, Address value)
V8_INLINE void WriteBoundedSizeField(Address field_address, size_t value)
V8_INLINE constexpr bool IsSmi(TaggedImpl< kRefType, StorageType > obj)
bool IsSpecialReceiverMap(Tagged< Map > map)
bool IsPublicSymbol(Tagged< Object > obj)
kInterpreterTrampolineOffset Tagged< HeapObject >
SlotTraits::TInstructionStreamSlot InstructionStreamSlot
V8_INLINE Address ReadExternalPointerField(Address field_address, IsolateForSandbox isolate)
bool IsCustomElementsReceiverInstanceType(InstanceType instance_type)
Union< Smi, HeapNumber > Number
bool IsNullOrUndefined(Tagged< Object > obj, Isolate *isolate)
Handle< To > UncheckedCast(Handle< From > value)
uint32_t IndirectPointerHandle
V8_INLINE bool OutsideSandboxOrInReadonlySpace(Tagged< HeapObject > obj)
V8_INLINE PtrComprCageBase GetPtrComprCageBase()
constexpr ExternalPointerHandle kNullExternalPointerHandle
bool IsPrimitive(Tagged< Object > obj)
bool IsShared(Tagged< Object > obj)
bool IsJSObjectThatCanBeTrackedAsPrototype(Tagged< Object > obj)
@ UNCACHED_EXTERNAL_INTERNALIZED_ONE_BYTE_STRING_TYPE
@ SHARED_SEQ_ONE_BYTE_STRING_TYPE
@ SHARED_SEQ_TWO_BYTE_STRING_TYPE
@ SHARED_EXTERNAL_TWO_BYTE_STRING_TYPE
@ UNCACHED_EXTERNAL_INTERNALIZED_TWO_BYTE_STRING_TYPE
@ LAST_SPECIAL_RECEIVER_TYPE
@ LAST_CUSTOM_ELEMENTS_RECEIVER
@ SHARED_UNCACHED_EXTERNAL_TWO_BYTE_STRING_TYPE
@ SHARED_UNCACHED_EXTERNAL_ONE_BYTE_STRING_TYPE
@ EXTERNAL_INTERNALIZED_TWO_BYTE_STRING_TYPE
@ SHARED_EXTERNAL_ONE_BYTE_STRING_TYPE
@ EXTERNAL_INTERNALIZED_ONE_BYTE_STRING_TYPE
@ INTERNALIZED_ONE_BYTE_STRING_TYPE
@ INTERNALIZED_TWO_BYTE_STRING_TYPE
DONT_OVERRIDE DISABLE_ALLOCATION_SITES DISABLE_ALLOCATION_SITES HOLEY_DOUBLE_ELEMENTS
V8_INLINE void InitSelfIndirectPointerField(Address field_address, IsolateForSandbox isolate, Tagged< HeapObject > host, IndirectPointerTag tag, TrustedPointerPublishingScope *opt_publishing_scope)
@ kExternalPointerNullTag
V8_INLINE constexpr bool IsHeapObject(TaggedImpl< kRefType, StorageType > obj)
V8_EXPORT_PRIVATE FlagValues v8_flags
V8_INLINE void InitExternalPointerField(Address host_address, Address field_address, IsolateForSandbox isolate, Address value)
bool IsUniqueName(Tagged< Name > obj)
constexpr IndirectPointerHandle kNullIndirectPointerHandle
NameDictionary PropertyDictionary
uint32_t ExternalPointerHandle
static uint32_t ObjectAddressForHashing(Address object)
V8_INLINE void WriteSandboxedPointerField(Address field_address, PtrComprCageBase cage_base, Address pointer)
static bool IsMinusZero(double value)
bool IsJSApiWrapperObject(Tagged< Map > map)
bool IsTaggedIndex(Tagged< Object > obj)
bool IsPrivateSymbol(Tagged< Object > obj)
static V ReadMaybeUnalignedValue(Address p)
bool IsNoSharedNameSentinel(Tagged< Object > obj)
static constexpr Address kNullAddress
SlotTraits::TMaybeObjectSlot MaybeObjectSlot
constexpr intptr_t kDoubleAlignmentMask
V8_INLINE bool InsideSandbox(uintptr_t address)
constexpr uint32_t kMaxUInt32
kInstanceDescriptorsOffset kTransitionsOrPrototypeInfoOffset IsNull(value)||IsJSProxy(value)||IsWasmObject(value)||(IsJSObject(value) &&(HeapLayout
V8_INLINE void WriteCodeEntrypointViaCodePointerField(Address field_address, Address value, CodeEntrypointTag tag)
V8_INLINE IndirectPointerTag IndirectPointerTagFromInstanceType(InstanceType instance_type)
V8_INLINE constexpr bool FastInReadOnlySpaceOrSmallSmi(Tagged_t obj)
static bool IsZero(const Operand &rt)
Tagged< To > Cast(Tagged< From > value, const v8::SourceLocation &loc=INIT_SOURCE_LOCATION_IN_DEBUG)
static constexpr ReleaseStoreTag kReleaseStore
static constexpr RelaxedLoadTag kRelaxedLoad
static constexpr RelaxedStoreTag kRelaxedStore
static constexpr AcquireLoadTag kAcquireLoad
Maybe< T > Just(const T &t)
#define HEAP_OBJECT_TYPE_LIST(V)
#define HEAP_OBJECT_TRUSTED_TYPE_LIST(V)
#define VIRTUAL_OBJECT_TYPE_LIST(V)
#define HEAP_OBJECT_ORDINARY_TYPE_LIST(V)
#define CONDITIONAL_JS_DISPATCH_HANDLE_WRITE_BARRIER(object, handle, mode)
#define DEF_ACQUIRE_GETTER(holder, name,...)
#define EXTERNAL_POINTER_WRITE_BARRIER(object, offset, tag)
#define DEF_HEAP_OBJECT_PREDICATE(holder, name)
#define ACQUIRE_READ_UINT32_FIELD(p, offset)
#define CONDITIONAL_EXTERNAL_POINTER_WRITE_BARRIER(object, offset, tag, mode)
#define RELEASE_WRITE_UINT32_FIELD(p, offset, value)
#define IS_HELPER_DEF_STRUCT(NAME, Name, name)
#define IS_TYPE_FUNCTION_DEF(type_)
#define MAKE_STRUCT_PREDICATE(NAME, Name, name)
#define IS_HELPER_DEF(Type,...)
#define DCHECK_IMPLIES(v1, v2)
#define CHECK_EQ(lhs, rhs)
#define DCHECK(condition)
#define DCHECK_EQ(v1, v2)
constexpr bool IsAligned(T value, U alignment)
static bool AllowFrom(Tagged< From > value)
static bool AllowFrom(Tagged< HeapObject > value)
static bool AllowFrom(Tagged< Object > value)
static bool AllowFrom(Tagged< Object > value)
static bool AllowFrom(Tagged< HeapObject > value)
static bool AllowFrom(Tagged< HeapObject > value)
static bool AllowFrom(Tagged< Object > value)
static bool AllowFrom(Tagged< HeapObject > value)
static bool AllowFrom(Tagged< Object > value)