- , m_anonymousSlotCount(anonymousSlotCount)
-{
- ASSERT(m_prototype);
- ASSERT(m_prototype.isObject() || m_prototype.isNull());
-
-#ifndef NDEBUG
-#if ENABLE(JSC_MULTIPLE_THREADS)
- MutexLocker protect(ignoreSetMutex);
-#endif
- if (shouldIgnoreLeaks)
- ignoreSet.add(this);
- else
- structureCounter.increment();
-#endif
-
-#if DUMP_STRUCTURE_ID_STATISTICS
- liveStructureSet.add(this);
-#endif
-}
-
-Structure::~Structure()
-{
- if (m_previous) {
- ASSERT(m_nameInPrevious);
- m_previous->table.remove(make_pair(m_nameInPrevious.get(), m_attributesInPrevious), m_specificValueInPrevious);
-
- }
-
- if (m_enumerationCache)
- m_enumerationCache->setCachedStructure(0);
-
- if (m_propertyTable) {
- unsigned entryCount = m_propertyTable->keyCount + m_propertyTable->deletedSentinelCount;
- for (unsigned i = 1; i <= entryCount; i++) {
- if (UString::Rep* key = m_propertyTable->entries()[i].key)
- key->deref();
- }
-
- delete m_propertyTable->deletedOffsets;
- fastFree(m_propertyTable);
- }
-
-#ifndef NDEBUG
-#if ENABLE(JSC_MULTIPLE_THREADS)
- MutexLocker protect(ignoreSetMutex);
-#endif
- HashSet<Structure*>::iterator it = ignoreSet.find(this);
- if (it != ignoreSet.end())
- ignoreSet.remove(it);
- else
- structureCounter.decrement();
-#endif
-
-#if DUMP_STRUCTURE_ID_STATISTICS
- liveStructureSet.remove(this);
-#endif
-}
-
-void Structure::startIgnoringLeaks()
-{
-#ifndef NDEBUG
- shouldIgnoreLeaks = true;
-#endif
-}
-
-void Structure::stopIgnoringLeaks()
-{
-#ifndef NDEBUG
- shouldIgnoreLeaks = false;
-#endif
-}
-
-static bool isPowerOf2(unsigned v)
+ , m_preventExtensions(false)
+ , m_didTransition(false)
+ , m_staticFunctionReified(false)
+{
+ ASSERT(inlineCapacity <= JSFinalObject::maxInlineCapacity());
+ ASSERT(static_cast<PropertyOffset>(inlineCapacity) < firstOutOfLineOffset);
+ ASSERT(!typeInfo.structureHasRareData());
+}
+
+const ClassInfo Structure::s_info = { "Structure", 0, 0, 0, CREATE_METHOD_TABLE(Structure) };
+
+Structure::Structure(VM& vm)
+ : JSCell(CreatingEarlyCell)
+ , m_prototype(vm, this, jsNull())
+ , m_classInfo(&s_info)
+ , m_transitionWatchpointSet(InitializedWatching)
+ , m_offset(invalidOffset)
+ , m_typeInfo(CompoundType, OverridesVisitChildren)
+ , m_indexingType(0)
+ , m_inlineCapacity(0)
+ , m_dictionaryKind(NoneDictionaryKind)
+ , m_isPinnedPropertyTable(false)
+ , m_hasGetterSetterProperties(false)
+ , m_hasReadOnlyOrGetterSetterPropertiesExcludingProto(false)
+ , m_hasNonEnumerableProperties(false)
+ , m_attributesInPrevious(0)
+ , m_specificFunctionThrashCount(0)
+ , m_preventExtensions(false)
+ , m_didTransition(false)
+ , m_staticFunctionReified(false)
+{
+}
+
+Structure::Structure(VM& vm, const Structure* previous)
+ : JSCell(vm, vm.structureStructure.get())
+ , m_prototype(vm, this, previous->storedPrototype())
+ , m_classInfo(previous->m_classInfo)
+ , m_transitionWatchpointSet(InitializedWatching)
+ , m_offset(invalidOffset)
+ , m_typeInfo(previous->typeInfo().type(), previous->typeInfo().flags() & ~StructureHasRareData)
+ , m_indexingType(previous->indexingTypeIncludingHistory())
+ , m_inlineCapacity(previous->m_inlineCapacity)
+ , m_dictionaryKind(previous->m_dictionaryKind)
+ , m_isPinnedPropertyTable(false)
+ , m_hasGetterSetterProperties(previous->m_hasGetterSetterProperties)
+ , m_hasReadOnlyOrGetterSetterPropertiesExcludingProto(previous->m_hasReadOnlyOrGetterSetterPropertiesExcludingProto)
+ , m_hasNonEnumerableProperties(previous->m_hasNonEnumerableProperties)
+ , m_attributesInPrevious(0)
+ , m_specificFunctionThrashCount(previous->m_specificFunctionThrashCount)
+ , m_preventExtensions(previous->m_preventExtensions)
+ , m_didTransition(true)
+ , m_staticFunctionReified(previous->m_staticFunctionReified)