+ transition->pin();
+
+ transition->checkOffsetConsistency();
+ return transition;
+}
+
+Structure* Structure::toCacheableDictionaryTransition(VM& vm, Structure* structure)
+{
+ return toDictionaryTransition(vm, structure, CachedDictionaryKind);
+}
+
+Structure* Structure::toUncacheableDictionaryTransition(VM& vm, Structure* structure)
+{
+ return toDictionaryTransition(vm, structure, UncachedDictionaryKind);
+}
+
+// In future we may want to cache this transition.
+Structure* Structure::sealTransition(VM& vm, Structure* structure)
+{
+ Structure* transition = preventExtensionsTransition(vm, structure);
+
+ if (transition->propertyTable()) {
+ PropertyTable::iterator end = transition->propertyTable()->end();
+ for (PropertyTable::iterator iter = transition->propertyTable()->begin(); iter != end; ++iter)
+ iter->attributes |= DontDelete;
+ }
+
+ transition->checkOffsetConsistency();
+ return transition;
+}
+
+// In future we may want to cache this transition.
+Structure* Structure::freezeTransition(VM& vm, Structure* structure)
+{
+ Structure* transition = preventExtensionsTransition(vm, structure);
+
+ if (transition->propertyTable()) {
+ PropertyTable::iterator iter = transition->propertyTable()->begin();
+ PropertyTable::iterator end = transition->propertyTable()->end();
+ if (iter != end)
+ transition->m_hasReadOnlyOrGetterSetterPropertiesExcludingProto = true;
+ for (; iter != end; ++iter)
+ iter->attributes |= iter->attributes & Accessor ? DontDelete : (DontDelete | ReadOnly);
+ }
+
+ transition->checkOffsetConsistency();
+ return transition;
+}
+
+// In future we may want to cache this transition.
+Structure* Structure::preventExtensionsTransition(VM& vm, Structure* structure)
+{
+ Structure* transition = create(vm, structure);
+
+ // Don't set m_offset, as one can not transition to this.
+
+ structure->materializePropertyMapIfNecessary(vm);
+ transition->propertyTable().set(vm, transition, structure->copyPropertyTableForPinning(vm, transition));
+ transition->m_offset = structure->m_offset;
+ transition->m_preventExtensions = true;
+ transition->pin();
+
+ transition->checkOffsetConsistency();
+ return transition;
+}
+
+PropertyTable* Structure::takePropertyTableOrCloneIfPinned(VM& vm, Structure* owner)
+{
+ materializePropertyMapIfNecessaryForPinning(vm);
+ if (m_isPinnedPropertyTable)
+ return propertyTable()->copy(vm, owner, propertyTable()->size() + 1);
+ PropertyTable* takenPropertyTable = propertyTable().get();
+ propertyTable().clear();
+ return takenPropertyTable;
+}
+
+Structure* Structure::nonPropertyTransition(VM& vm, Structure* structure, NonPropertyTransition transitionKind)
+{
+ unsigned attributes = toAttributes(transitionKind);
+ IndexingType indexingType = newIndexingType(structure->indexingTypeIncludingHistory(), transitionKind);
+
+ if (JSGlobalObject* globalObject = structure->m_globalObject.get()) {
+ if (globalObject->isOriginalArrayStructure(structure)) {
+ Structure* result = globalObject->originalArrayStructureForIndexingType(indexingType);
+ if (result->indexingTypeIncludingHistory() == indexingType) {
+ structure->notifyTransitionFromThisStructure();
+ return result;
+ }
+ }
+ }
+
+ if (Structure* existingTransition = structure->m_transitionTable.get(0, attributes)) {
+ ASSERT(existingTransition->m_attributesInPrevious == attributes);
+ ASSERT(existingTransition->indexingTypeIncludingHistory() == indexingType);
+ return existingTransition;
+ }