void ThreadContextTTD::LoadInvertedRootMap(JsUtil::BaseDictionary<Js::RecyclableObject*, TTD_LOG_PTR_ID, HeapAllocator>& objToLogIdMap) const { for(auto iter = this->m_ttdRootTagToObjectMap.GetIterator(); iter.IsValid(); iter.MoveNext()) { objToLogIdMap.AddNew(iter.CurrentValue(), iter.CurrentKey()); } }
void InflateMap::PrepForReInflate(uint32 ctxCount, uint32 handlerCount, uint32 typeCount, uint32 objectCount, uint32 bodyCount, uint32 dbgScopeCount, uint32 envCount, uint32 slotCount) { this->m_typeMap.Initialize(typeCount); this->m_handlerMap.Initialize(handlerCount); this->m_tagToGlobalObjectMap.Initialize(ctxCount); this->m_debuggerScopeHomeBodyMap.Initialize(dbgScopeCount); this->m_debuggerScopeChainIndexMap.Initialize(dbgScopeCount); this->m_environmentMap.Initialize(envCount); this->m_slotArrayMap.Initialize(slotCount); this->m_promiseDataMap.Clear(); //We re-use these values (and reset things below) so we don't neet to initialize them here //m_objectMap //m_functionBodyMap //copy info we want to reuse into the old maps this->m_oldObjectMap.MoveDataInto(this->m_objectMap); this->m_oldFunctionBodyMap.MoveDataInto(this->m_functionBodyMap); //allocate the old pin set and fill it TTDAssert(this->m_oldInflatePinSet == nullptr, "Old pin set is not null."); Recycler* pinRecycler = this->m_inflatePinSet->GetAllocator(); this->m_oldInflatePinSet.Root(RecyclerNew(pinRecycler, ObjectPinSet, pinRecycler, this->m_inflatePinSet->Count()), pinRecycler); for(auto iter = this->m_inflatePinSet->GetIterator(); iter.IsValid(); iter.MoveNext()) { this->m_oldInflatePinSet->AddNew(iter.CurrentKey()); } this->m_inflatePinSet->Clear(); this->m_environmentPinSet->Clear(); this->m_slotArrayPinSet->Clear(); }
void AssertSnapEquiv(const SnapHandler* h1, const SnapHandler* h2, TTDCompareMap& compareMap) { compareMap.DiagnosticAssert(h1->IsExtensibleFlag == h2->IsExtensibleFlag); JsUtil::BaseDictionary<int64, uint32, HeapAllocator> h1Dict(&HeapAllocator::Instance); for(uint32 i = 0; i < h1->MaxPropertyIndex; ++i) { if(h1->PropertyInfoArray[i].DataKind != SnapEntryDataKindTag::Clear) { int64 locationTag = ComputeLocationTagForAssertCompare(h1->PropertyInfoArray[i]); h1Dict.AddNew(locationTag, i); } } JsUtil::BaseDictionary<int64, uint32, HeapAllocator> h2Dict(&HeapAllocator::Instance); for(uint32 i = 0; i < h2->MaxPropertyIndex; ++i) { if(h2->PropertyInfoArray[i].DataKind != SnapEntryDataKindTag::Clear) { int64 locationTag = ComputeLocationTagForAssertCompare(h2->PropertyInfoArray[i]); h2Dict.AddNew(locationTag, i); } } compareMap.DiagnosticAssert(h1Dict.Count() == h2Dict.Count()); for(auto iter = h1Dict.GetIterator(); iter.IsValid(); iter.MoveNext()) { int64 locationTag = iter.CurrentKey(); compareMap.DiagnosticAssert(h2Dict.ContainsKey(locationTag)); uint32 h1Idx = h1Dict.LookupWithKey(locationTag, 0); uint32 h2Idx = h2Dict.LookupWithKey(locationTag, 0); compareMap.DiagnosticAssert(h1->PropertyInfoArray[h1Idx].AttributeInfo == h2->PropertyInfoArray[h2Idx].AttributeInfo); } }