diff --git a/src/heap/heap-inl.h b/src/heap/heap-inl.h index d129346295..70505954f3 100644 --- a/src/heap/heap-inl.h +++ b/src/heap/heap-inl.h @@ -224,6 +224,9 @@ AllocationResult Heap::AllocateRaw(int size_in_bytes, AllocationType type, // already. UnprotectAndRegisterMemoryChunk(object); ZapCodeObject(object->address(), size_in_bytes); + if (!large_object) { + MemoryChunk::FromHeapObject(object)->RegisterCodeObject(object); + } } OnAllocationEvent(object, size_in_bytes); } diff --git a/src/heap/spaces.cc b/src/heap/spaces.cc index 841560de7d..fb3c4d4e25 100644 --- a/src/heap/spaces.cc +++ b/src/heap/spaces.cc @@ -602,6 +602,35 @@ void MemoryChunk::SetReadAndWritable() { } } +void MemoryChunk::RegisterCodeObject(HeapObject code) { + DCHECK(MemoryChunk::FromHeapObject(code)->owner()->identity() == CODE_SPACE); + code_object_registry_->insert(code->address()); +} + +void MemoryChunk::RegisterCodeObjectInSwapRegistry(HeapObject code) { + DCHECK(MemoryChunk::FromHeapObject(code)->owner()->identity() == CODE_SPACE); + code_object_registry_swap_->insert(code->address()); +} + +void MemoryChunk::CreateSwapCodeObjectRegistry() { + DCHECK(!code_object_registry_swap_); + DCHECK(code_object_registry_); + code_object_registry_swap_ = new std::set
(); +} + +void MemoryChunk::SwapCodeRegistries() { + DCHECK(code_object_registry_swap_); + DCHECK(code_object_registry_); + std::swap(code_object_registry_swap_, code_object_registry_); + delete code_object_registry_swap_; + code_object_registry_swap_ = nullptr; +} + +bool MemoryChunk::CodeObjectRegistryContains(HeapObject object) { + return code_object_registry_->find(object->address()) != + code_object_registry_->end(); +} + namespace { PageAllocator::Permission DefaultWritableCodePermissions() { @@ -688,6 +717,13 @@ MemoryChunk* MemoryChunk::Initialize(Heap* heap, Address base, size_t size, chunk->reservation_ = std::move(reservation); + if (owner->identity() == CODE_SPACE) { + chunk->code_object_registry_ = new std::set
(); + } else { + chunk->code_object_registry_ = nullptr; + } + chunk->code_object_registry_swap_ = nullptr; + return chunk; } @@ -1309,6 +1345,8 @@ void MemoryChunk::ReleaseAllocatedMemory() { if (local_tracker_ != nullptr) ReleaseLocalTracker(); if (young_generation_bitmap_ != nullptr) ReleaseYoungGenerationBitmap(); if (marking_bitmap_ != nullptr) ReleaseMarkingBitmap(); + if (code_object_registry_ != nullptr) delete code_object_registry_; + DCHECK(!code_object_registry_swap_); if (!IsLargePage()) { Page* page = static_cast(this); @@ -1565,6 +1603,7 @@ void PagedSpace::RefillFreeList() { added += RelinkFreeListCategories(p); } added += p->wasted_memory(); + if (identity() == CODE_SPACE) p->SwapCodeRegistries(); if (is_local() && (added > kCompactionMemoryWanted)) break; } } diff --git a/src/heap/spaces.h b/src/heap/spaces.h index be241ae5fe..88b0b8c958 100644 --- a/src/heap/spaces.h +++ b/src/heap/spaces.h @@ -399,7 +399,9 @@ class MemoryChunk { // FreeListCategory categories_[kNumberOfCategories] + kSystemPointerSize // LocalArrayBufferTracker* local_tracker_ + kIntptrSize // std::atomic young_generation_live_byte_count_ - + kSystemPointerSize; // Bitmap* young_generation_bitmap_ + + kSystemPointerSize // Bitmap* young_generation_bitmap_ + + kSystemPointerSize // std:set code_object_registry_ + + kSystemPointerSize; // std:set code_object_registry_swap_ // Page size in bytes. This must be a multiple of the OS page size. static const int kPageSize = 1 << kPageSizeBits; @@ -671,6 +673,12 @@ class MemoryChunk { base::ListNode& list_node() { return list_node_; } + V8_EXPORT_PRIVATE void RegisterCodeObject(HeapObject code); + V8_EXPORT_PRIVATE void RegisterCodeObjectInSwapRegistry(HeapObject code); + V8_EXPORT_PRIVATE void CreateSwapCodeObjectRegistry(); + V8_EXPORT_PRIVATE void SwapCodeRegistries(); + V8_EXPORT_PRIVATE bool CodeObjectRegistryContains(HeapObject code); + protected: static MemoryChunk* Initialize(Heap* heap, Address base, size_t size, Address area_start, Address area_end, @@ -779,6 +787,9 @@ class MemoryChunk { std::atomic young_generation_live_byte_count_; Bitmap* young_generation_bitmap_; + std::set
* code_object_registry_; + std::set
* code_object_registry_swap_; + private: void InitializeReservedMemory() { reservation_.Reset(); } diff --git a/src/heap/sweeper.cc b/src/heap/sweeper.cc index cbd720561b..b43abc08db 100644 --- a/src/heap/sweeper.cc +++ b/src/heap/sweeper.cc @@ -249,6 +249,8 @@ int Sweeper::RawSweep(Page* p, FreeListRebuildingMode free_list_mode, space->identity() == CODE_SPACE || space->identity() == MAP_SPACE); DCHECK(!p->IsEvacuationCandidate() && !p->SweepingDone()); + bool is_code_page = space->identity() == CODE_SPACE; + // TODO(ulan): we don't have to clear type old-to-old slots in code space // because the concurrent marker doesn't mark code objects. This requires // the write barrier for code objects to check the color of the code object. @@ -274,6 +276,8 @@ int Sweeper::RawSweep(Page* p, FreeListRebuildingMode free_list_mode, skip_list->Clear(); } + if (is_code_page) p->CreateSwapCodeObjectRegistry(); + intptr_t live_bytes = 0; intptr_t freed_bytes = 0; intptr_t max_freed_bytes = 0; @@ -287,6 +291,7 @@ int Sweeper::RawSweep(Page* p, FreeListRebuildingMode free_list_mode, for (auto object_and_size : LiveObjectRange(p, marking_state_->bitmap(p))) { HeapObject const object = object_and_size.first; + if (is_code_page) p->RegisterCodeObjectInSwapRegistry(object); DCHECK(marking_state_->IsBlack(object)); Address free_end = object->address(); if (free_end != free_start) { diff --git a/test/cctest/heap/test-heap.cc b/test/cctest/heap/test-heap.cc index a50d69f1b8..aa40e7b0bd 100644 --- a/test/cctest/heap/test-heap.cc +++ b/test/cctest/heap/test-heap.cc @@ -6619,6 +6619,37 @@ HEAP_TEST(MemoryReducerActivationForSmallHeaps) { CHECK_EQ(heap->memory_reducer()->state_.action, MemoryReducer::Action::kWait); } +TEST(CodeObjectRegistry) { + // We turn off compaction to ensure that code is not moving. + FLAG_never_compact = true; + + Isolate* isolate = CcTest::i_isolate(); + Heap* heap = isolate->heap(); + + Handle code1; + HandleScope outer_scope(heap->isolate()); + Address code2_address; + { + code1 = DummyOptimizedCode(isolate); + Handle code2 = DummyOptimizedCode(isolate); + code2_address = code2->address(); + // If this check breaks, change the allocation to ensure that both code + // objects are on the same page. + CHECK_EQ(MemoryChunk::FromHeapObject(*code1), + MemoryChunk::FromHeapObject(*code2)); + CHECK(MemoryChunk::FromHeapObject(*code1)->CodeObjectRegistryContains( + *code1)); + CHECK(MemoryChunk::FromHeapObject(*code2)->CodeObjectRegistryContains( + *code2)); + } + CcTest::CollectAllAvailableGarbage(); + CHECK( + MemoryChunk::FromHeapObject(*code1)->CodeObjectRegistryContains(*code1)); + CHECK( + MemoryChunk::FromAddress(code2_address) + ->CodeObjectRegistryContains(HeapObject::FromAddress(code2_address))); +} + } // namespace heap } // namespace internal } // namespace v8 diff --git a/tools/v8heapconst.py b/tools/v8heapconst.py index 0134349886..dffa11145b 100644 --- a/tools/v8heapconst.py +++ b/tools/v8heapconst.py @@ -194,249 +194,249 @@ INSTANCE_TYPES = { # List of known V8 maps. KNOWN_MAPS = { - ("read_only_space", 0x00139): (74, "FreeSpaceMap"), - ("read_only_space", 0x00189): (68, "MetaMap"), - ("read_only_space", 0x00209): (67, "NullMap"), - ("read_only_space", 0x00271): (157, "DescriptorArrayMap"), - ("read_only_space", 0x002d1): (152, "WeakFixedArrayMap"), - ("read_only_space", 0x00321): (88, "OnePointerFillerMap"), - ("read_only_space", 0x00371): (88, "TwoPointerFillerMap"), - ("read_only_space", 0x003f1): (67, "UninitializedMap"), - ("read_only_space", 0x00461): (8, "OneByteInternalizedStringMap"), - ("read_only_space", 0x00501): (67, "UndefinedMap"), - ("read_only_space", 0x00561): (65, "HeapNumberMap"), - ("read_only_space", 0x005e1): (67, "TheHoleMap"), - ("read_only_space", 0x00689): (67, "BooleanMap"), - ("read_only_space", 0x00761): (72, "ByteArrayMap"), - ("read_only_space", 0x007b1): (127, "FixedArrayMap"), - ("read_only_space", 0x00801): (127, "FixedCOWArrayMap"), - ("read_only_space", 0x00851): (130, "HashTableMap"), - ("read_only_space", 0x008a1): (64, "SymbolMap"), - ("read_only_space", 0x008f1): (40, "OneByteStringMap"), - ("read_only_space", 0x00941): (140, "ScopeInfoMap"), - ("read_only_space", 0x00991): (164, "SharedFunctionInfoMap"), - ("read_only_space", 0x009e1): (69, "CodeMap"), - ("read_only_space", 0x00a31): (147, "FunctionContextMap"), - ("read_only_space", 0x00a81): (155, "CellMap"), - ("read_only_space", 0x00ad1): (163, "GlobalPropertyCellMap"), - ("read_only_space", 0x00b21): (71, "ForeignMap"), - ("read_only_space", 0x00b71): (153, "TransitionArrayMap"), - ("read_only_space", 0x00bc1): (159, "FeedbackVectorMap"), - ("read_only_space", 0x00c61): (67, "ArgumentsMarkerMap"), - ("read_only_space", 0x00d01): (67, "ExceptionMap"), - ("read_only_space", 0x00da1): (67, "TerminationExceptionMap"), - ("read_only_space", 0x00e49): (67, "OptimizedOutMap"), - ("read_only_space", 0x00ee9): (67, "StaleRegisterMap"), - ("read_only_space", 0x00f59): (149, "NativeContextMap"), - ("read_only_space", 0x00fa9): (148, "ModuleContextMap"), - ("read_only_space", 0x00ff9): (146, "EvalContextMap"), - ("read_only_space", 0x01049): (150, "ScriptContextMap"), - ("read_only_space", 0x01099): (142, "AwaitContextMap"), - ("read_only_space", 0x010e9): (143, "BlockContextMap"), - ("read_only_space", 0x01139): (144, "CatchContextMap"), - ("read_only_space", 0x01189): (151, "WithContextMap"), - ("read_only_space", 0x011d9): (145, "DebugEvaluateContextMap"), - ("read_only_space", 0x01229): (141, "ScriptContextTableMap"), - ("read_only_space", 0x01279): (129, "ClosureFeedbackCellArrayMap"), - ("read_only_space", 0x012c9): (87, "FeedbackMetadataArrayMap"), - ("read_only_space", 0x01319): (127, "ArrayListMap"), - ("read_only_space", 0x01369): (66, "BigIntMap"), - ("read_only_space", 0x013b9): (128, "ObjectBoilerplateDescriptionMap"), - ("read_only_space", 0x01409): (73, "BytecodeArrayMap"), - ("read_only_space", 0x01459): (156, "CodeDataContainerMap"), - ("read_only_space", 0x014a9): (86, "FixedDoubleArrayMap"), - ("read_only_space", 0x014f9): (135, "GlobalDictionaryMap"), - ("read_only_space", 0x01549): (158, "ManyClosuresCellMap"), - ("read_only_space", 0x01599): (127, "ModuleInfoMap"), - ("read_only_space", 0x015e9): (70, "MutableHeapNumberMap"), - ("read_only_space", 0x01639): (134, "NameDictionaryMap"), - ("read_only_space", 0x01689): (158, "NoClosuresCellMap"), - ("read_only_space", 0x016d9): (136, "NumberDictionaryMap"), - ("read_only_space", 0x01729): (158, "OneClosureCellMap"), - ("read_only_space", 0x01779): (131, "OrderedHashMapMap"), - ("read_only_space", 0x017c9): (132, "OrderedHashSetMap"), - ("read_only_space", 0x01819): (133, "OrderedNameDictionaryMap"), - ("read_only_space", 0x01869): (161, "PreparseDataMap"), - ("read_only_space", 0x018b9): (162, "PropertyArrayMap"), - ("read_only_space", 0x01909): (154, "SideEffectCallHandlerInfoMap"), - ("read_only_space", 0x01959): (154, "SideEffectFreeCallHandlerInfoMap"), - ("read_only_space", 0x019a9): (154, "NextCallSideEffectFreeCallHandlerInfoMap"), - ("read_only_space", 0x019f9): (137, "SimpleNumberDictionaryMap"), - ("read_only_space", 0x01a49): (127, "SloppyArgumentsElementsMap"), - ("read_only_space", 0x01a99): (165, "SmallOrderedHashMapMap"), - ("read_only_space", 0x01ae9): (166, "SmallOrderedHashSetMap"), - ("read_only_space", 0x01b39): (167, "SmallOrderedNameDictionaryMap"), - ("read_only_space", 0x01b89): (138, "StringTableMap"), - ("read_only_space", 0x01bd9): (169, "UncompiledDataWithoutPreparseDataMap"), - ("read_only_space", 0x01c29): (170, "UncompiledDataWithPreparseDataMap"), - ("read_only_space", 0x01c79): (171, "WeakArrayListMap"), - ("read_only_space", 0x01cc9): (139, "EphemeronHashTableMap"), - ("read_only_space", 0x01d19): (126, "EmbedderDataArrayMap"), - ("read_only_space", 0x01d69): (172, "WeakCellMap"), - ("read_only_space", 0x01db9): (58, "NativeSourceStringMap"), - ("read_only_space", 0x01e09): (32, "StringMap"), - ("read_only_space", 0x01e59): (41, "ConsOneByteStringMap"), - ("read_only_space", 0x01ea9): (33, "ConsStringMap"), - ("read_only_space", 0x01ef9): (45, "ThinOneByteStringMap"), - ("read_only_space", 0x01f49): (37, "ThinStringMap"), - ("read_only_space", 0x01f99): (35, "SlicedStringMap"), - ("read_only_space", 0x01fe9): (43, "SlicedOneByteStringMap"), - ("read_only_space", 0x02039): (34, "ExternalStringMap"), - ("read_only_space", 0x02089): (42, "ExternalOneByteStringMap"), - ("read_only_space", 0x020d9): (50, "UncachedExternalStringMap"), - ("read_only_space", 0x02129): (0, "InternalizedStringMap"), - ("read_only_space", 0x02179): (2, "ExternalInternalizedStringMap"), - ("read_only_space", 0x021c9): (10, "ExternalOneByteInternalizedStringMap"), - ("read_only_space", 0x02219): (18, "UncachedExternalInternalizedStringMap"), - ("read_only_space", 0x02269): (26, "UncachedExternalOneByteInternalizedStringMap"), - ("read_only_space", 0x022b9): (58, "UncachedExternalOneByteStringMap"), - ("read_only_space", 0x02309): (76, "FixedUint8ArrayMap"), - ("read_only_space", 0x02359): (75, "FixedInt8ArrayMap"), - ("read_only_space", 0x023a9): (78, "FixedUint16ArrayMap"), - ("read_only_space", 0x023f9): (77, "FixedInt16ArrayMap"), - ("read_only_space", 0x02449): (80, "FixedUint32ArrayMap"), - ("read_only_space", 0x02499): (79, "FixedInt32ArrayMap"), - ("read_only_space", 0x024e9): (81, "FixedFloat32ArrayMap"), - ("read_only_space", 0x02539): (82, "FixedFloat64ArrayMap"), - ("read_only_space", 0x02589): (83, "FixedUint8ClampedArrayMap"), - ("read_only_space", 0x025d9): (85, "FixedBigUint64ArrayMap"), - ("read_only_space", 0x02629): (84, "FixedBigInt64ArrayMap"), - ("read_only_space", 0x02679): (67, "SelfReferenceMarkerMap"), - ("read_only_space", 0x026e1): (98, "EnumCacheMap"), - ("read_only_space", 0x02781): (115, "ArrayBoilerplateDescriptionMap"), - ("read_only_space", 0x02ad1): (101, "InterceptorInfoMap"), - ("read_only_space", 0x05109): (89, "AccessCheckInfoMap"), - ("read_only_space", 0x05159): (90, "AccessorInfoMap"), - ("read_only_space", 0x051a9): (91, "AccessorPairMap"), - ("read_only_space", 0x051f9): (92, "AliasedArgumentsEntryMap"), - ("read_only_space", 0x05249): (93, "AllocationMementoMap"), - ("read_only_space", 0x05299): (94, "AsmWasmDataMap"), - ("read_only_space", 0x052e9): (95, "AsyncGeneratorRequestMap"), - ("read_only_space", 0x05339): (96, "ClassPositionsMap"), - ("read_only_space", 0x05389): (97, "DebugInfoMap"), - ("read_only_space", 0x053d9): (99, "FunctionTemplateInfoMap"), - ("read_only_space", 0x05429): (100, "FunctionTemplateRareDataMap"), - ("read_only_space", 0x05479): (102, "InterpreterDataMap"), - ("read_only_space", 0x054c9): (103, "ModuleInfoEntryMap"), - ("read_only_space", 0x05519): (104, "ModuleMap"), - ("read_only_space", 0x05569): (105, "ObjectTemplateInfoMap"), - ("read_only_space", 0x055b9): (106, "PromiseCapabilityMap"), - ("read_only_space", 0x05609): (107, "PromiseReactionMap"), - ("read_only_space", 0x05659): (108, "PrototypeInfoMap"), - ("read_only_space", 0x056a9): (109, "ScriptMap"), - ("read_only_space", 0x056f9): (110, "SourcePositionTableWithFrameCacheMap"), - ("read_only_space", 0x05749): (111, "StackFrameInfoMap"), - ("read_only_space", 0x05799): (112, "StackTraceFrameMap"), - ("read_only_space", 0x057e9): (113, "Tuple2Map"), - ("read_only_space", 0x05839): (114, "Tuple3Map"), - ("read_only_space", 0x05889): (116, "WasmDebugInfoMap"), - ("read_only_space", 0x058d9): (117, "WasmExceptionTagMap"), - ("read_only_space", 0x05929): (118, "WasmExportedFunctionDataMap"), - ("read_only_space", 0x05979): (119, "CallableTaskMap"), - ("read_only_space", 0x059c9): (120, "CallbackTaskMap"), - ("read_only_space", 0x05a19): (121, "PromiseFulfillReactionJobTaskMap"), - ("read_only_space", 0x05a69): (122, "PromiseRejectReactionJobTaskMap"), - ("read_only_space", 0x05ab9): (123, "PromiseResolveThenableJobTaskMap"), - ("read_only_space", 0x05b09): (124, "FinalizationGroupCleanupJobTaskMap"), - ("read_only_space", 0x05b59): (125, "AllocationSiteWithWeakNextMap"), - ("read_only_space", 0x05ba9): (125, "AllocationSiteWithoutWeakNextMap"), - ("read_only_space", 0x05bf9): (160, "LoadHandler1Map"), - ("read_only_space", 0x05c49): (160, "LoadHandler2Map"), - ("read_only_space", 0x05c99): (160, "LoadHandler3Map"), - ("read_only_space", 0x05ce9): (168, "StoreHandler0Map"), - ("read_only_space", 0x05d39): (168, "StoreHandler1Map"), - ("read_only_space", 0x05d89): (168, "StoreHandler2Map"), - ("read_only_space", 0x05dd9): (168, "StoreHandler3Map"), - ("map_space", 0x00139): (1057, "ExternalMap"), - ("map_space", 0x00189): (1073, "JSMessageObjectMap"), + ("read_only_space", 0x00149): (74, "FreeSpaceMap"), + ("read_only_space", 0x00199): (68, "MetaMap"), + ("read_only_space", 0x00219): (67, "NullMap"), + ("read_only_space", 0x00281): (157, "DescriptorArrayMap"), + ("read_only_space", 0x002e1): (152, "WeakFixedArrayMap"), + ("read_only_space", 0x00331): (88, "OnePointerFillerMap"), + ("read_only_space", 0x00381): (88, "TwoPointerFillerMap"), + ("read_only_space", 0x00401): (67, "UninitializedMap"), + ("read_only_space", 0x00471): (8, "OneByteInternalizedStringMap"), + ("read_only_space", 0x00511): (67, "UndefinedMap"), + ("read_only_space", 0x00571): (65, "HeapNumberMap"), + ("read_only_space", 0x005f1): (67, "TheHoleMap"), + ("read_only_space", 0x00699): (67, "BooleanMap"), + ("read_only_space", 0x00771): (72, "ByteArrayMap"), + ("read_only_space", 0x007c1): (127, "FixedArrayMap"), + ("read_only_space", 0x00811): (127, "FixedCOWArrayMap"), + ("read_only_space", 0x00861): (130, "HashTableMap"), + ("read_only_space", 0x008b1): (64, "SymbolMap"), + ("read_only_space", 0x00901): (40, "OneByteStringMap"), + ("read_only_space", 0x00951): (140, "ScopeInfoMap"), + ("read_only_space", 0x009a1): (164, "SharedFunctionInfoMap"), + ("read_only_space", 0x009f1): (69, "CodeMap"), + ("read_only_space", 0x00a41): (147, "FunctionContextMap"), + ("read_only_space", 0x00a91): (155, "CellMap"), + ("read_only_space", 0x00ae1): (163, "GlobalPropertyCellMap"), + ("read_only_space", 0x00b31): (71, "ForeignMap"), + ("read_only_space", 0x00b81): (153, "TransitionArrayMap"), + ("read_only_space", 0x00bd1): (159, "FeedbackVectorMap"), + ("read_only_space", 0x00c71): (67, "ArgumentsMarkerMap"), + ("read_only_space", 0x00d11): (67, "ExceptionMap"), + ("read_only_space", 0x00db1): (67, "TerminationExceptionMap"), + ("read_only_space", 0x00e59): (67, "OptimizedOutMap"), + ("read_only_space", 0x00ef9): (67, "StaleRegisterMap"), + ("read_only_space", 0x00f69): (149, "NativeContextMap"), + ("read_only_space", 0x00fb9): (148, "ModuleContextMap"), + ("read_only_space", 0x01009): (146, "EvalContextMap"), + ("read_only_space", 0x01059): (150, "ScriptContextMap"), + ("read_only_space", 0x010a9): (142, "AwaitContextMap"), + ("read_only_space", 0x010f9): (143, "BlockContextMap"), + ("read_only_space", 0x01149): (144, "CatchContextMap"), + ("read_only_space", 0x01199): (151, "WithContextMap"), + ("read_only_space", 0x011e9): (145, "DebugEvaluateContextMap"), + ("read_only_space", 0x01239): (141, "ScriptContextTableMap"), + ("read_only_space", 0x01289): (129, "ClosureFeedbackCellArrayMap"), + ("read_only_space", 0x012d9): (87, "FeedbackMetadataArrayMap"), + ("read_only_space", 0x01329): (127, "ArrayListMap"), + ("read_only_space", 0x01379): (66, "BigIntMap"), + ("read_only_space", 0x013c9): (128, "ObjectBoilerplateDescriptionMap"), + ("read_only_space", 0x01419): (73, "BytecodeArrayMap"), + ("read_only_space", 0x01469): (156, "CodeDataContainerMap"), + ("read_only_space", 0x014b9): (86, "FixedDoubleArrayMap"), + ("read_only_space", 0x01509): (135, "GlobalDictionaryMap"), + ("read_only_space", 0x01559): (158, "ManyClosuresCellMap"), + ("read_only_space", 0x015a9): (127, "ModuleInfoMap"), + ("read_only_space", 0x015f9): (70, "MutableHeapNumberMap"), + ("read_only_space", 0x01649): (134, "NameDictionaryMap"), + ("read_only_space", 0x01699): (158, "NoClosuresCellMap"), + ("read_only_space", 0x016e9): (136, "NumberDictionaryMap"), + ("read_only_space", 0x01739): (158, "OneClosureCellMap"), + ("read_only_space", 0x01789): (131, "OrderedHashMapMap"), + ("read_only_space", 0x017d9): (132, "OrderedHashSetMap"), + ("read_only_space", 0x01829): (133, "OrderedNameDictionaryMap"), + ("read_only_space", 0x01879): (161, "PreparseDataMap"), + ("read_only_space", 0x018c9): (162, "PropertyArrayMap"), + ("read_only_space", 0x01919): (154, "SideEffectCallHandlerInfoMap"), + ("read_only_space", 0x01969): (154, "SideEffectFreeCallHandlerInfoMap"), + ("read_only_space", 0x019b9): (154, "NextCallSideEffectFreeCallHandlerInfoMap"), + ("read_only_space", 0x01a09): (137, "SimpleNumberDictionaryMap"), + ("read_only_space", 0x01a59): (127, "SloppyArgumentsElementsMap"), + ("read_only_space", 0x01aa9): (165, "SmallOrderedHashMapMap"), + ("read_only_space", 0x01af9): (166, "SmallOrderedHashSetMap"), + ("read_only_space", 0x01b49): (167, "SmallOrderedNameDictionaryMap"), + ("read_only_space", 0x01b99): (138, "StringTableMap"), + ("read_only_space", 0x01be9): (169, "UncompiledDataWithoutPreparseDataMap"), + ("read_only_space", 0x01c39): (170, "UncompiledDataWithPreparseDataMap"), + ("read_only_space", 0x01c89): (171, "WeakArrayListMap"), + ("read_only_space", 0x01cd9): (139, "EphemeronHashTableMap"), + ("read_only_space", 0x01d29): (126, "EmbedderDataArrayMap"), + ("read_only_space", 0x01d79): (172, "WeakCellMap"), + ("read_only_space", 0x01dc9): (58, "NativeSourceStringMap"), + ("read_only_space", 0x01e19): (32, "StringMap"), + ("read_only_space", 0x01e69): (41, "ConsOneByteStringMap"), + ("read_only_space", 0x01eb9): (33, "ConsStringMap"), + ("read_only_space", 0x01f09): (45, "ThinOneByteStringMap"), + ("read_only_space", 0x01f59): (37, "ThinStringMap"), + ("read_only_space", 0x01fa9): (35, "SlicedStringMap"), + ("read_only_space", 0x01ff9): (43, "SlicedOneByteStringMap"), + ("read_only_space", 0x02049): (34, "ExternalStringMap"), + ("read_only_space", 0x02099): (42, "ExternalOneByteStringMap"), + ("read_only_space", 0x020e9): (50, "UncachedExternalStringMap"), + ("read_only_space", 0x02139): (0, "InternalizedStringMap"), + ("read_only_space", 0x02189): (2, "ExternalInternalizedStringMap"), + ("read_only_space", 0x021d9): (10, "ExternalOneByteInternalizedStringMap"), + ("read_only_space", 0x02229): (18, "UncachedExternalInternalizedStringMap"), + ("read_only_space", 0x02279): (26, "UncachedExternalOneByteInternalizedStringMap"), + ("read_only_space", 0x022c9): (58, "UncachedExternalOneByteStringMap"), + ("read_only_space", 0x02319): (76, "FixedUint8ArrayMap"), + ("read_only_space", 0x02369): (75, "FixedInt8ArrayMap"), + ("read_only_space", 0x023b9): (78, "FixedUint16ArrayMap"), + ("read_only_space", 0x02409): (77, "FixedInt16ArrayMap"), + ("read_only_space", 0x02459): (80, "FixedUint32ArrayMap"), + ("read_only_space", 0x024a9): (79, "FixedInt32ArrayMap"), + ("read_only_space", 0x024f9): (81, "FixedFloat32ArrayMap"), + ("read_only_space", 0x02549): (82, "FixedFloat64ArrayMap"), + ("read_only_space", 0x02599): (83, "FixedUint8ClampedArrayMap"), + ("read_only_space", 0x025e9): (85, "FixedBigUint64ArrayMap"), + ("read_only_space", 0x02639): (84, "FixedBigInt64ArrayMap"), + ("read_only_space", 0x02689): (67, "SelfReferenceMarkerMap"), + ("read_only_space", 0x026f1): (98, "EnumCacheMap"), + ("read_only_space", 0x02791): (115, "ArrayBoilerplateDescriptionMap"), + ("read_only_space", 0x02ae1): (101, "InterceptorInfoMap"), + ("read_only_space", 0x05119): (89, "AccessCheckInfoMap"), + ("read_only_space", 0x05169): (90, "AccessorInfoMap"), + ("read_only_space", 0x051b9): (91, "AccessorPairMap"), + ("read_only_space", 0x05209): (92, "AliasedArgumentsEntryMap"), + ("read_only_space", 0x05259): (93, "AllocationMementoMap"), + ("read_only_space", 0x052a9): (94, "AsmWasmDataMap"), + ("read_only_space", 0x052f9): (95, "AsyncGeneratorRequestMap"), + ("read_only_space", 0x05349): (96, "ClassPositionsMap"), + ("read_only_space", 0x05399): (97, "DebugInfoMap"), + ("read_only_space", 0x053e9): (99, "FunctionTemplateInfoMap"), + ("read_only_space", 0x05439): (100, "FunctionTemplateRareDataMap"), + ("read_only_space", 0x05489): (102, "InterpreterDataMap"), + ("read_only_space", 0x054d9): (103, "ModuleInfoEntryMap"), + ("read_only_space", 0x05529): (104, "ModuleMap"), + ("read_only_space", 0x05579): (105, "ObjectTemplateInfoMap"), + ("read_only_space", 0x055c9): (106, "PromiseCapabilityMap"), + ("read_only_space", 0x05619): (107, "PromiseReactionMap"), + ("read_only_space", 0x05669): (108, "PrototypeInfoMap"), + ("read_only_space", 0x056b9): (109, "ScriptMap"), + ("read_only_space", 0x05709): (110, "SourcePositionTableWithFrameCacheMap"), + ("read_only_space", 0x05759): (111, "StackFrameInfoMap"), + ("read_only_space", 0x057a9): (112, "StackTraceFrameMap"), + ("read_only_space", 0x057f9): (113, "Tuple2Map"), + ("read_only_space", 0x05849): (114, "Tuple3Map"), + ("read_only_space", 0x05899): (116, "WasmDebugInfoMap"), + ("read_only_space", 0x058e9): (117, "WasmExceptionTagMap"), + ("read_only_space", 0x05939): (118, "WasmExportedFunctionDataMap"), + ("read_only_space", 0x05989): (119, "CallableTaskMap"), + ("read_only_space", 0x059d9): (120, "CallbackTaskMap"), + ("read_only_space", 0x05a29): (121, "PromiseFulfillReactionJobTaskMap"), + ("read_only_space", 0x05a79): (122, "PromiseRejectReactionJobTaskMap"), + ("read_only_space", 0x05ac9): (123, "PromiseResolveThenableJobTaskMap"), + ("read_only_space", 0x05b19): (124, "FinalizationGroupCleanupJobTaskMap"), + ("read_only_space", 0x05b69): (125, "AllocationSiteWithWeakNextMap"), + ("read_only_space", 0x05bb9): (125, "AllocationSiteWithoutWeakNextMap"), + ("read_only_space", 0x05c09): (160, "LoadHandler1Map"), + ("read_only_space", 0x05c59): (160, "LoadHandler2Map"), + ("read_only_space", 0x05ca9): (160, "LoadHandler3Map"), + ("read_only_space", 0x05cf9): (168, "StoreHandler0Map"), + ("read_only_space", 0x05d49): (168, "StoreHandler1Map"), + ("read_only_space", 0x05d99): (168, "StoreHandler2Map"), + ("read_only_space", 0x05de9): (168, "StoreHandler3Map"), + ("map_space", 0x00149): (1057, "ExternalMap"), + ("map_space", 0x00199): (1073, "JSMessageObjectMap"), } # List of known V8 objects. KNOWN_OBJECTS = { - ("read_only_space", 0x001d9): "NullValue", - ("read_only_space", 0x00259): "EmptyDescriptorArray", - ("read_only_space", 0x002c1): "EmptyWeakFixedArray", - ("read_only_space", 0x003c1): "UninitializedValue", - ("read_only_space", 0x004d1): "UndefinedValue", - ("read_only_space", 0x00551): "NanValue", - ("read_only_space", 0x005b1): "TheHoleValue", - ("read_only_space", 0x00649): "HoleNanValue", - ("read_only_space", 0x00659): "TrueValue", - ("read_only_space", 0x00709): "FalseValue", - ("read_only_space", 0x00751): "empty_string", - ("read_only_space", 0x00c11): "EmptyScopeInfo", - ("read_only_space", 0x00c21): "EmptyFixedArray", - ("read_only_space", 0x00c31): "ArgumentsMarker", - ("read_only_space", 0x00cd1): "Exception", - ("read_only_space", 0x00d71): "TerminationException", - ("read_only_space", 0x00e19): "OptimizedOut", - ("read_only_space", 0x00eb9): "StaleRegister", - ("read_only_space", 0x026c9): "EmptyEnumCache", - ("read_only_space", 0x02731): "EmptyPropertyArray", - ("read_only_space", 0x02741): "EmptyByteArray", - ("read_only_space", 0x02751): "EmptyObjectBoilerplateDescription", - ("read_only_space", 0x02769): "EmptyArrayBoilerplateDescription", - ("read_only_space", 0x027d1): "EmptyClosureFeedbackCellArray", - ("read_only_space", 0x027e1): "EmptyFixedUint8Array", - ("read_only_space", 0x02801): "EmptyFixedInt8Array", - ("read_only_space", 0x02821): "EmptyFixedUint16Array", - ("read_only_space", 0x02841): "EmptyFixedInt16Array", - ("read_only_space", 0x02861): "EmptyFixedUint32Array", - ("read_only_space", 0x02881): "EmptyFixedInt32Array", - ("read_only_space", 0x028a1): "EmptyFixedFloat32Array", - ("read_only_space", 0x028c1): "EmptyFixedFloat64Array", - ("read_only_space", 0x028e1): "EmptyFixedUint8ClampedArray", - ("read_only_space", 0x02901): "EmptyFixedBigUint64Array", - ("read_only_space", 0x02921): "EmptyFixedBigInt64Array", - ("read_only_space", 0x02941): "EmptySloppyArgumentsElements", - ("read_only_space", 0x02961): "EmptySlowElementDictionary", - ("read_only_space", 0x029a9): "EmptyOrderedHashMap", - ("read_only_space", 0x029d1): "EmptyOrderedHashSet", - ("read_only_space", 0x029f9): "EmptyFeedbackMetadata", - ("read_only_space", 0x02a09): "EmptyPropertyCell", - ("read_only_space", 0x02a31): "EmptyPropertyDictionary", - ("read_only_space", 0x02a81): "NoOpInterceptorInfo", - ("read_only_space", 0x02b21): "EmptyWeakArrayList", - ("read_only_space", 0x02b39): "InfinityValue", - ("read_only_space", 0x02b49): "MinusZeroValue", - ("read_only_space", 0x02b59): "MinusInfinityValue", - ("read_only_space", 0x02b69): "SelfReferenceMarker", - ("read_only_space", 0x02bc1): "OffHeapTrampolineRelocationInfo", - ("read_only_space", 0x02bd9): "HashSeed", - ("old_space", 0x00139): "ArgumentsIteratorAccessor", - ("old_space", 0x001a9): "ArrayLengthAccessor", - ("old_space", 0x00219): "BoundFunctionLengthAccessor", - ("old_space", 0x00289): "BoundFunctionNameAccessor", - ("old_space", 0x002f9): "ErrorStackAccessor", - ("old_space", 0x00369): "FunctionArgumentsAccessor", - ("old_space", 0x003d9): "FunctionCallerAccessor", - ("old_space", 0x00449): "FunctionNameAccessor", - ("old_space", 0x004b9): "FunctionLengthAccessor", - ("old_space", 0x00529): "FunctionPrototypeAccessor", - ("old_space", 0x00599): "StringLengthAccessor", - ("old_space", 0x00609): "InvalidPrototypeValidityCell", - ("old_space", 0x00619): "EmptyScript", - ("old_space", 0x00699): "ManyClosuresCell", - ("old_space", 0x006b1): "ArrayConstructorProtector", - ("old_space", 0x006c1): "NoElementsProtector", - ("old_space", 0x006e9): "IsConcatSpreadableProtector", - ("old_space", 0x006f9): "ArraySpeciesProtector", - ("old_space", 0x00721): "TypedArraySpeciesProtector", - ("old_space", 0x00749): "RegExpSpeciesProtector", - ("old_space", 0x00771): "PromiseSpeciesProtector", - ("old_space", 0x00799): "StringLengthProtector", - ("old_space", 0x007a9): "ArrayIteratorProtector", - ("old_space", 0x007d1): "ArrayBufferDetachingProtector", - ("old_space", 0x007f9): "PromiseHookProtector", - ("old_space", 0x00821): "PromiseResolveProtector", - ("old_space", 0x00831): "MapIteratorProtector", - ("old_space", 0x00859): "PromiseThenProtector", - ("old_space", 0x00881): "SetIteratorProtector", - ("old_space", 0x008a9): "StringIteratorProtector", - ("old_space", 0x008d1): "SingleCharacterStringCache", - ("old_space", 0x010e1): "StringSplitCache", - ("old_space", 0x018f1): "RegExpMultipleCache", - ("old_space", 0x02101): "BuiltinsConstantsTable", + ("read_only_space", 0x001e9): "NullValue", + ("read_only_space", 0x00269): "EmptyDescriptorArray", + ("read_only_space", 0x002d1): "EmptyWeakFixedArray", + ("read_only_space", 0x003d1): "UninitializedValue", + ("read_only_space", 0x004e1): "UndefinedValue", + ("read_only_space", 0x00561): "NanValue", + ("read_only_space", 0x005c1): "TheHoleValue", + ("read_only_space", 0x00659): "HoleNanValue", + ("read_only_space", 0x00669): "TrueValue", + ("read_only_space", 0x00719): "FalseValue", + ("read_only_space", 0x00761): "empty_string", + ("read_only_space", 0x00c21): "EmptyScopeInfo", + ("read_only_space", 0x00c31): "EmptyFixedArray", + ("read_only_space", 0x00c41): "ArgumentsMarker", + ("read_only_space", 0x00ce1): "Exception", + ("read_only_space", 0x00d81): "TerminationException", + ("read_only_space", 0x00e29): "OptimizedOut", + ("read_only_space", 0x00ec9): "StaleRegister", + ("read_only_space", 0x026d9): "EmptyEnumCache", + ("read_only_space", 0x02741): "EmptyPropertyArray", + ("read_only_space", 0x02751): "EmptyByteArray", + ("read_only_space", 0x02761): "EmptyObjectBoilerplateDescription", + ("read_only_space", 0x02779): "EmptyArrayBoilerplateDescription", + ("read_only_space", 0x027e1): "EmptyClosureFeedbackCellArray", + ("read_only_space", 0x027f1): "EmptyFixedUint8Array", + ("read_only_space", 0x02811): "EmptyFixedInt8Array", + ("read_only_space", 0x02831): "EmptyFixedUint16Array", + ("read_only_space", 0x02851): "EmptyFixedInt16Array", + ("read_only_space", 0x02871): "EmptyFixedUint32Array", + ("read_only_space", 0x02891): "EmptyFixedInt32Array", + ("read_only_space", 0x028b1): "EmptyFixedFloat32Array", + ("read_only_space", 0x028d1): "EmptyFixedFloat64Array", + ("read_only_space", 0x028f1): "EmptyFixedUint8ClampedArray", + ("read_only_space", 0x02911): "EmptyFixedBigUint64Array", + ("read_only_space", 0x02931): "EmptyFixedBigInt64Array", + ("read_only_space", 0x02951): "EmptySloppyArgumentsElements", + ("read_only_space", 0x02971): "EmptySlowElementDictionary", + ("read_only_space", 0x029b9): "EmptyOrderedHashMap", + ("read_only_space", 0x029e1): "EmptyOrderedHashSet", + ("read_only_space", 0x02a09): "EmptyFeedbackMetadata", + ("read_only_space", 0x02a19): "EmptyPropertyCell", + ("read_only_space", 0x02a41): "EmptyPropertyDictionary", + ("read_only_space", 0x02a91): "NoOpInterceptorInfo", + ("read_only_space", 0x02b31): "EmptyWeakArrayList", + ("read_only_space", 0x02b49): "InfinityValue", + ("read_only_space", 0x02b59): "MinusZeroValue", + ("read_only_space", 0x02b69): "MinusInfinityValue", + ("read_only_space", 0x02b79): "SelfReferenceMarker", + ("read_only_space", 0x02bd1): "OffHeapTrampolineRelocationInfo", + ("read_only_space", 0x02be9): "HashSeed", + ("old_space", 0x00149): "ArgumentsIteratorAccessor", + ("old_space", 0x001b9): "ArrayLengthAccessor", + ("old_space", 0x00229): "BoundFunctionLengthAccessor", + ("old_space", 0x00299): "BoundFunctionNameAccessor", + ("old_space", 0x00309): "ErrorStackAccessor", + ("old_space", 0x00379): "FunctionArgumentsAccessor", + ("old_space", 0x003e9): "FunctionCallerAccessor", + ("old_space", 0x00459): "FunctionNameAccessor", + ("old_space", 0x004c9): "FunctionLengthAccessor", + ("old_space", 0x00539): "FunctionPrototypeAccessor", + ("old_space", 0x005a9): "StringLengthAccessor", + ("old_space", 0x00619): "InvalidPrototypeValidityCell", + ("old_space", 0x00629): "EmptyScript", + ("old_space", 0x006a9): "ManyClosuresCell", + ("old_space", 0x006c1): "ArrayConstructorProtector", + ("old_space", 0x006d1): "NoElementsProtector", + ("old_space", 0x006f9): "IsConcatSpreadableProtector", + ("old_space", 0x00709): "ArraySpeciesProtector", + ("old_space", 0x00731): "TypedArraySpeciesProtector", + ("old_space", 0x00759): "RegExpSpeciesProtector", + ("old_space", 0x00781): "PromiseSpeciesProtector", + ("old_space", 0x007a9): "StringLengthProtector", + ("old_space", 0x007b9): "ArrayIteratorProtector", + ("old_space", 0x007e1): "ArrayBufferDetachingProtector", + ("old_space", 0x00809): "PromiseHookProtector", + ("old_space", 0x00831): "PromiseResolveProtector", + ("old_space", 0x00841): "MapIteratorProtector", + ("old_space", 0x00869): "PromiseThenProtector", + ("old_space", 0x00891): "SetIteratorProtector", + ("old_space", 0x008b9): "StringIteratorProtector", + ("old_space", 0x008e1): "SingleCharacterStringCache", + ("old_space", 0x010f1): "StringSplitCache", + ("old_space", 0x01901): "RegExpMultipleCache", + ("old_space", 0x02111): "BuiltinsConstantsTable", } # List of known V8 Frame Markers.