+ transition->checkOffsetConsistency();
+ return transition;
+}
+
+PropertyTable* Structure::takePropertyTableOrCloneIfPinned(VM& vm)
+{
+ DeferGC deferGC(vm.heap);
+ materializePropertyMapIfNecessaryForPinning(vm, deferGC);
+
+ if (isPinnedPropertyTable())
+ return propertyTable()->copy(vm, propertyTable()->size() + 1);
+
+ // Hold the lock while stealing the table - so that getConcurrently() on another thread
+ // will either have to bypass this structure, or will get to use the property table
+ // before it is stolen.
+ ConcurrentJITLocker locker(m_lock);
+ 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->didTransitionFromThisStructure();
+ return result;
+ }
+ }
+ }
+
+ Structure* existingTransition;
+ if (!structure->isDictionary() && (existingTransition = structure->m_transitionTable.get(0, attributes))) {
+ ASSERT(existingTransition->attributesInPrevious() == attributes);
+ ASSERT(existingTransition->indexingTypeIncludingHistory() == indexingType);
+ return existingTransition;
+ }
+
+ Structure* transition = create(vm, structure);
+ transition->setAttributesInPrevious(attributes);
+ transition->m_blob.setIndexingType(indexingType);
+ transition->propertyTable().set(vm, transition, structure->takePropertyTableOrCloneIfPinned(vm));
+ transition->m_offset = structure->m_offset;
+ checkOffset(transition->m_offset, transition->inlineCapacity());
+
+ if (structure->isDictionary())
+ transition->pin();
+ else {
+ ConcurrentJITLocker locker(structure->m_lock);
+ structure->m_transitionTable.add(vm, transition);
+ }
+ transition->checkOffsetConsistency();