Structure::Structure(VM& vm, Structure* previous) : JSCell(vm, vm.structureStructure.get()) , m_prototype(vm, this, previous->storedPrototype()) , m_classInfo(previous->m_classInfo) , m_transitionWatchpointSet(IsWatched) , m_offset(invalidOffset) , m_inlineCapacity(previous->m_inlineCapacity) , m_bitField(0) { setDictionaryKind(previous->dictionaryKind()); setIsPinnedPropertyTable(previous->hasBeenFlattenedBefore()); setHasGetterSetterProperties(previous->hasGetterSetterProperties()); setHasCustomGetterSetterProperties(previous->hasCustomGetterSetterProperties()); setHasReadOnlyOrGetterSetterPropertiesExcludingProto(previous->hasReadOnlyOrGetterSetterPropertiesExcludingProto()); setHasNonEnumerableProperties(previous->hasNonEnumerableProperties()); setAttributesInPrevious(0); setPreventExtensions(previous->preventExtensions()); setDidTransition(true); setStaticFunctionsReified(previous->staticFunctionsReified()); setHasRareData(false); TypeInfo typeInfo = previous->typeInfo(); m_blob = StructureIDBlob(vm.heap.structureIDTable().allocateID(this), previous->indexingTypeIncludingHistory(), typeInfo); m_outOfLineTypeFlags = typeInfo.outOfLineTypeFlags(); ASSERT(!previous->typeInfo().structureIsImmortal()); setPreviousID(vm, previous); previous->didTransitionFromThisStructure(); if (previous->m_globalObject) m_globalObject.set(vm, this, previous->m_globalObject.get()); ASSERT(hasReadOnlyOrGetterSetterPropertiesExcludingProto() || !m_classInfo->hasStaticSetterOrReadonlyProperties()); ASSERT(hasGetterSetterProperties() || !m_classInfo->hasStaticSetterOrReadonlyProperties()); }
Structure::Structure(VM& vm, JSGlobalObject* globalObject, JSValue prototype, const TypeInfo& typeInfo, const ClassInfo* classInfo, IndexingType indexingType, unsigned inlineCapacity) : JSCell(vm, vm.structureStructure.get()) , m_blob(vm.heap.structureIDTable().allocateID(this), indexingType, typeInfo) , m_outOfLineTypeFlags(typeInfo.outOfLineTypeFlags()) , m_globalObject(vm, this, globalObject, WriteBarrier<JSGlobalObject>::MayBeNull) , m_prototype(vm, this, prototype) , m_classInfo(classInfo) , m_transitionWatchpointSet(IsWatched) , m_offset(invalidOffset) , m_inlineCapacity(inlineCapacity) , m_bitField(0) { setDictionaryKind(NoneDictionaryKind); setIsPinnedPropertyTable(false); setHasGetterSetterProperties(classInfo->hasStaticSetterOrReadonlyProperties()); setHasCustomGetterSetterProperties(false); setHasReadOnlyOrGetterSetterPropertiesExcludingProto(classInfo->hasStaticSetterOrReadonlyProperties()); setHasNonEnumerableProperties(false); setAttributesInPrevious(0); setPreventExtensions(false); setDidTransition(false); setStaticFunctionsReified(false); setHasRareData(false); ASSERT(inlineCapacity <= JSFinalObject::maxInlineCapacity()); ASSERT(static_cast<PropertyOffset>(inlineCapacity) < firstOutOfLineOffset); ASSERT(!hasRareData()); ASSERT(hasReadOnlyOrGetterSetterPropertiesExcludingProto() || !m_classInfo->hasStaticSetterOrReadonlyProperties()); ASSERT(hasGetterSetterProperties() || !m_classInfo->hasStaticSetterOrReadonlyProperties()); }
Structure::Structure(VM& vm) : JSCell(CreatingEarlyCell) , m_prototype(vm, this, jsNull()) , m_classInfo(info()) , m_transitionWatchpointSet(IsWatched) , m_offset(invalidOffset) , m_inlineCapacity(0) , m_bitField(0) { setDictionaryKind(NoneDictionaryKind); setIsPinnedPropertyTable(false); setHasGetterSetterProperties(m_classInfo->hasStaticSetterOrReadonlyProperties()); setHasCustomGetterSetterProperties(false); setHasReadOnlyOrGetterSetterPropertiesExcludingProto(m_classInfo->hasStaticSetterOrReadonlyProperties()); setHasNonEnumerableProperties(false); setAttributesInPrevious(0); setPreventExtensions(false); setDidTransition(false); setStaticFunctionsReified(false); setHasRareData(false); TypeInfo typeInfo = TypeInfo(CellType, StructureIsImmortal); m_blob = StructureIDBlob(vm.heap.structureIDTable().allocateID(this), 0, typeInfo); m_outOfLineTypeFlags = typeInfo.outOfLineTypeFlags(); ASSERT(hasReadOnlyOrGetterSetterPropertiesExcludingProto() || !m_classInfo->hasStaticSetterOrReadonlyProperties()); ASSERT(hasGetterSetterProperties() || !m_classInfo->hasStaticSetterOrReadonlyProperties()); }
Structure::Structure(VM& vm, Structure* previous, DeferredStructureTransitionWatchpointFire* deferred) : JSCell(vm, vm.structureStructure.get()) , m_prototype(vm, this, previous->storedPrototype()) , m_classInfo(previous->m_classInfo) , m_transitionWatchpointSet(IsWatched) , m_offset(invalidOffset) , m_inlineCapacity(previous->m_inlineCapacity) , m_bitField(0) { setDictionaryKind(previous->dictionaryKind()); setIsPinnedPropertyTable(previous->hasBeenFlattenedBefore()); setHasGetterSetterProperties(previous->hasGetterSetterProperties()); setHasCustomGetterSetterProperties(previous->hasCustomGetterSetterProperties()); setHasReadOnlyOrGetterSetterPropertiesExcludingProto(previous->hasReadOnlyOrGetterSetterPropertiesExcludingProto()); setIsQuickPropertyAccessAllowedForEnumeration(previous->isQuickPropertyAccessAllowedForEnumeration()); setAttributesInPrevious(0); setDidPreventExtensions(previous->didPreventExtensions()); setDidTransition(true); setStaticPropertiesReified(previous->staticPropertiesReified()); setHasBeenDictionary(previous->hasBeenDictionary()); TypeInfo typeInfo = previous->typeInfo(); m_blob = StructureIDBlob(vm.heap.structureIDTable().allocateID(this), previous->indexingTypeIncludingHistory(), typeInfo); m_outOfLineTypeFlags = typeInfo.outOfLineTypeFlags(); ASSERT(!previous->typeInfo().structureIsImmortal()); setPreviousID(vm, previous); previous->didTransitionFromThisStructure(deferred); // Copy this bit now, in case previous was being watched. setTransitionWatchpointIsLikelyToBeFired(previous->transitionWatchpointIsLikelyToBeFired()); if (previous->m_globalObject) m_globalObject.set(vm, this, previous->m_globalObject.get()); ASSERT(hasReadOnlyOrGetterSetterPropertiesExcludingProto() || !m_classInfo->hasStaticSetterOrReadonlyProperties()); ASSERT(hasGetterSetterProperties() || !m_classInfo->hasStaticSetterOrReadonlyProperties()); }