97#include "torque-generated/class-verifiers.h"
99#if V8_ENABLE_WEBASSEMBLY
132#define USE_TORQUE_VERIFIER(Class) \
133 void Class::Class##Verify(Isolate* isolate) { \
134 TorqueGeneratedClassVerifiers::Class##Verify(*this, isolate); \
139 RCS_SCOPE(isolate, RuntimeCallCounterId::kObjectVerify);
145 PtrComprCageBase cage_base(isolate);
146 CHECK(!IsConstructor(obj, cage_base) || IsCallable(obj, cage_base));
151 HeapObject::VerifyHeapPointer(isolate, p);
162 HeapObject::VerifyHeapPointer(isolate, p);
171 if (p.GetHeapObject(&heap_object)) {
172 HeapObject::VerifyHeapPointer(isolate, heap_object);
179void Smi::SmiVerify(
Tagged<Smi> obj, Isolate* isolate) {
181 CHECK(!IsCallable(obj));
182 CHECK(!IsConstructor(obj));
186void TaggedIndex::TaggedIndexVerify(Tagged<TaggedIndex> obj, Isolate* isolate) {
190void HeapObject::HeapObjectVerify(Isolate* isolate) {
192 PtrComprCageBase cage_base(isolate);
193 Object::VerifyPointer(isolate,
map(cage_base));
194 CHECK(IsMap(
map(cage_base), cage_base));
202 switch (
map(cage_base)->instance_type()) {
203#define STRING_TYPE_CASE(TYPE, size, name, CamelName) case TYPE:
205#undef STRING_TYPE_CASE
221 case HASH_TABLE_TYPE:
222 case ORDERED_HASH_MAP_TYPE:
223 case ORDERED_HASH_SET_TYPE:
224 case ORDERED_NAME_DICTIONARY_TYPE:
225 case NAME_TO_INDEX_HASH_TABLE_TYPE:
226 case REGISTERED_SYMBOL_TABLE_TYPE:
227 case NAME_DICTIONARY_TYPE:
228 case GLOBAL_DICTIONARY_TYPE:
229 case NUMBER_DICTIONARY_TYPE:
230 case SIMPLE_NUMBER_DICTIONARY_TYPE:
231 case EPHEMERON_HASH_TABLE_TYPE:
234 case AWAIT_CONTEXT_TYPE:
235 case BLOCK_CONTEXT_TYPE:
236 case CATCH_CONTEXT_TYPE:
237 case DEBUG_EVALUATE_CONTEXT_TYPE:
238 case EVAL_CONTEXT_TYPE:
239 case FUNCTION_CONTEXT_TYPE:
240 case MODULE_CONTEXT_TYPE:
241 case SCRIPT_CONTEXT_TYPE:
242 case WITH_CONTEXT_TYPE:
245 case NATIVE_CONTEXT_TYPE:
248 case FEEDBACK_METADATA_TYPE:
251 case TRANSITION_ARRAY_TYPE:
255 case INSTRUCTION_STREAM_TYPE:
258 case JS_API_OBJECT_TYPE:
259 case JS_ARRAY_ITERATOR_PROTOTYPE_TYPE:
260 case JS_CONTEXT_EXTENSION_OBJECT_TYPE:
262 case JS_ITERATOR_PROTOTYPE_TYPE:
263 case JS_MAP_ITERATOR_PROTOTYPE_TYPE:
264 case JS_OBJECT_PROTOTYPE_TYPE:
265 case JS_PROMISE_PROTOTYPE_TYPE:
266 case JS_REG_EXP_PROTOTYPE_TYPE:
267 case JS_SET_ITERATOR_PROTOTYPE_TYPE:
268 case JS_SET_PROTOTYPE_TYPE:
269 case JS_SPECIAL_API_OBJECT_TYPE:
270 case JS_STRING_ITERATOR_PROTOTYPE_TYPE:
271 case JS_TYPED_ARRAY_PROTOTYPE_TYPE:
274#if V8_ENABLE_WEBASSEMBLY
275 case WASM_TRUSTED_INSTANCE_DATA_TYPE:
279 case WASM_DISPATCH_TABLE_TYPE:
282 case WASM_VALUE_OBJECT_TYPE:
285 case WASM_EXCEPTION_PACKAGE_TYPE:
289 case JS_SET_KEY_VALUE_ITERATOR_TYPE:
290 case JS_SET_VALUE_ITERATOR_TYPE:
293 case JS_MAP_KEY_ITERATOR_TYPE:
294 case JS_MAP_KEY_VALUE_ITERATOR_TYPE:
295 case JS_MAP_VALUE_ITERATOR_TYPE:
303 case CODE_WRAPPER_TYPE:
307#define MAKE_TORQUE_CASE(Name, TYPE) \
309 Cast<Name>(*this)->Name##Verify(isolate); \
315#undef MAKE_TORQUE_CASE
321 case CLASS_POSITIONS_TYPE:
325 case ACCESSOR_PAIR_TYPE:
329 case ALLOCATION_SITE_TYPE:
333 case LOAD_HANDLER_TYPE:
337 case STORE_HANDLER_TYPE:
341 case BIG_INT_BASE_TYPE:
345 case JS_CLASS_CONSTRUCTOR_TYPE:
346 case JS_PROMISE_CONSTRUCTOR_TYPE:
347 case JS_REG_EXP_CONSTRUCTOR_TYPE:
348 case JS_ARRAY_CONSTRUCTOR_TYPE:
349#define TYPED_ARRAY_CONSTRUCTORS_SWITCH(Type, type, TYPE, Ctype) \
350 case TYPE##_TYPED_ARRAY_CONSTRUCTOR_TYPE:
352#undef TYPED_ARRAY_CONSTRUCTORS_SWITCH
355 case JS_LAST_DUMMY_API_OBJECT_TYPE:
361void HeapObject::VerifyHeapPointer(Isolate* isolate,
Tagged<Object> p) {
370void HeapObject::VerifyCodePointer(Isolate* isolate,
Tagged<Object> p) {
373 PtrComprCageBase cage_base(isolate);
377void Name::NameVerify(Isolate* isolate) {
378 PrimitiveHeapObjectVerify(isolate);
382void Symbol::SymbolVerify(Isolate* isolate) {
384 CHECK(IsSymbol(
this));
394void BytecodeArray::BytecodeArrayVerify(Isolate* isolate) {
395 ExposedTrustedObjectVerify(isolate);
404 Object::VerifyPointer(isolate, o);
405 CHECK(IsTrustedFixedArray(o));
408 auto o = handler_table();
409 Object::VerifyPointer(isolate, o);
410 CHECK(IsTrustedByteArray(o));
414 Object::VerifyPointer(isolate, o);
415 CHECK(IsBytecodeWrapper(o));
417 CHECK_EQ(o->bytecode(isolate), *
this);
422 Object::VerifyPointer(isolate, o);
434void BytecodeWrapper::BytecodeWrapperVerify(Isolate* isolate) {
435 if (!this->has_bytecode())
return;
436 auto bytecode = this->
bytecode(isolate);
437 Object::VerifyPointer(isolate, bytecode);
438 CHECK_EQ(bytecode->wrapper(), *
this);
441bool JSObject::ElementsAreSafeToExamine(PtrComprCageBase cage_base)
const {
451 if (IsJSTypedArray(
object)) {
457 CHECK(!IsByteArray(object->elements()));
459 if (object->HasDoubleElements()) {
460 if (object->elements()->length() > 0) {
461 CHECK(IsFixedDoubleArray(object->elements()));
466 if (object->HasSloppyArgumentsElements()) {
467 CHECK(IsSloppyArgumentsElements(object->elements()));
472 if (object->HasSmiElements()) {
475 for (
int i = 0;
i < elements->
length();
i++) {
477 CHECK(
IsSmi(value) || IsTheHole(value, isolate));
479 }
else if (object->HasObjectElements()) {
480 for (
int i = 0;
i < elements->
length();
i++) {
488void JSObject::JSObjectVerify(Isolate* isolate) {
489 TorqueGeneratedClassVerifiers::JSObjectVerify(*
this, isolate);
490 VerifyHeapPointer(isolate,
elements());
492 CHECK_IMPLIES(HasSloppyArgumentsElements(), IsJSArgumentsObject(*
this));
493 if (HasFastProperties()) {
494 int actual_unused_property_fields =
map()->GetInObjectProperties() +
495 property_array()->length() -
496 map()->NextFreePropertyIndex();
497 if (
map()->UnusedPropertyFields() != actual_unused_property_fields) {
504 CHECK_GT(actual_unused_property_fields,
map()->UnusedPropertyFields());
505 int delta = actual_unused_property_fields -
map()->UnusedPropertyFields();
509 bool is_transitionable_fast_elements_kind =
512 for (InternalIndex
i :
map()->IterateOwnDescriptors()) {
513 PropertyDetails details = descriptors->GetDetails(
i);
516 Representation
r = details.representation();
519 VerifyObjectField(isolate, index.offset());
523 if (IsUninitialized(value, isolate))
continue;
527 bool type_is_none =
IsNone(field_type);
528 bool type_is_any =
IsAny(field_type);
531 }
else if (
r.IsHeapObject()) {
532 CHECK(!type_is_none);
551 CHECK_IMPLIES(indices != ReadOnlyRoots(isolate).empty_fixed_array(),
552 keys->length() == indices->length());
558 if (ElementsAreSafeToExamine(isolate)) {
559 CHECK_EQ((
map()->has_fast_smi_or_object_elements() ||
560 map()->has_any_nonextensible_elements() ||
562 HasFastStringWrapperElements()),
565 CHECK_EQ(
map()->has_fast_object_elements(), HasObjectElements());
566 VerifyJSObjectElements(isolate, *
this);
570void Map::MapVerify(Isolate* isolate) {
571 TorqueGeneratedClassVerifiers::MapVerify(*
this, isolate);
572 Heap*
heap = isolate->heap();
577 static_cast<size_t>(instance_size()) <
heap->Capacity()));
578#if V8_ENABLE_WEBASSEMBLY
579 bool is_wasm_struct = InstanceTypeChecker::IsWasmStruct(instance_type());
581 constexpr bool is_wasm_struct =
false;
583 if (IsContextMap(*
this)) {
588 IsNativeContext(native_context_or_null()));
590 CHECK_EQ(native_context_or_null(),
map()->native_context_or_null());
592 if (IsUndefined(GetBackPointer(), isolate)) {
593 if (!is_wasm_struct) {
601 Tagged<Map> parent =
Cast<Map>(GetBackPointer());
602 CHECK(!parent->is_stable());
606 parent->IsInobjectSlackTrackingInProgress());
608 if (descriptors == parent->instance_descriptors(isolate)) {
612 CHECK(!parent->owns_descriptors());
618 if (descriptors != ReadOnlyRoots(isolate).empty_descriptor_array()) {
619 CHECK_IMPLIES(owns_descriptors(), !parent->owns_descriptors());
620 CHECK_IMPLIES(parent->owns_descriptors(), !owns_descriptors());
626 if (!is_wasm_struct) {
629 SLOW_DCHECK(TransitionsAccessor(isolate, *
this).IsSortedNoDuplicates());
631 TransitionsAccessor(isolate, *
this).IsConsistentWithBackPointers());
639 if (instance_type() == NATIVE_CONTEXT_TYPE ||
640 instance_type() == JS_GLOBAL_PROXY_TYPE) {
646 IsNativeContext(
map()->native_context_or_null()));
648 }
else if (instance_type() == JS_SPECIAL_API_OBJECT_TYPE) {
653 IsNativeContext(
map()->native_context_or_null()));
658 CHECK(IsNativeContext(
map()->native_context_or_null()));
660 }
else if (InstanceTypeChecker::IsAlwaysSharedSpaceJSObject(
666 if (IsJSObjectMap(*
this)) {
674 inobject_fields_start_offset);
676 if (IsJSSharedStructMap(*
this) || IsJSSharedArrayMap(*
this) ||
677 IsJSAtomicsMutex(*
this) || IsJSAtomicsCondition(*
this)) {
682 CHECK(IsUndefined(GetBackPointer(), isolate));
689 if (IsJSSharedArrayMap(*
this)) {
694 CHECK(IsUndefined(GetBackPointer(), isolate));
696 if (IsCell(maybe_cell))
702 if (IsJSSharedArrayMap(*
this)) {
713 CHECK_IMPLIES(has_non_instance_prototype(), IsTuple2(maybe_constructor));
714 if (IsTuple2(maybe_constructor)) {
717 maybe_constructor = tuple->value1();
718 CHECK(!IsJSReceiver(tuple->value2()));
720 CHECK(IsJSFunction(maybe_constructor) ||
721 IsFunctionTemplateInfo(maybe_constructor) ||
723 IsUndefined(isolate->raw_native_context()->get(
724 Context::EMPTY_FUNCTION_INDEX)));
728 if (!may_have_interesting_properties()) {
730 CHECK(!is_dictionary_map());
734 CHECK(!descriptors->GetKey(
i)->IsInteresting(isolate));
738 CHECK_IMPLIES(is_dictionary_map(), may_have_interesting_properties());
749 CHECK(prototype_info() ==
Smi::zero() || IsPrototypeInfo(prototype_info()));
753void Map::DictionaryMapVerify(Isolate* isolate) {
755 CHECK(is_dictionary_map());
757 CHECK_EQ(ReadOnlyRoots(isolate).empty_descriptor_array(),
763void EmbedderDataArray::EmbedderDataArrayVerify(Isolate* isolate) {
764 TorqueGeneratedClassVerifiers::EmbedderDataArrayVerify(*
this, isolate);
765 EmbedderDataSlot
start(*
this, 0);
767 for (EmbedderDataSlot slot =
start; slot <
end; ++slot) {
769 Object::VerifyPointer(isolate, e);
773void FixedArrayBase::FixedArrayBaseVerify(Isolate* isolate) {
777void FixedArray::FixedArrayVerify(Isolate* isolate) {
781 Object::VerifyPointer(isolate,
get(
i));
784 if (
this == ReadOnlyRoots(isolate).empty_fixed_array()) {
786 CHECK_EQ(
map(), ReadOnlyRoots(isolate).fixed_array_map());
790void TrustedFixedArray::TrustedFixedArrayVerify(Isolate* isolate) {
791 TrustedObjectVerify(isolate);
795 Object::VerifyPointer(isolate,
get(
i));
799void ProtectedFixedArray::ProtectedFixedArrayVerify(Isolate* isolate) {
800 TrustedObjectVerify(isolate);
806 CHECK(
IsSmi(element) || IsTrustedObject(element));
807 Object::VerifyPointer(isolate, element);
811void RegExpMatchInfo::RegExpMatchInfoVerify(Isolate* isolate) {
819 for (
int i = 0;
i < capacity(); ++
i) {
824void FeedbackCell::FeedbackCellVerify(Isolate* isolate) {
826 Object::VerifyPointer(isolate, v);
827 CHECK(IsUndefined(v) || IsClosureFeedbackCellArray(v) || IsFeedbackVector(v));
829#ifdef V8_ENABLE_LEAPTIERING
836 CHECK(
kind == CodeKind::FOR_TESTING ||
kind == CodeKind::BUILTIN ||
837 kind == CodeKind::INTERPRETED_FUNCTION ||
kind == CodeKind::BASELINE ||
838 kind == CodeKind::MAGLEV ||
kind == CodeKind::TURBOFAN_JS);
842void ClosureFeedbackCellArray::ClosureFeedbackCellArrayVerify(
846 Object::VerifyPointer(isolate,
get(
i));
850void WeakFixedArray::WeakFixedArrayVerify(Isolate* isolate) {
853 Object::VerifyMaybeObjectPointer(isolate,
get(
i));
857void TrustedWeakFixedArray::TrustedWeakFixedArrayVerify(Isolate* isolate) {
860 Object::VerifyMaybeObjectPointer(isolate,
get(
i));
864void ProtectedWeakFixedArray::ProtectedWeakFixedArrayVerify(Isolate* isolate) {
865 TrustedObjectVerify(isolate);
870 if (p.GetHeapObject(&heap_object)) {
874 CHECK(IsTrustedObject(heap_object));
875 HeapObject::VerifyHeapPointer(isolate, heap_object);
877 CHECK(p.IsSmi() || p.IsCleared());
882void ScriptContextTable::ScriptContextTableVerify(Isolate* isolate) {
889 for (
int i = 0;
i < len; ++
i) {
891 Object::VerifyPointer(isolate, o);
893 CHECK(o->IsScriptContext());
897void ArrayList::ArrayListVerify(Isolate* isolate) {
901 this == ReadOnlyRoots(isolate).empty_array_list());
902 for (
int i = 0;
i < capacity(); ++
i) {
903 Object::VerifyPointer(isolate,
get(
i));
907void PropertyArray::PropertyArrayVerify(Isolate* isolate) {
908 TorqueGeneratedClassVerifiers::PropertyArrayVerify(*
this, isolate);
910 CHECK_EQ(*
this, ReadOnlyRoots(isolate).empty_property_array());
917 Object::VerifyPointer(isolate, e);
921void ByteArray::ByteArrayVerify(Isolate* isolate) {}
923void TrustedByteArray::TrustedByteArrayVerify(Isolate* isolate) {
924 TrustedObjectVerify(isolate);
927void FixedDoubleArray::FixedDoubleArrayVerify(Isolate* isolate) {
931 uint64_t unexpected =
933 uint64_t{0x7FF8000000000000};
935 unexpected ^= uint64_t{0x0008000000000000};
936 CHECK((value & uint64_t{0x7FF8000000000000}) != unexpected ||
937 (value & uint64_t{0x0007FFFFFFFFFFFF}) == uint64_t{0});
942void Context::ContextVerify(Isolate* isolate) {
944 TorqueGeneratedClassVerifiers::ContextVerify(*
this, isolate);
950 CHECK(IsFixedArray(side_data));
955 if (
v8_flags.script_context_mutable_heap_number ||
957 for (
int i = 0;
i < side_data_array->
length();
i++) {
959 if (
IsSmi(element)) {
960 int value = element.ToSmi().value();
965 CHECK(IsUndefined(element) || IsContextSidePropertyCell(element));
972void NativeContext::NativeContextVerify(Isolate* isolate) {
973 ContextVerify(isolate);
974 CHECK(retained_maps() ==
Smi::zero() || IsWeakArrayList(retained_maps()));
979void FeedbackMetadata::FeedbackMetadataVerify(Isolate* isolate) {
981 CHECK_EQ(ReadOnlyRoots(isolate).empty_feedback_metadata(), *
this);
983 FeedbackMetadataIterator iter(*
this);
984 while (iter.HasNext()) {
993void DescriptorArray::DescriptorArrayVerify(Isolate* isolate) {
994 TorqueGeneratedClassVerifiers::DescriptorArrayVerify(*
this, isolate);
995 if (number_of_all_descriptors() == 0) {
996 CHECK_EQ(ReadOnlyRoots(isolate).empty_descriptor_array(), *
this);
997 CHECK_EQ(0, number_of_all_descriptors());
999 CHECK_EQ(ReadOnlyRoots(isolate).empty_enum_cache(), enum_cache());
1001 CHECK_LT(0, number_of_all_descriptors());
1006 int expected_field_index = 0;
1007 for (InternalIndex descriptor :
1013 if (IsUndefined(
key, isolate))
continue;
1014 PropertyDetails details =
GetDetails(descriptor);
1020 CHECK_EQ(details.field_index(), expected_field_index);
1022 IsMap(value.GetHeapObjectAssumeWeak()));
1023 expected_field_index += details.field_width_in_words();
1025 CHECK(!value.IsWeakOrCleared());
1032void TransitionArray::TransitionArrayVerify(Isolate* isolate) {
1033 WeakFixedArrayVerify(isolate);
1036 ReadOnlyRoots roots(isolate);
1042 Tagged<Map> parent =
Cast<Map>(target->constructor_or_back_pointer());
1043 if (owner.is_null()) {
1057 if (maybe_target.GetHeapObjectIfWeak(&target)) {
1058 if (
v8_flags.move_prototype_transitions_first) {
1059 Tagged<Map> parent =
1061 if (owner.is_null()) {
1079 if (maybe_target.GetHeapObjectIfWeak(&target)) {
1080 CHECK(IsMap(target));
1081 if (!owner.is_null()) {
1082 CHECK_EQ(target->map(), owner->map());
1094 if (maybe_cell.GetHeapObjectIfWeak(&cell)) {
1095 CHECK(IsCell(cell));
1103void SloppyArgumentsElementsVerify(Isolate* isolate,
1106 elements->SloppyArgumentsElementsVerify(isolate);
1111 if (arg_elements->length() == 0) {
1112 CHECK(arg_elements == ReadOnlyRoots(isolate).empty_fixed_array());
1115 ElementsAccessor* accessor;
1121 int nofMappedParameters = 0;
1122 int maxMappedIndex = 0;
1123 for (
int i = 0;
i < nofMappedParameters;
i++) {
1127 if (IsTheHole(mapped, isolate)) {
1129 if (!is_fast)
continue;
1132 CHECK(accessor->HasElement(holder,
i, arg_elements));
1136 nofMappedParameters++;
1137 CHECK_LE(maxMappedIndex, mappedIndex);
1138 maxMappedIndex = mappedIndex;
1143 CHECK(!accessor->HasElement(holder,
i, arg_elements));
1145 CHECK_LE(nofMappedParameters, context_object->length());
1146 CHECK_LE(nofMappedParameters, arg_elements->length());
1147 CHECK_LE(maxMappedIndex, context_object->length());
1148 CHECK_LE(maxMappedIndex, arg_elements->length());
1152void JSArgumentsObject::JSArgumentsObjectVerify(Isolate* isolate) {
1153 TorqueGeneratedClassVerifiers::JSArgumentsObjectVerify(*
this, isolate);
1155 SloppyArgumentsElementsVerify(
1160 map() ==
native_context->get(Context::SLOW_ALIASED_ARGUMENTS_MAP_INDEX) ||
1161 map() ==
native_context->get(Context::FAST_ALIASED_ARGUMENTS_MAP_INDEX)) {
1162 VerifyObjectField(isolate, JSSloppyArgumentsObject::kLengthOffset);
1163 VerifyObjectField(isolate, JSSloppyArgumentsObject::kCalleeOffset);
1166 VerifyObjectField(isolate, JSStrictArgumentsObject::kLengthOffset);
1170void JSAsyncFunctionObject::JSAsyncFunctionObjectVerify(Isolate* isolate) {
1171 TorqueGeneratedClassVerifiers::JSAsyncFunctionObjectVerify(*
this, isolate);
1174void JSAsyncGeneratorObject::JSAsyncGeneratorObjectVerify(Isolate* isolate) {
1175 TorqueGeneratedClassVerifiers::JSAsyncGeneratorObjectVerify(*
this, isolate);
1178void JSDate::JSDateVerify(Isolate* isolate) {
1179 TorqueGeneratedClassVerifiers::JSDateVerify(*
this, isolate);
1181 if (
IsSmi(month())) {
1183 CHECK(0 <= month && month <= 11);
1187 CHECK(1 <= day && day <= 31);
1195 CHECK(0 <= min && min <= 59);
1199 CHECK(0 <= sec && sec <= 59);
1201 if (
IsSmi(weekday())) {
1203 CHECK(0 <= weekday && weekday <= 6);
1205 if (
IsSmi(cache_stamp())) {
1211void String::StringVerify(Isolate* isolate) {
1212 PrimitiveHeapObjectVerify(isolate);
1213 CHECK(IsString(
this, isolate));
1222void ConsString::ConsStringVerify(Isolate* isolate) {
1223 StringVerify(isolate);
1235void ThinString::ThinStringVerify(Isolate* isolate) {
1236 StringVerify(isolate);
1243void SlicedString::SlicedStringVerify(Isolate* isolate) {
1244 StringVerify(isolate);
1249 if (!isolate->has_turbofan_string_builders()) {
1259void ExternalString::ExternalStringVerify(Isolate* isolate) {
1260 StringVerify(isolate);
1264void JSBoundFunction::JSBoundFunctionVerify(Isolate* isolate) {
1265 TorqueGeneratedClassVerifiers::JSBoundFunctionVerify(*
this, isolate);
1266 CHECK(IsCallable(*
this));
1267 CHECK_EQ(IsConstructor(*
this), IsConstructor(bound_target_function()));
1273void JSFunction::JSFunctionVerify(Isolate* isolate) {
1280 static_assert(JSFunction::TorqueGeneratedClass::kHeaderSize ==
1283 JSFunctionOrBoundFunctionOrWrappedFunctionVerify(isolate);
1284 CHECK(IsJSFunction(*
this));
1285 Object::VerifyPointer(isolate,
shared(isolate));
1291 Object::VerifyPointer(isolate,
code(isolate));
1293 CHECK(
map(isolate)->is_callable());
1297#ifdef V8_ENABLE_LEAPTIERING
1303 shared(isolate)->internal_formal_parameter_count_with_receiver());
1307 CHECK(!code_from_table->marked_for_deoptimization());
1321 if (code_from_table->is_context_specialized()) {
1323 ReadOnlyRoots(isolate).one_closure_cell_map());
1328#define CASE(name, ...) \
1329 entrypoint == BUILTIN_CODE(isolate, name)->instruction_start() ||
1331 entrypoint == code_from_table->instruction_start());
1336 DirectHandle<JSFunction> function(*
this, isolate);
1337 LookupIterator it(isolate, function, isolate->factory()->prototype_string(),
1340 VerifyObjectField(isolate, kPrototypeOrInitialMapOffset);
1343 if (has_prototype_property()) {
1344 CHECK(it.IsFound());
1346 CHECK(IsAccessorInfo(*it.GetAccessors()));
1349 !IsAccessorInfo(*it.GetAccessors()));
1355 shared()->internal_formal_parameter_count_with_receiver()));
1358void JSWrappedFunction::JSWrappedFunctionVerify(Isolate* isolate) {
1359 TorqueGeneratedClassVerifiers::JSWrappedFunctionVerify(*
this, isolate);
1360 CHECK(IsCallable(*
this));
1367bool ShouldVerifySharedFunctionInfoFunctionIndex(
1369 if (!sfi->HasBuiltinId())
return true;
1370 switch (sfi->builtin_id()) {
1371 case Builtin::kPromiseCapabilityDefaultReject:
1372 case Builtin::kPromiseCapabilityDefaultResolve:
1383void SharedFunctionInfo::SharedFunctionInfoVerify(LocalIsolate* isolate) {
1384 ReadOnlyRoots roots(isolate);
1387 if (IsScopeInfo(value)) {
1389 CHECK_NE(value, roots.empty_scope_info());
1392#if V8_ENABLE_WEBASSEMBLY
1393 bool is_wasm = HasWasmExportedFunctionData() || HasAsmWasmData() ||
1394 HasWasmJSFunctionData() || HasWasmCapiFunctionData() ||
1395 HasWasmResumeData();
1397 bool is_wasm =
false;
1405 CHECK(IsUndefined(script, roots) || IsScript(script));
1410 CHECK(IsScopeInfo(outer_scope_info()) ||
1411 IsTheHole(outer_scope_info(), roots));
1413 CHECK(IsFeedbackMetadata(feedback_metadata()));
1421 if (ShouldVerifySharedFunctionInfoFunctionIndex(*
this)) {
1422 int expected_map_index =
1424 CHECK_EQ(expected_map_index, function_map_index());
1428 if (!info->IsEmpty()) {
1438 if (builtin_id() != Builtin::kCompileLazy &&
1439 builtin_id() != Builtin::kEmptyFunction) {
1451void SharedFunctionInfo::SharedFunctionInfoVerify(Isolate* isolate) {
1453 SharedFunctionInfoVerify(isolate->AsLocalIsolate());
1456void SharedFunctionInfoWrapper::SharedFunctionInfoWrapperVerify(
1458 Object::VerifyPointer(isolate, shared_info());
1461void JSGlobalProxy::JSGlobalProxyVerify(Isolate* isolate) {
1462 TorqueGeneratedClassVerifiers::JSGlobalProxyVerify(*
this, isolate);
1468void JSGlobalObject::JSGlobalObjectVerify(Isolate* isolate) {
1469 CHECK(IsJSGlobalObject(*
this));
1471 if (global_dictionary(
kAcquireLoad)->NumberOfElements() == 0 &&
1472 elements()->
length() == 0) {
1475 JSObjectVerify(isolate);
1478void PrimitiveHeapObject::PrimitiveHeapObjectVerify(Isolate* isolate) {
1479 CHECK(IsPrimitiveHeapObject(
this, isolate));
1482void HeapNumber::HeapNumberVerify(Isolate* isolate) {
1483 PrimitiveHeapObjectVerify(isolate);
1484 CHECK(IsHeapNumber(
this, isolate));
1487void Oddball::OddballVerify(Isolate* isolate) {
1488 PrimitiveHeapObjectVerify(isolate);
1489 CHECK(IsOddball(
this, isolate));
1491 Heap*
heap = isolate->heap();
1493 Object::VerifyPointer(isolate,
string);
1494 CHECK(IsString(
string));
1496 Object::VerifyPointer(isolate, type);
1497 CHECK(IsString(type));
1499 Object::VerifyPointer(isolate, kind_value);
1503 Object::VerifyPointer(isolate, number);
1504 CHECK(
IsSmi(number) || IsHeapNumber(number));
1506 CHECK(number == ReadOnlyRoots(
heap).nan_value() ||
1507 number == ReadOnlyRoots(
heap).hole_nan_value());
1512 const int kLeastHiddenOddballNumber = -7;
1514 CHECK_GE(value, kLeastHiddenOddballNumber);
1517 ReadOnlyRoots roots(
heap);
1518 if (
map() == roots.undefined_map()) {
1519 CHECK(
this == roots.undefined_value());
1520 }
else if (
map() == roots.null_map()) {
1521 CHECK(
this == roots.null_value());
1522 }
else if (
map() == roots.boolean_map()) {
1523 CHECK(
this == roots.true_value() ||
this == roots.false_value());
1529void Hole::HoleVerify(Isolate* isolate) {
1530 ReadOnlyRoots roots(isolate->heap());
1533#define COMPARE_ROOTS_VALUE(_, Value, __) \
1534 if (*this == roots.Value()) { \
1538#undef COMPARE_ROOTS_VALUE
1543void PropertyCell::PropertyCellVerify(Isolate* isolate) {
1544 TorqueGeneratedClassVerifiers::PropertyCellVerify(*
this, isolate);
1549void ContextSidePropertyCell::ContextSidePropertyCellVerify(Isolate* isolate) {
1550 TorqueGeneratedClassVerifiers::ContextSidePropertyCellVerify(*
this, isolate);
1553void TrustedObject::TrustedObjectVerify(Isolate* isolate) {
1554#if defined(V8_ENABLE_SANDBOX)
1561void TrustedObjectLayout::TrustedObjectVerify(Isolate* isolate) {
1565void ExposedTrustedObject::ExposedTrustedObjectVerify(Isolate* isolate) {
1566 TrustedObjectVerify(isolate);
1567#if defined(V8_ENABLE_SANDBOX)
1574 IndirectPointerSlot slot =
1580 if (tag == kCodeIndirectPointerTag) {
1581 CodePointerTable::Space* space =
1582 IsolateForSandbox(isolate).GetCodePointerTableSpaceFor(slot.address());
1585 bool is_space_read_only =
1586 space == isolate->read_only_heap()->code_pointer_space();
1594void Code::CodeVerify(Isolate* isolate) {
1595 ExposedTrustedObjectVerify(isolate);
1596 CHECK(IsCode(*
this));
1602 CHECK_LE(handler_table_offset(), constant_pool_offset());
1603 CHECK_LE(constant_pool_offset(), code_comments_offset());
1604 CHECK_LE(code_comments_offset(), unwinding_info_offset());
1605 CHECK_LE(unwinding_info_offset(), metadata_size());
1609#if defined(V8_COMPRESS_POINTERS) && defined(V8_SHORT_BUILTIN_CALLS)
1610 if (istream->instruction_start() == instruction_start()) {
1622 isolate->heap()->FindCodeForInnerPointer(instruction_start());
1626 CHECK_EQ(istream->instruction_start(), instruction_start());
1634void CodeWrapper::CodeWrapperVerify(Isolate* isolate) {
1635 if (!this->has_code())
return;
1636 auto code = this->
code(isolate);
1637 Object::VerifyPointer(isolate, code);
1641void InstructionStream::InstructionStreamVerify(Isolate* isolate) {
1642 TrustedObjectVerify(isolate);
1648#if (!defined(_MSC_VER) || defined(__clang__)) && !defined(V8_OS_ZOS)
1656 CHECK_EQ(*
this, code->instruction_stream());
1663 for (RelocIterator it(code); !it.done(); it.next()) {
1664 it.rinfo()->Verify(isolate);
1667 CHECK(it.rinfo()->pc() != last_gc_pc);
1668 last_gc_pc = it.rinfo()->pc();
1673void JSArray::JSArrayVerify(Isolate* isolate) {
1674 TorqueGeneratedClassVerifiers::JSArrayVerify(*
this, isolate);
1677 if (!ElementsAreSafeToExamine(isolate))
return;
1678 if (IsUndefined(elements(), isolate))
return;
1679 CHECK(IsFixedArray(elements()) || IsFixedDoubleArray(elements()));
1680 if (elements()->
length() == 0) {
1681 CHECK_EQ(elements(), ReadOnlyRoots(isolate).empty_fixed_array());
1684 if (
IsSmi(
length()) && (HasFastElements() || HasAnyNonextensibleElements())) {
1685 if (elements()->
length() > 0) {
1686 CHECK_IMPLIES(HasDoubleElements(), IsFixedDoubleArray(elements()));
1687 CHECK_IMPLIES(HasSmiOrObjectElements() || HasAnyNonextensibleElements(),
1688 IsFixedArray(elements()));
1694 elements() == ReadOnlyRoots(isolate).empty_fixed_array());
1696 CHECK(HasDictionaryElements());
1697 uint32_t array_length;
1699 if (array_length == 0xFFFFFFFF) {
1702 if (array_length != 0) {
1707 uint32_t nof_elements =
static_cast<uint32_t
>(dict->NumberOfElements());
1708 if (nof_elements != 0) nof_elements--;
1709 CHECK_LE(nof_elements, array_length);
1714void JSSet::JSSetVerify(Isolate* isolate) {
1715 TorqueGeneratedClassVerifiers::JSSetVerify(*
this, isolate);
1716 CHECK(IsOrderedHashSet(table()) || IsUndefined(table(), isolate));
1720void JSMap::JSMapVerify(Isolate* isolate) {
1721 TorqueGeneratedClassVerifiers::JSMapVerify(*
this, isolate);
1722 CHECK(IsOrderedHashMap(table()) || IsUndefined(table(), isolate));
1726void JSSetIterator::JSSetIteratorVerify(Isolate* isolate) {
1727 CHECK(IsJSSetIterator(*
this));
1728 JSCollectionIteratorVerify(isolate);
1729 CHECK(IsOrderedHashSet(table()));
1733void JSMapIterator::JSMapIteratorVerify(Isolate* isolate) {
1734 CHECK(IsJSMapIterator(*
this));
1735 JSCollectionIteratorVerify(isolate);
1736 CHECK(IsOrderedHashMap(table()));
1740USE_TORQUE_VERIFIER(JSShadowRealm)
1761void JSSharedStruct::JSSharedStructVerify(Isolate* isolate) {
1762 CHECK(IsJSSharedStruct(*
this));
1764 JSObjectVerify(isolate);
1765 CHECK(HasFastProperties());
1768 Tagged<Map> struct_map =
map();
1771 struct_map->instance_descriptors(isolate);
1772 for (InternalIndex
i : struct_map->IterateOwnDescriptors()) {
1773 PropertyDetails details = descriptors->GetDetails(
i);
1782 CHECK(IsNumberDictionary(descriptors->GetStrongValue(
i)));
1785 CHECK(details.representation().IsTagged());
1786 CHECK(!IsNumberDictionary(descriptors->GetStrongValue(
i)));
1789 VerifyElementIsShared(RawFastPropertyAt(field_index));
1794void JSAtomicsMutex::JSAtomicsMutexVerify(Isolate* isolate) {
1795 CHECK(IsJSAtomicsMutex(*
this));
1797 JSObjectVerify(isolate);
1800void JSAtomicsCondition::JSAtomicsConditionVerify(Isolate* isolate) {
1801 CHECK(IsJSAtomicsCondition(*
this));
1803 JSObjectVerify(isolate);
1806void JSDisposableStackBase::JSDisposableStackBaseVerify(Isolate* isolate) {
1807 CHECK(IsJSDisposableStackBase(*
this));
1808 JSObjectVerify(isolate);
1813void JSSyncDisposableStack::JSSyncDisposableStackVerify(Isolate* isolate) {
1814 CHECK(IsJSSyncDisposableStack(*
this));
1815 JSDisposableStackBase::JSDisposableStackBaseVerify(isolate);
1818void JSAsyncDisposableStack::JSAsyncDisposableStackVerify(Isolate* isolate) {
1819 CHECK(IsJSAsyncDisposableStack(*
this));
1820 JSDisposableStackBase::JSDisposableStackBaseVerify(isolate);
1823void JSSharedArray::JSSharedArrayVerify(Isolate* isolate) {
1824 CHECK(IsJSSharedArray(*
this));
1825 JSObjectVerify(isolate);
1826 CHECK(HasFastProperties());
1830 uint32_t length = storage->length();
1831 for (uint32_t j = 0; j <
length; j++) {
1833 VerifyElementIsShared(element_value);
1837void JSIteratorMapHelper::JSIteratorMapHelperVerify(Isolate* isolate) {
1838 TorqueGeneratedClassVerifiers::JSIteratorMapHelperVerify(*
this, isolate);
1839 CHECK(IsCallable(mapper()));
1843void JSIteratorFilterHelper::JSIteratorFilterHelperVerify(Isolate* isolate) {
1844 TorqueGeneratedClassVerifiers::JSIteratorFilterHelperVerify(*
this, isolate);
1845 CHECK(IsCallable(predicate()));
1849void JSIteratorTakeHelper::JSIteratorTakeHelperVerify(Isolate* isolate) {
1850 TorqueGeneratedClassVerifiers::JSIteratorTakeHelperVerify(*
this, isolate);
1854void JSIteratorDropHelper::JSIteratorDropHelperVerify(Isolate* isolate) {
1855 TorqueGeneratedClassVerifiers::JSIteratorDropHelperVerify(*
this, isolate);
1859void JSIteratorFlatMapHelper::JSIteratorFlatMapHelperVerify(Isolate* isolate) {
1860 TorqueGeneratedClassVerifiers::JSIteratorFlatMapHelperVerify(*
this, isolate);
1861 CHECK(IsCallable(mapper()));
1865void WeakCell::WeakCellVerify(Isolate* isolate) {
1866 CHECK(IsWeakCell(*
this));
1870 CHECK(IsWeakCell(prev()) || IsUndefined(prev(), isolate));
1871 if (IsWeakCell(prev())) {
1875 CHECK(IsWeakCell(next()) || IsUndefined(next(), isolate));
1876 if (IsWeakCell(next())) {
1881 IsUndefined(key_list_prev(), isolate));
1883 IsUndefined(key_list_next(), isolate));
1885 CHECK(IsWeakCell(key_list_prev()) || IsUndefined(key_list_prev(), isolate));
1887 CHECK(IsWeakCell(key_list_next()) || IsUndefined(key_list_next(), isolate));
1889 CHECK(IsUndefined(finalization_registry(), isolate) ||
1890 IsJSFinalizationRegistry(finalization_registry()));
1893void JSWeakRef::JSWeakRefVerify(Isolate* isolate) {
1894 CHECK(IsJSWeakRef(*
this));
1895 JSObjectVerify(isolate);
1899void JSFinalizationRegistry::JSFinalizationRegistryVerify(Isolate* isolate) {
1900 TorqueGeneratedClassVerifiers::JSFinalizationRegistryVerify(*
this, isolate);
1901 if (IsWeakCell(active_cells())) {
1904 if (IsWeakCell(cleared_cells())) {
1909void JSWeakMap::JSWeakMapVerify(Isolate* isolate) {
1910 TorqueGeneratedClassVerifiers::JSWeakMapVerify(*
this, isolate);
1911 CHECK(IsEphemeronHashTable(table()) || IsUndefined(table(), isolate));
1914void JSArrayIterator::JSArrayIteratorVerify(Isolate* isolate) {
1915 TorqueGeneratedClassVerifiers::JSArrayIteratorVerify(*
this, isolate);
1920 if (IsJSTypedArray(iterated_object())) {
1924 }
else if (IsJSArray(iterated_object())) {
1930void JSStringIterator::JSStringIteratorVerify(Isolate* isolate) {
1931 TorqueGeneratedClassVerifiers::JSStringIteratorVerify(*
this, isolate);
1936void JSWeakSet::JSWeakSetVerify(Isolate* isolate) {
1937 TorqueGeneratedClassVerifiers::JSWeakSetVerify(*
this, isolate);
1938 CHECK(IsEphemeronHashTable(table()) || IsUndefined(table(), isolate));
1941void CallableTask::CallableTaskVerify(Isolate* isolate) {
1942 TorqueGeneratedClassVerifiers::CallableTaskVerify(*
this, isolate);
1943 CHECK(IsCallable(callable()));
1946void JSPromise::JSPromiseVerify(Isolate* isolate) {
1947 TorqueGeneratedClassVerifiers::JSPromiseVerify(*
this, isolate);
1953template <
typename Derived>
1954void SmallOrderedHashTable<Derived>::SmallOrderedHashTableVerify(
1956 CHECK(IsSmallOrderedHashTable(*
this));
1958 int capacity = Capacity();
1962 for (
int entry = 0; entry < NumberOfBuckets(); entry++) {
1963 int bucket = GetFirstEntry(entry);
1969 for (
int entry = 0; entry < NumberOfElements(); entry++) {
1970 int chain = GetNextEntry(entry);
1976 for (
int entry = 0; entry < NumberOfElements(); entry++) {
1979 Object::VerifyPointer(isolate, val);
1983 for (
int entry = NumberOfElements() + NumberOfDeletedElements();
1984 entry < Capacity(); entry++) {
1987 CHECK(IsTheHole(val, isolate));
1992void SmallOrderedHashMap::SmallOrderedHashMapVerify(Isolate* isolate) {
1993 CHECK(IsSmallOrderedHashMap(*
this));
1994 SmallOrderedHashTable<SmallOrderedHashMap>::SmallOrderedHashTableVerify(
2000 CHECK(IsTheHole(val, isolate));
2005void SmallOrderedHashSet::SmallOrderedHashSetVerify(Isolate* isolate) {
2006 CHECK(IsSmallOrderedHashSet(*
this));
2007 SmallOrderedHashTable<SmallOrderedHashSet>::SmallOrderedHashTableVerify(
2013 CHECK(IsTheHole(val, isolate));
2018void SmallOrderedNameDictionary::SmallOrderedNameDictionaryVerify(
2020 CHECK(IsSmallOrderedNameDictionary(*
this));
2021 SmallOrderedHashTable<
2022 SmallOrderedNameDictionary>::SmallOrderedHashTableVerify(isolate);
2027 CHECK(IsTheHole(val, isolate) ||
2033void SwissNameDictionary::SwissNameDictionaryVerify(Isolate* isolate) {
2034 this->SwissNameDictionaryVerify(isolate,
false);
2037void SwissNameDictionary::SwissNameDictionaryVerify(Isolate* isolate,
2043 meta_table()->ByteArrayVerify(isolate);
2045 int seen_deleted = 0;
2046 int seen_present = 0;
2051 if (
IsFull(ctrl) || slow_checks) {
2064 CHECK(!IsTheHole(value));
2065 name->NameVerify(isolate);
2066 Object::ObjectVerify(value, isolate);
2070 CHECK(IsTheHole(value));
2073 CHECK(IsTheHole(value));
2097 for (
int enum_index = 0; enum_index <
UsedCapacity(); ++enum_index) {
2108void JSRegExp::JSRegExpVerify(Isolate* isolate) {
2111 CHECK(IsString(source) || IsUndefined(source));
2113 if (!has_data())
return;
2116 switch (data->type_tag()) {
2128void RegExpData::RegExpDataVerify(Isolate* isolate) {
2129 ExposedTrustedObjectVerify(isolate);
2135void AtomRegExpData::AtomRegExpDataVerify(Isolate* isolate) {
2136 ExposedTrustedObjectVerify(isolate);
2137 RegExpDataVerify(isolate);
2141void IrRegExpData::IrRegExpDataVerify(Isolate* isolate) {
2142 ExposedTrustedObjectVerify(isolate);
2143 RegExpDataVerify(isolate);
2145 VerifyProtectedPointerField(isolate, kLatin1BytecodeOffset);
2146 VerifyProtectedPointerField(isolate, kUc16BytecodeOffset);
2168 if (has_latin1_code()) {
2169 CHECK_EQ(latin1_code(isolate)->builtin_id(),
2170 Builtin::kRegExpExperimentalTrampoline);
2171 CHECK_EQ(latin1_code(isolate), uc16_code(isolate));
2175 CHECK(!has_uc16_code());
2176 CHECK(!has_latin1_bytecode());
2177 CHECK(!has_uc16_bytecode());
2212void RegExpDataWrapper::RegExpDataWrapperVerify(Isolate* isolate) {
2213 if (!this->has_data())
return;
2214 auto data = this->
data(isolate);
2215 Object::VerifyPointer(isolate, data);
2219void JSProxy::JSProxyVerify(Isolate* isolate) {
2220 TorqueGeneratedClassVerifiers::JSProxyVerify(*
this, isolate);
2221 CHECK(IsJSFunction(
map()->GetConstructor()));
2231void JSArrayBuffer::JSArrayBufferVerify(Isolate* isolate) {
2232 TorqueGeneratedClassVerifiers::JSArrayBufferVerify(*
this, isolate);
2233 if (
FIELD_SIZE(kOptionalPaddingOffset) != 0) {
2236 *
reinterpret_cast<uint32_t*
>(address() + kOptionalPaddingOffset));
2240void JSArrayBufferView::JSArrayBufferViewVerify(Isolate* isolate) {
2241 TorqueGeneratedClassVerifiers::JSArrayBufferViewVerify(*
this, isolate);
2246void JSTypedArray::JSTypedArrayVerify(Isolate* isolate) {
2247 TorqueGeneratedClassVerifiers::JSTypedArrayVerify(*
this, isolate);
2251void JSDataView::JSDataViewVerify(Isolate* isolate) {
2252 TorqueGeneratedClassVerifiers::JSDataViewVerify(*
this, isolate);
2253 CHECK(!IsVariableLength());
2254 if (!WasDetached()) {
2255 CHECK_EQ(
reinterpret_cast<uint8_t*
>(
2262void JSRabGsabDataView::JSRabGsabDataViewVerify(Isolate* isolate) {
2263 TorqueGeneratedClassVerifiers::JSRabGsabDataViewVerify(*
this, isolate);
2264 CHECK(IsVariableLength());
2265 if (!WasDetached()) {
2266 CHECK_EQ(
reinterpret_cast<uint8_t*
>(
2273void AsyncGeneratorRequest::AsyncGeneratorRequestVerify(Isolate* isolate) {
2274 TorqueGeneratedClassVerifiers::AsyncGeneratorRequestVerify(*
this, isolate);
2279void BigIntBase::BigIntBaseVerify(Isolate* isolate) {
2284void SourceTextModuleInfoEntry::SourceTextModuleInfoEntryVerify(
2286 TorqueGeneratedClassVerifiers::SourceTextModuleInfoEntryVerify(*
this,
2288 CHECK_IMPLIES(IsString(import_name()), module_request() >= 0);
2289 CHECK_IMPLIES(IsString(export_name()) && IsString(import_name()),
2290 IsUndefined(local_name(), isolate));
2293void Module::ModuleVerify(Isolate* isolate) {
2294 TorqueGeneratedClassVerifiers::ModuleVerify(*
this, isolate);
2298 CHECK(IsUndefined(module_namespace(), isolate) ||
2299 IsJSModuleNamespace(module_namespace()));
2300 if (IsJSModuleNamespace(module_namespace())) {
2307 CHECK(IsUndefined(top_level_capability()));
2313void ModuleRequest::ModuleRequestVerify(Isolate* isolate) {
2314 TorqueGeneratedClassVerifiers::ModuleRequestVerify(*
this, isolate);
2318 for (
int i = 0;
i < import_attributes()->
length();
2320 CHECK(IsString(import_attributes()->get(
i)));
2321 CHECK(IsString(import_attributes()->get(
i + 1)));
2326void SourceTextModule::SourceTextModuleVerify(Isolate* isolate) {
2327 TorqueGeneratedClassVerifiers::SourceTextModuleVerify(*
this, isolate);
2329 if (
status() == kErrored) {
2331 }
else if (
status() == kEvaluating ||
status() == kEvaluatingAsync ||
2332 status() == kEvaluated) {
2335 if (
status() == kLinked) {
2337 }
else if (
status() == kLinking) {
2339 }
else if (
status() == kPreLinking) {
2341 }
else if (
status() == kUnlinked) {
2345 CHECK(!pending_async_dependencies());
2352void SyntheticModule::SyntheticModuleVerify(Isolate* isolate) {
2353 TorqueGeneratedClassVerifiers::SyntheticModuleVerify(*
this, isolate);
2355 for (
int i = 0;
i < export_names()->
length();
i++) {
2356 CHECK(IsString(export_names()->get(
i)));
2360void PrototypeInfo::PrototypeInfoVerify(Isolate* isolate) {
2361 TorqueGeneratedClassVerifiers::PrototypeInfoVerify(*
this, isolate);
2362 if (IsWeakArrayList(prototype_users())) {
2368 if (!IsUndefined(derived)) {
2370 CHECK_GT(derived_list->length(), 0);
2371 for (
int i = 0;
i < derived_list->
length(); ++
i) {
2372 derived_list->Get(
i).IsWeakOrCleared();
2378 if (array->length() == 0) {
2384 int empty_slots_count = 0;
2387 CHECK_LT(empty_slot, array->length());
2388 empty_slot = array->Get(empty_slot).ToSmi().value();
2389 ++empty_slots_count;
2394 int weak_maps_count = 0;
2398 if ((
object.GetHeapObjectIfWeak(&heap_object) && IsMap(heap_object)) ||
2399 object.IsCleared()) {
2406 CHECK_EQ(weak_maps_count + empty_slots_count + 1, array->length());
2409void EnumCache::EnumCacheVerify(Isolate* isolate) {
2410 TorqueGeneratedClassVerifiers::EnumCacheVerify(*
this, isolate);
2411 Heap*
heap = isolate->heap();
2412 if (*
this == ReadOnlyRoots(
heap).empty_enum_cache()) {
2413 CHECK_EQ(ReadOnlyRoots(
heap).empty_fixed_array(), keys());
2414 CHECK_EQ(ReadOnlyRoots(
heap).empty_fixed_array(), indices());
2418void ObjectBoilerplateDescription::ObjectBoilerplateDescriptionVerify(
2429void ClassBoilerplate::ClassBoilerplateVerify(Isolate* isolate) {
2431 Object::VerifyPointer(isolate, static_properties_template());
2433 Object::VerifyPointer(isolate, static_computed_properties());
2434 CHECK(IsFixedArray(static_computed_properties()));
2436 Object::VerifyPointer(isolate, instance_elements_template());
2441void RegExpBoilerplateDescription::RegExpBoilerplateDescriptionVerify(
2444 auto o =
data(isolate);
2445 Object::VerifyPointer(isolate, o);
2446 CHECK(IsRegExpData(o));
2450 Object::VerifyPointer(isolate, o);
2456#if V8_ENABLE_WEBASSEMBLY
2458void WasmTrustedInstanceData::WasmTrustedInstanceDataVerify(Isolate* isolate) {
2461 VerifyObjectField(isolate,
offset);
2466 VerifyProtectedPointerField(isolate,
offset);
2469 int num_dispatch_tables = dispatch_tables()->length();
2470 for (
int i = 0;
i < num_dispatch_tables; ++
i) {
2473 CHECK(IsWasmDispatchTable(table));
2479void WasmDispatchTable::WasmDispatchTableVerify(Isolate* isolate) {
2480 TrustedObjectVerify(isolate);
2484 for (
int i = 0;
i < len; ++
i) {
2486 Object::VerifyPointer(isolate, arg);
2487 CHECK(IsWasmTrustedInstanceData(arg) || IsWasmImportData(arg) ||
2498 if (uses->length() > 0) {
2500 int capacity = uses->length();
2501 CHECK(capacity & 1);
2502 int used_length =
Cast<Smi>(uses->get(0)).value();
2504 for (
int i = 1;
i < used_length;
i += 2) {
2505 CHECK(uses->get(
i).IsCleared() ||
2506 IsWasmTrustedInstanceData(uses->get(
i).GetHeapObjectAssumeWeak()));
2512void WasmTableObject::WasmTableObjectVerify(Isolate* isolate) {
2513 TorqueGeneratedClassVerifiers::WasmTableObjectVerify(*
this, isolate);
2514 if (has_trusted_dispatch_table() &&
2515 !has_trusted_dispatch_table_unpublished(isolate)) {
2520void WasmValueObject::WasmValueObjectVerify(Isolate* isolate) {
2521 JSObjectVerify(isolate);
2522 CHECK(IsWasmValueObject(*
this));
2525void WasmExceptionPackage::WasmExceptionPackageVerify(Isolate* isolate) {
2526 JSObjectVerify(isolate);
2527 CHECK(IsWasmExceptionPackage(*
this));
2530void WasmExportedFunctionData::WasmExportedFunctionDataVerify(
2532 TorqueGeneratedClassVerifiers::WasmExportedFunctionDataVerify(*
this, isolate);
2535 wrapper->kind() == CodeKind::JS_TO_WASM_FUNCTION ||
2536 wrapper->kind() == CodeKind::C_WASM_ENTRY ||
2537 (wrapper->is_builtin() &&
2538 (wrapper->builtin_id() == Builtin::kJSToWasmWrapper ||
2539#
if V8_ENABLE_DRUMBRAKE
2540 wrapper->builtin_id() == Builtin::kGenericJSToWasmInterpreterWrapper ||
2542 wrapper->builtin_id() == Builtin::kWasmPromising ||
2543 wrapper->builtin_id() == Builtin::kWasmStressSwitch)));
2548void StructLayout::StructVerify(Isolate* isolate) {
2552void Tuple2::Tuple2Verify(Isolate* isolate) {
2553 StructVerify(isolate);
2554 CHECK(IsTuple2(
this));
2555 Object::VerifyPointer(isolate,
value1_.load());
2556 Object::VerifyPointer(isolate,
value2_.load());
2559void AccessorPair::AccessorPairVerify(Isolate* isolate) {
2560 StructVerify(isolate);
2561 CHECK(IsAccessorPair(
this));
2562 Object::VerifyPointer(isolate,
getter_.load());
2563 Object::VerifyPointer(isolate,
setter_.load());
2566void ClassPositions::ClassPositionsVerify(Isolate* isolate) {
2567 StructVerify(isolate);
2568 CHECK(IsClassPositions(
this));
2573void DataHandler::DataHandlerVerify(Isolate* isolate) {
2574 StructVerify(isolate);
2575 CHECK(IsDataHandler(
this));
2582 Object::VerifyMaybeObjectPointer(isolate,
data()[
i].load());
2586void LoadHandler::LoadHandlerVerify(Isolate* isolate) {
2587 DataHandler::DataHandlerVerify(isolate);
2591void StoreHandler::StoreHandlerVerify(Isolate* isolate) {
2592 DataHandler::DataHandlerVerify(isolate);
2596void AllocationSite::AllocationSiteVerify(Isolate* isolate) {
2597 CHECK(IsAllocationSite(
this));
2607void AllocationMemento::AllocationMementoVerify(Isolate* isolate) {
2608 StructVerify(isolate);
2609 CHECK(IsAllocationMemento(
this));
2613void Script::ScriptVerify(Isolate* isolate) {
2614 TorqueGeneratedClassVerifiers::ScriptVerify(*
this, isolate);
2615#if V8_ENABLE_WEBASSEMBLY
2616 if (
type() == Script::Type::kWasm) {
2617 CHECK_EQ(line_ends(), ReadOnlyRoots(isolate).empty_fixed_array());
2624 for (
int i = 0;
i < infos()->
length(); ++
i) {
2627 CHECK(!maybe_object.GetHeapObjectIfWeak(isolate, &heap_object) ||
2628 (maybe_object.GetHeapObjectIfStrong(&heap_object) &&
2629 IsUndefined(heap_object, isolate)) ||
2634void NormalizedMapCache::NormalizedMapCacheVerify(Isolate* isolate) {
2636 if (
v8_flags.enable_slow_asserts) {
2640 if (e.GetHeapObjectIfWeak(&heap_object)) {
2641 Cast<Map>(heap_object)->DictionaryMapVerify(isolate);
2643 CHECK(e.IsCleared() || (e.GetHeapObjectIfStrong(&heap_object) &&
2644 IsUndefined(heap_object, isolate)));
2650void PreparseData::PreparseDataVerify(Isolate* isolate) {
2651 TorqueGeneratedClassVerifiers::PreparseDataVerify(*
this, isolate);
2655 for (
int i = 0;
i < children_length(); ++
i) {
2658 Object::VerifyPointer(isolate, child);
2662void CallSiteInfo::CallSiteInfoVerify(Isolate* isolate) {
2663 TorqueGeneratedClassVerifiers::CallSiteInfoVerify(*
this, isolate);
2664#if V8_ENABLE_WEBASSEMBLY
2666 CHECK_IMPLIES(IsWasm(), IsWasmInstanceObject(receiver_or_instance()));
2668 CHECK_IMPLIES(!IsWasm() && !IsBuiltin(), IsJSFunction(function()));
2674void FunctionTemplateRareData::FunctionTemplateRareDataVerify(
2676 CHECK(IsFixedArray(c_function_overloads()) ||
2677 IsUndefined(c_function_overloads(), isolate));
2680void StackFrameInfo::StackFrameInfoVerify(Isolate* isolate) {
2681 TorqueGeneratedClassVerifiers::StackFrameInfoVerify(*
this, isolate);
2684void StackTraceInfo::StackTraceInfoVerify(Isolate* isolate) {
2685 TorqueGeneratedClassVerifiers::StackTraceInfoVerify(*
this, isolate);
2688void ErrorStackData::ErrorStackDataVerify(Isolate* isolate) {
2689 TorqueGeneratedClassVerifiers::ErrorStackDataVerify(*
this, isolate);
2692void SloppyArgumentsElements::SloppyArgumentsElementsVerify(Isolate* isolate) {
2696 Object::VerifyPointer(isolate, o);
2697 CHECK(IsContext(o));
2701 Object::VerifyPointer(isolate, o);
2702 CHECK(IsFixedArray(o));
2711class StringTableVerifier :
public RootVisitor {
2713 explicit StringTableVerifier(Isolate* isolate) :
isolate_(isolate) {}
2715 void VisitRootPointers(Root root,
const char* description,
2716 FullObjectSlot
start, FullObjectSlot
end)
override {
2719 void VisitRootPointers(Root root,
const char* description,
2720 OffHeapObjectSlot
start,
2721 OffHeapObjectSlot
end)
override {
2723 for (OffHeapObjectSlot p =
start; p <
end; ++p) {
2724 Tagged<Object> o = p.load(
isolate_);
2725 CHECK(!HasWeakHeapObjectTag(o));
2727 Tagged<HeapObject>
object = Cast<HeapObject>(o);
2739 CHECK_EQ(isolate->string_table(),
this);
2740 if (!isolate->OwnsStringTables())
return;
2741 StringTableVerifier verifier(isolate);
2749void JSObject::IncrementSpillStatistics(Isolate* isolate,
2750 SpillInformation* info) {
2751 info->number_of_objects_++;
2753 if (HasFastProperties()) {
2754 info->number_of_objects_with_fast_properties_++;
2755 info->number_of_fast_used_fields_ +=
map()->NextFreePropertyIndex();
2756 info->number_of_fast_unused_fields_ +=
map()->UnusedPropertyFields();
2757 }
else if (IsJSGlobalObject(*
this)) {
2760 info->number_of_slow_used_properties_ += dict->NumberOfElements();
2761 info->number_of_slow_unused_properties_ +=
2762 dict->Capacity() - dict->NumberOfElements();
2765 info->number_of_slow_used_properties_ += dict->NumberOfElements();
2766 info->number_of_slow_unused_properties_ +=
2767 dict->Capacity() - dict->NumberOfElements();
2770 info->number_of_slow_used_properties_ += dict->NumberOfElements();
2771 info->number_of_slow_unused_properties_ +=
2772 dict->Capacity() - dict->NumberOfElements();
2775 switch (GetElementsKind()) {
2790 info->number_of_objects_with_fast_elements_++;
2793 int len = e->length();
2794 for (
int i = 0;
i < len;
i++) {
2795 if (IsTheHole(e->get(
i), isolate)) holes++;
2797 info->number_of_fast_used_elements_ += len - holes;
2798 info->number_of_fast_unused_elements_ += holes;
2802#define TYPED_ARRAY_CASE(Type, type, TYPE, ctype) case TYPE##_ELEMENTS:
2806#undef TYPED_ARRAY_CASE
2808 info->number_of_objects_with_fast_elements_++;
2810 info->number_of_fast_used_elements_ += e->length();
2816 info->number_of_slow_used_elements_ += dict->NumberOfElements();
2817 info->number_of_slow_unused_elements_ +=
2818 dict->Capacity() - dict->NumberOfElements();
2829void JSObject::SpillInformation::Clear() {
2830 number_of_objects_ = 0;
2831 number_of_objects_with_fast_properties_ = 0;
2832 number_of_objects_with_fast_elements_ = 0;
2833 number_of_fast_used_fields_ = 0;
2834 number_of_fast_unused_fields_ = 0;
2835 number_of_slow_used_properties_ = 0;
2836 number_of_slow_unused_properties_ = 0;
2837 number_of_fast_used_elements_ = 0;
2838 number_of_fast_unused_elements_ = 0;
2839 number_of_slow_used_elements_ = 0;
2840 number_of_slow_unused_elements_ = 0;
2843void JSObject::SpillInformation::Print() {
2844 PrintF(
"\n JSObject Spill Statistics (#%d):\n", number_of_objects_);
2846 PrintF(
" - fast properties (#%d): %d (used) %d (unused)\n",
2847 number_of_objects_with_fast_properties_, number_of_fast_used_fields_,
2848 number_of_fast_unused_fields_);
2850 PrintF(
" - slow properties (#%d): %d (used) %d (unused)\n",
2851 number_of_objects_ - number_of_objects_with_fast_properties_,
2852 number_of_slow_used_properties_, number_of_slow_unused_properties_);
2854 PrintF(
" - fast elements (#%d): %d (used) %d (unused)\n",
2855 number_of_objects_with_fast_elements_, number_of_fast_used_elements_,
2856 number_of_fast_unused_elements_);
2858 PrintF(
" - slow elements (#%d): %d (used) %d (unused)\n",
2859 number_of_objects_ - number_of_objects_with_fast_elements_,
2860 number_of_slow_used_elements_, number_of_slow_unused_elements_);
2865bool DescriptorArray::IsSortedNoDuplicates() {
2867 uint32_t current = 0;
2871 const bool has_hash =
key->TryGetHash(&hash);
2873 if (
key == current_key) {
2878 if (hash < current) {
2887bool TransitionArray::IsSortedNoDuplicates() {
2891 uint32_t prev_hash = 0;
2896 const bool has_hash =
key->TryGetHash(&hash);
2902 PropertyDetails details =
2904 kind = details.kind();
2905 attributes = details.attributes();
2911 int cmp =
CompareKeys(prev_key, prev_hash, prev_kind, prev_attributes,
key,
2912 hash,
kind, attributes);
2919 prev_attributes = attributes;
2925bool TransitionsAccessor::IsSortedNoDuplicates() {
2931static bool CheckOneBackPointer(Tagged<Map> current_map, Tagged<Map> target) {
2932 return target->GetBackPointer() == current_map;
2935bool TransitionsAccessor::IsConsistentWithBackPointers() {
2937 bool success =
true;
2942 [&](Tagged<Map>
target) {
2944 if (!
map_->is_deprecated() && !target->is_deprecated()) {
2946 target->IsInobjectSlackTrackingInProgress());
2949 IsUndefined(
map_->GetBackPointer()));
2953 if (!CheckOneBackPointer(
map_, target)) {
2958 &no_gc, [&](Tagged<Map> target) { CheckTarget(target); },
2959 [&](Tagged<Map> proto_target) {
2960 if (
v8_flags.move_prototype_transitions_first) {
2961 CheckTarget(proto_target);
2965 if (!side_step.IsSmi()) {
2969 Cast<Map>(side_step)->GetInObjectProperties() -
2970 Cast<Map>(side_step)->UnusedInObjectProperties(),
2971 map_->GetInObjectProperties() -
map_->UnusedInObjectProperties());
2977#undef USE_TORQUE_VERIFIER
#define TYPED_ARRAY_CASE(Type, type, TYPE, ctype)
#define BUILTIN_LIST_BASE_TIERING(TFC)
interpreter::Bytecode bytecode
union v8::internal::@341::BuiltinMetadata::KindSpecificData data
#define SLOW_DCHECK(condition)
TaggedMember< Object > setter_
TaggedMember< Object > getter_
TaggedMember< AllocationSite > allocation_site_
TaggedMember< UnionOf< Smi, JSObject > > transition_info_or_boilerplate_
bool PointsToLiteral() const
Tagged< UnionOf< Smi, AllocationSite > > nested_site() const
Tagged< DependentCode > dependent_code() const
static bool CheckFormalParameterCount(Builtin builtin, int function_length, int formal_parameter_count_with_receiver)
static const int kMaxLength
bool IsConstructor() const
TaggedMember< Smi > start_
int safepoint_table_offset() const
bool has_instruction_stream() const
static const uint32_t kMinLength
V8_INLINE bool IsFlat() const
Tagged< String > first() const
Tagged< String > second() const
bool has_extension() const
static V8_INLINE constexpr int OffsetOfElementAt(int index)
bool IsScriptContext() const
@ CONTEXT_SIDE_TABLE_PROPERTY_INDEX
Tagged< HeapObject > extension() const
V8_INLINE Tagged< Object > get(int index) const
static int FunctionMapIndex(LanguageMode language_mode, FunctionKind kind, bool has_shared_name)
Tagged< UnionOf< Smi, Cell > > validity_cell() const
int data_field_count() const
Tagged< UnionOf< Smi, Code > > smi_handler() const
PropertyDetails GetDetails(InternalIndex descriptor_number)
static const int kEntryKeyIndex
ObjectSlot GetDescriptorSlot(int descriptor)
Tagged< MaybeObject > GetValue(InternalIndex descriptor_number)
Tagged< Name > GetSortedKey(int descriptor_number)
static ElementsAccessor * ForKind(ElementsKind elements_kind)
static FieldIndex ForDetails(Tagged< Map > map, PropertyDetails details)
static bool NowStable(Tagged< FieldType > type)
static V8_EXPORT_PRIVATE Tagged< FieldType > Any()
static V8_EXPORT_PRIVATE Tagged< FieldType > None()
static bool NowContains(Tagged< FieldType > type, Tagged< Object > value)
bool is_the_hole(Isolate *isolate, int index)
uint64_t get_representation(int index)
static V8_INLINE bool InYoungGeneration(Tagged< Object > object)
static V8_INLINE bool InWritableSharedSpace(Tagged< HeapObject > object)
static V8_INLINE bool InTrustedSpace(Tagged< HeapObject > object)
static V8_INLINE bool InReadOnlySpace(Tagged< HeapObject > object)
static V8_INLINE bool InAnySharedSpace(Tagged< HeapObject > object)
Tagged< Map > map() const
bool CheckRequiredAlignment(PtrComprCageBase cage_base) const
IndirectPointerSlot RawIndirectPointerField(int byte_offset, IndirectPointerTag tag) const
bool TryGetCode(Tagged< Code > *code_out, AcquireLoadTag tag) const
static constexpr int kMetadataAlignment
Address instruction_start() const
Tagged< TrustedByteArray > relocation_info() const
static IsolateGroup * current()
static constexpr size_t kMaxByteLength
Tagged< Context > context()
Tagged< NativeContext > native_context()
int GetEmbedderFieldsStartOffset()
int GetEmbedderFieldCount() const
static const int kFieldsAdded
Tagged< JSAny > RawFastPropertyAt(FieldIndex index) const
Tagged< FixedArrayBase > elements(PtrComprCageBase cage_base, AcquireLoadTag tag) const =delete
static V8_EXPORT_PRIVATE int GetHeaderSize(InstanceType instance_type, bool function_has_prototype_slot=false)
Tagged< Object > reactions() const
V8_EXPORT_PRIVATE Promise::PromiseState status() const
V8_INLINE bool IsRevoked() const
static constexpr int kUninitializedValue
static bool IsRegistryKeyDescriptor(Isolate *isolate, Tagged< Map > instance_map, InternalIndex i)
static bool IsElementsTemplateDescriptor(Isolate *isolate, Tagged< Map > instance_map, InternalIndex i)
V8_EXPORT_PRIVATE size_t element_size() const
static constexpr size_t kMaxByteLength
static constexpr bool IsPacked(Address)
InternalIndex::Range IterateOwnDescriptors() const
bool IsInobjectSlackTrackingInProgress() const
bool CanHaveFastTransitionableElementsKind() const
int GetInObjectPropertyOffset(int index) const
static bool IsMostGeneralFieldType(Representation representation, Tagged< FieldType > field_type)
bool OnlyHasSimpleProperties() const
bool has_shared_array_elements() const
static V8_EXPORT_PRIVATE VisitorId GetVisitorId(Tagged< Map > map)
int NumberOfOwnDescriptors() const
int UnusedPropertyFields() const
static constexpr int MaxRegularCodeObjectSize()
static const size_t kAttributeEntrySize
bool HasForwardingIndex(AcquireLoadTag) const
bool TryGetHash(uint32_t *hash) const
int boilerplate_properties_count() const
static bool CanBeHeldWeakly(Tagged< Object > obj)
static bool ToArrayLength(Tagged< Object > obj, uint32_t *index)
static double NumberValue(Tagged< Number > obj)
TaggedMember< Smi > kind_
Tagged< String > type_of() const
Tagged< String > to_string() const
Tagged< Number > to_number() const
Tagged< Object > get_child_raw(int index) const
Tagged< JSAny > get(int index) const
PropertyDetails property_details() const
static bool CheckDataIsCompatible(PropertyDetails details, Tagged< Object > value)
static constexpr PropertyDetails Empty(PropertyCellType cell_type=PropertyCellType::kNoCell)
static const int kFirstIndex
static const int kNoEmptySlotsMarker
static Tagged< Smi > empty_slot_index(Tagged< WeakArrayList > array)
static V8_EXPORT_PRIVATE bool Contains(Address address)
int capture_count() const
int number_of_capture_registers() const
Tagged< Object > last_input() const
static constexpr int kMinCapacity
Tagged< String > last_subject() const
static bool CanGenerateBytecode()
static constexpr bool IsGCRelocMode(Mode mode)
Tagged< NameToIndexHashTable > names_to_context_index() const
Tagged< Context > get(int index) const
bool CanHaveLineEnds() const
uint16_t internal_formal_parameter_count_with_receiver() const
bool IsApiFunction() const
LanguageMode language_mode() const
Tagged< BytecodeArray > GetBytecodeArray(IsolateT *isolate) const
bool HasUncompiledDataWithPreparseData() const
Tagged< ScopeInfo > EarlyScopeInfo(AcquireLoadTag tag)
FunctionKind kind() const
Tagged< HeapObject > script() const
bool construct_as_builtin() const
bool IsDontAdaptArguments() const
bool HasSharedName() const
bool HasBuiltinId() const
bool HasUncompiledDataWithoutPreparseData() const
bool HasFeedbackMetadata() const
Tagged< String > parent() const
static const uint32_t kMinLength
Tagged< Context > context() const
Tagged< UnionOf< FixedArray, NumberDictionary > > arguments() const
Tagged< UnionOf< Smi, Hole > > mapped_entries(int index, RelaxedLoadTag) const
static const int kEntrySize
static const int kEntrySize
V8_INLINE Tagged< Object > GetDataEntry(int entry, int relative_index)
int NumberOfDeletedElements() const
int NumberOfElements() const
static const int kEntrySize
static constexpr int ToInt(const Tagged< Object > object)
static constexpr Tagged< Smi > zero()
static constexpr int kMaxValue
bool HasAsyncEvaluationOrdinal() const
int AsyncParentModuleCount()
Tagged< SourceTextModuleInfo > info() const
void IterateElements(RootVisitor *visitor)
void VerifyIfOwnedBy(Isolate *isolate)
static const uint32_t kMaxLength
Tagged< Object > KeyAt(InternalIndex entry)
static constexpr bool IsValidCapacity(int capacity)
int EntryForEnumerationIndex(int enumeration_index)
Tagged< Object > ValueAtRaw(int entry)
static bool IsEmpty(ctrl_t c)
static bool IsDeleted(ctrl_t c)
int NumberOfDeletedElements()
static bool IsFull(ctrl_t c)
static const int kGroupWidth
swiss_table::ctrl_t ctrl_t
ctrl_t GetCtrl(int entry)
Tagged< PrimitiveHeapObject > description() const
static constexpr int kMaxCapacity
Tagged< ElementT > get(int index) const
static PtrType load(Tagged< HeapObject > host, int offset=0)
constexpr bool IsCleared() const
constexpr bool IsSmi() const
constexpr bool IsHeapObject() const
Tagged< String > actual() const
bool HasSideStepTransitions()
static int LengthFor(int number_of_transitions)
Tagged< Name > GetKey(int transition_number)
bool HasPrototypeTransitions()
Tagged< WeakFixedArray > GetSideStepTransitions()
static int CompareKeys(Tagged< Name > key1, uint32_t hash1, PropertyKind kind1, PropertyAttributes attributes1, Tagged< Name > key2, uint32_t hash2, PropertyKind kind2, PropertyAttributes attributes2)
Tagged< Map > GetTarget(int transition_number)
static const int kProtoTransitionHeaderSize
static int NumberOfPrototypeTransitions(Tagged< WeakFixedArray > proto_transitions)
Tagged< WeakFixedArray > GetPrototypeTransitions()
int number_of_transitions() const
void ForEachTransition(DisallowGarbageCollection *no_gc, Callback callback, ProtoCallback proto_transition_callback, SideStepCallback side_step_transition_callback)
Tagged< TransitionArray > transitions()
static bool IsSpecialTransition(ReadOnlyRoots roots, Tagged< Name > name)
bool HasSideStepTransitions()
static PropertyDetails GetTargetDetails(Tagged< Name > name, Tagged< Map > target)
TaggedMember< Object > value2_
TaggedMember< Object > value1_
Tagged< Object > implicit_arg(int index) const
static constexpr std::array< uint16_t, 6 > kProtectedFieldOffsets
static constexpr std::array< uint16_t, kTaggedFieldsCount > kTaggedFieldOffsets
#define V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL
#define V8_EXTERNAL_CODE_SPACE_BOOL
#define COMPRESS_POINTERS_BOOL
#define COMPRESS_POINTERS_IN_MULTIPLE_CAGES_BOOL
#define RAB_GSAB_TYPED_ARRAYS(V)
DirectHandle< FixedArray > capture_name_map
#define MAKE_TORQUE_CASE(Name, TYPE)
SharedFunctionInfoRef shared
ZoneStack< RpoNumber > & stack
InstructionOperand source
V8_INLINE Dest bit_cast(Source const &source)
V8_INLINE constexpr bool IsSeqString(InstanceType instance_type)
V8_INLINE constexpr bool IsThinString(InstanceType instance_type)
V8_INLINE constexpr bool IsConsString(InstanceType instance_type)
V8_INLINE constexpr bool IsExternalString(InstanceType instance_type)
V8_INLINE constexpr bool IsInternalizedString(InstanceType instance_type)
V8_INLINE constexpr bool IsNativeContextSpecific(InstanceType instance_type)
V8_INLINE constexpr bool IsFreeSpaceOrFiller(InstanceType instance_type)
V8_INLINE constexpr bool IsSlicedString(InstanceType instance_type)
V8_INLINE constexpr bool IsHeapObject(InstanceType instance_type)
Map::Bits3::NumberOfOwnDescriptorsBits Map::Bits3::ConstructionCounterBits is_access_check_needed
static swiss_table::ctrl_t H2(uint32_t hash)
constexpr WasmCodePointer kInvalidWasmCodePointer
V8_INLINE IndirectHandle< T > handle(Tagged< T > object, Isolate *isolate)
static V8_INLINE bool HasWeakHeapObjectTag(const Tagged< Object > value)
V8_WARN_UNUSED_RESULT bool IsValidCodeObject(Heap *heap, Tagged< HeapObject > object)
constexpr int kTaggedSize
kStaticElementsTemplateOffset kInstancePropertiesTemplateOffset instance_computed_properties
constexpr double kMaxSafeInteger
PerThreadAssertScopeDebugOnly< false, HEAP_ALLOCATION_ASSERT > DisallowHeapAllocation
bool IsNone(Tagged< FieldType > obj)
PerThreadAssertScopeDebugOnly< false, SAFEPOINTS_ASSERT, HEAP_ALLOCATION_ASSERT > DisallowGarbageCollection
bool IsAnyHoleyNonextensibleElementsKind(ElementsKind kind)
bool Is(IndirectHandle< U > value)
ReadOnlyRoots GetReadOnlyRoots()
void PrintF(const char *format,...)
Map::Bits1::HasPrototypeSlotBit Map::Bits1::HasNamedInterceptorBit Map::Bits1::IsUndetectableBit Map::Bits1::IsConstructorBit Map::Bits2::IsImmutablePrototypeBit Map::Bits3::IsDeprecatedBit is_prototype_map
constexpr int kEmbedderDataSlotSize
Tagged< DescriptorArray >
Tagged(T object) -> Tagged< T >
static constexpr int kFeedbackSlotKindCount
V8_INLINE constexpr bool IsSmi(TaggedImpl< kRefType, StorageType > obj)
constexpr intptr_t kCodeAlignment
constexpr uint16_t kDontAdaptArgumentsSentinel
kInterpreterTrampolineOffset Tagged< HeapObject >
kStaticElementsTemplateOffset kInstancePropertiesTemplateOffset Tagged< FixedArray >
base::StrongAlias< JSDispatchHandleAliasTag, uint32_t > JSDispatchHandle
@ HOLEY_NONEXTENSIBLE_ELEMENTS
@ SLOW_STRING_WRAPPER_ELEMENTS
@ PACKED_NONEXTENSIBLE_ELEMENTS
@ SLOW_SLOPPY_ARGUMENTS_ELEMENTS
@ FAST_SLOPPY_ARGUMENTS_ELEMENTS
@ FAST_STRING_WRAPPER_ELEMENTS
too high values may cause the compiler to set high thresholds for inlining to as much as possible avoid inlined allocation of objects that cannot escape trace load stores from virtual maglev objects use TurboFan fast string builder analyze liveness of environment slots and zap dead values trace TurboFan load elimination emit data about basic block usage in builtins to this enable builtin reordering when run mksnapshot flag for emit warnings when applying builtin profile data verify register allocation in TurboFan randomly schedule instructions to stress dependency tracking enable store store elimination in TurboFan rewrite far to near simulate GC compiler thread race related to allow float parameters to be passed in simulator mode JS Wasm Run additional turbo_optimize_inlined_js_wasm_wrappers enable experimental feedback collection in generic lowering enable Turboshaft s WasmLoadElimination enable Turboshaft s low level load elimination for JS enable Turboshaft s escape analysis for string concatenation use enable Turbolev features that we want to ship in the not too far future trace individual Turboshaft reduction steps trace intermediate Turboshaft reduction steps invocation count threshold for early optimization Enables optimizations which favor memory size over execution speed Enables sampling allocation profiler with X as a sample interval min size of a semi the new space consists of two semi spaces max size of the Collect garbage after Collect garbage after keeps maps alive for< n > old space garbage collections print one detailed trace line in name
return Cast< NumberDictionary >(elements(cage_base))
const int kVariableSizeSentinel
void Print(Tagged< Object > obj)
Handle< To > UncheckedCast(Handle< From > value)
static const int kInvalidEnumCacheSentinel
Map::Bits1::HasPrototypeSlotBit has_named_interceptor
constexpr JSDispatchHandle kNullJSDispatchHandle(0)
bool IsModule(FunctionKind kind)
bool IsShared(Tagged< Object > obj)
bool IsSloppyArgumentsElementsKind(ElementsKind kind)
DONT_OVERRIDE DISABLE_ALLOCATION_SITES HOLEY_ELEMENTS
Map::Bits1::HasPrototypeSlotBit Map::Bits1::HasNamedInterceptorBit Map::Bits1::IsUndetectableBit Map::Bits1::IsConstructorBit Map::Bits2::IsImmutablePrototypeBit is_deprecated
bool IsTerminalElementsKind(ElementsKind kind)
bool IsSharedArrayElementsKind(ElementsKind kind)
DONT_OVERRIDE DISABLE_ALLOCATION_SITES DISABLE_ALLOCATION_SITES HOLEY_DOUBLE_ELEMENTS
bool IsDictionaryElementsKind(ElementsKind kind)
V8_INLINE constexpr bool IsObject(TaggedImpl< kRefType, StorageType > obj)
V8_INLINE constexpr bool IsHeapObject(TaggedImpl< kRefType, StorageType > obj)
V8_EXPORT_PRIVATE FlagValues v8_flags
bool IsAny(Tagged< FieldType > obj)
bool IsUniqueName(Tagged< Name > obj)
kStaticElementsTemplateOffset instance_properties_template
bool IsTaggedIndex(Tagged< Object > obj)
kMemory0SizeOffset Address kNewAllocationLimitAddressOffset Address kOldAllocationLimitAddressOffset uint8_t kGlobalsStartOffset kJumpTableStartOffset std::atomic< uint32_t > kTieringBudgetArrayOffset kDataSegmentStartsOffset kElementSegmentsOffset kInstanceObjectOffset kMemoryObjectsOffset kTaggedGlobalsBufferOffset kTablesOffset dispatch_table0
Tagged< NumberDictionary >
static constexpr Address kNullAddress
bool IsTransitionableFastElementsKind(ElementsKind from_kind)
Map::Bits1::HasPrototypeSlotBit Map::Bits1::HasNamedInterceptorBit Map::Bits1::IsUndetectableBit Map::Bits1::IsConstructorBit Map::Bits2::IsImmutablePrototypeBit Map::Bits3::IsDeprecatedBit Map::Bits3::IsPrototypeMapBit is_extensible
constructor_or_back_pointer
!IsContextMap !IsContextMap Tagged< NativeContext >
constexpr uint32_t kMaxUInt32
kInstanceDescriptorsOffset kTransitionsOrPrototypeInfoOffset IsNull(value)||IsJSProxy(value)||IsWasmObject(value)||(IsJSObject(value) &&(HeapLayout
V8_INLINE IndirectPointerTag IndirectPointerTagFromInstanceType(InstanceType instance_type)
kInstanceDescriptorsOffset kTransitionsOrPrototypeInfoOffset prototype
V8_WARN_UNUSED_RESULT bool IsValidHeapObject(Heap *heap, Tagged< HeapObject > object)
!IsContextMap !IsContextMap native_context
Tagged< To > Cast(Tagged< From > value, const v8::SourceLocation &loc=INIT_SOURCE_LOCATION_IN_DEBUG)
static constexpr RelaxedLoadTag kRelaxedLoad
static constexpr AcquireLoadTag kAcquireLoad
#define STRING_TYPE_LIST(V)
#define CHECK_GE(lhs, rhs)
#define CHECK_IMPLIES(lhs, rhs)
#define CHECK_GT(lhs, rhs)
#define CHECK_LT(lhs, rhs)
#define CHECK_LE(lhs, rhs)
#define DCHECK_IMPLIES(v1, v2)
#define DCHECK_NE(v1, v2)
#define CHECK_NE(lhs, rhs)
#define CHECK_EQ(lhs, rhs)
#define DCHECK(condition)
#define DCHECK_EQ(v1, v2)
constexpr bool IsAligned(T value, U alignment)
static constexpr int index_of(Kind kind)
static constexpr uint32_t kLastMapIdx
static constexpr Tagged< Smi > Empty
static constexpr uint32_t kFirstMapIdx
@ kObjectAssignValidityCell
static constexpr Tagged< Smi > Unreachable
static constexpr size_t kWidth
#define TYPED_ARRAY_CONSTRUCTORS_SWITCH(Type, type, TYPE, Ctype)