Lines Matching refs:structure

86 inline void StructureTransitionTable::remove(Structure* structure)
92 // As such, the passed structure *must* be the existing transition.
93 ASSERT(singleTransition() == structure);
96 // Check whether a mapping exists for structure's key, and whether the
97 // entry is structure (the latter check may fail if we initially had a
99 TransitionMap::iterator entry = map()->find(make_pair(structure->m_nameInPrevious, structure->m_attributesInPrevious));
100 if (entry != map()->end() && structure == entry.get().second)
105 inline void StructureTransitionTable::add(JSGlobalData& globalData, Structure* structure)
112 setSingleTransition(globalData, structure);
122 // Add the structure to the map.
123 std::pair<TransitionMap::iterator, bool> result = map()->add(globalData, make_pair(structure->m_nameInPrevious, structure->m_attributesInPrevious), structure);
127 ASSERT(!structure->m_specificValueInPrevious);
128 map()->set(result.first, structure);
143 Structure* structure = *it;
145 switch (structure->m_transitionTable.size()) {
148 if (!structure->m_previous)
157 if (structure->m_propertyTable) {
159 totalPropertyMapsSize += structure->m_propertyTable->sizeInMemory();
251 Structure* structure = this;
254 while ((structure = structure->previousID())) {
255 if (structure->m_isPinnedPropertyTable) {
256 ASSERT(structure->m_propertyTable);
257 ASSERT(!structure->m_previous);
259 m_propertyTable = structure->m_propertyTable->copy(globalData, 0, m_offset + 1);
263 structures.append(structure);
270 structure = structures[i];
271 PropertyMapEntry entry(globalData, this, structure->m_nameInPrevious.get(), m_anonymousSlotCount + structure->m_offset, structure->m_attributesInPrevious, structure->m_specificValueInPrevious.get());
298 Structure* Structure::addPropertyTransitionToExistingStructure(Structure* structure, const Identifier& propertyName, unsigned attributes, JSCell* specificValue, size_t& offset)
300 ASSERT(!structure->isDictionary());
301 ASSERT(structure->typeInfo().type() == ObjectType);
303 if (Structure* existingTransition = structure->m_transitionTable.get(propertyName.impl(), attributes)) {
309 ASSERT(offset >= structure->m_anonymousSlotCount);
310 ASSERT(structure->m_anonymousSlotCount == existingTransition->m_anonymousSlotCount);
317 Structure* Structure::addPropertyTransition(JSGlobalData& globalData, Structure* structure, const Identifier& propertyName, unsigned attributes, JSCell* specificValue, size_t& offset)
326 if (specificValue && structure->m_transitionTable.contains(propertyName.impl(), attributes))
329 ASSERT(!structure->isDictionary());
330 ASSERT(structure->typeInfo().type() == ObjectType);
331 ASSERT(!Structure::addPropertyTransitionToExistingStructure(structure, propertyName, attributes, specificValue, offset));
333 if (structure->m_specificFunctionThrashCount == maxSpecificFunctionThrashCount)
336 if (structure->transitionCount() > s_maxTransitionLength) {
337 Structure* transition = toCacheableDictionaryTransition(globalData, structure);
338 ASSERT(structure != transition);
340 ASSERT(offset >= structure->m_anonymousSlotCount);
341 ASSERT(structure->m_anonymousSlotCount == transition->m_anonymousSlotCount);
347 Structure* transition = create(globalData, structure);
349 transition->m_cachedPrototypeChain.set(globalData, transition, structure->m_cachedPrototypeChain.get());
350 transition->m_previous.set(globalData, transition, structure);
355 if (structure->m_propertyTable) {
356 if (structure->m_isPinnedPropertyTable)
357 transition->m_propertyTable = structure->m_propertyTable->copy(globalData, 0, structure->m_propertyTable->size() + 1);
359 transition->m_propertyTable = structure->m_propertyTable.release();
361 if (structure->m_previous)
368 ASSERT(offset >= structure->m_anonymousSlotCount);
369 ASSERT(structure->m_anonymousSlotCount == transition->m_anonymousSlotCount);
373 transition->m_offset = offset - structure->m_anonymousSlotCount;
374 ASSERT(structure->anonymousSlotCount() == transition->anonymousSlotCount());
375 structure->m_transitionTable.add(globalData, transition);
379 Structure* Structure::removePropertyTransition(JSGlobalData& globalData, Structure* structure, const Identifier& propertyName, size_t& offset)
381 ASSERT(!structure->isUncacheableDictionary());
383 Structure* transition = toUncacheableDictionaryTransition(globalData, structure);
386 ASSERT(offset >= structure->m_anonymousSlotCount);
387 ASSERT(structure->m_anonymousSlotCount == transition->m_anonymousSlotCount);
392 Structure* Structure::changePrototypeTransition(JSGlobalData& globalData, Structure* structure, JSValue prototype)
394 Structure* transition = create(globalData, structure);
400 structure->materializePropertyMapIfNecessary(globalData);
401 transition->m_propertyTable = structure->copyPropertyTable(globalData, transition);
404 ASSERT(structure->anonymousSlotCount() == transition->anonymousSlotCount());
408 Structure* Structure::despecifyFunctionTransition(JSGlobalData& globalData, Structure* structure, const Identifier& replaceFunction)
410 ASSERT(structure->m_specificFunctionThrashCount < maxSpecificFunctionThrashCount);
411 Structure* transition = create(globalData, structure);
417 structure->materializePropertyMapIfNecessary(globalData);
418 transition->m_propertyTable = structure->copyPropertyTable(globalData, transition);
428 ASSERT(structure->anonymousSlotCount() == transition->anonymousSlotCount());
432 Structure* Structure::getterSetterTransition(JSGlobalData& globalData, Structure* structure)
434 Structure* transition = create(globalData, structure);
438 structure->materializePropertyMapIfNecessary(globalData);
439 transition->m_propertyTable = structure->copyPropertyTable(globalData, transition);
442 ASSERT(structure->anonymousSlotCount() == transition->anonymousSlotCount());
446 Structure* Structure::toDictionaryTransition(JSGlobalData& globalData, Structure* structure, DictionaryKind kind)
448 ASSERT(!structure->isUncacheableDictionary());
450 Structure* transition = create(globalData, structure);
452 structure->materializePropertyMapIfNecessary(globalData);
453 transition->m_propertyTable = structure->copyPropertyTable(globalData, transition);
457 ASSERT(structure->anonymousSlotCount() == transition->anonymousSlotCount());
461 Structure* Structure::toCacheableDictionaryTransition(JSGlobalData& globalData, Structure* structure)
463 return toDictionaryTransition(globalData, structure, CachedDictionaryKind);
466 Structure* Structure::toUncacheableDictionaryTransition(JSGlobalData& globalData, Structure* structure)
468 return toDictionaryTransition(globalData, structure, UncachedDictionaryKind);
472 Structure* Structure::sealTransition(JSGlobalData& globalData, Structure* structure)
474 Structure* transition = preventExtensionsTransition(globalData, structure);
486 Structure* Structure::freezeTransition(JSGlobalData& globalData, Structure* structure)
488 Structure* transition = preventExtensionsTransition(globalData, structure);
500 Structure* Structure::preventExtensionsTransition(JSGlobalData& globalData, Structure* structure)
502 Structure* transition = create(globalData, structure);
506 structure->materializePropertyMapIfNecessary(globalData);
507 transition->m_propertyTable = structure->copyPropertyTable(globalData, transition);
511 ASSERT(structure->anonymousSlotCount() == transition->anonymousSlotCount());