Changeset 170215 in webkit
- Timestamp:
- Jun 20, 2014, 3:27:36 PM (11 years ago)
- Location:
- branches/ftlopt/Source/JavaScriptCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ftlopt/Source/JavaScriptCore/ChangeLog
r170161 r170215 1 2014-06-20 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 Merge r169903 to the branch. 4 5 2014-06-12 Mark Hahnenberg <mhahnenberg@apple.com> 6 7 Move structureHasRareData out of TypeInfo 8 https://bugs.webkit.org/show_bug.cgi?id=133800 9 10 Reviewed by Andreas Kling. 11 12 StructureHasRareData was originally put in TypeInfo to avoid making Structure bigger, 13 but we have a few spare bits in Structure so it would be nice to remove this hack. 14 15 * runtime/JSTypeInfo.h: 16 (JSC::TypeInfo::newImpurePropertyFiresWatchpoints): 17 (JSC::TypeInfo::structureHasRareData): Deleted. 18 * runtime/Structure.cpp: 19 (JSC::Structure::Structure): 20 (JSC::Structure::allocateRareData): 21 (JSC::Structure::cloneRareDataFrom): 22 * runtime/Structure.h: 23 (JSC::Structure::previousID): 24 (JSC::Structure::objectToStringValue): 25 (JSC::Structure::setObjectToStringValue): 26 (JSC::Structure::setPreviousID): 27 (JSC::Structure::clearPreviousID): 28 (JSC::Structure::previous): 29 (JSC::Structure::rareData): 30 * runtime/StructureInlines.h: 31 (JSC::Structure::setEnumerationCache): 32 (JSC::Structure::enumerationCache): 33 1 34 2014-06-19 Filip Pizlo <fpizlo@apple.com> 2 35 -
branches/ftlopt/Source/JavaScriptCore/runtime/JSTypeInfo.h
r170129 r170215 50 50 static const unsigned HasImpureGetOwnPropertySlot = 1 << 10; 51 51 static const unsigned NewImpurePropertyFiresWatchpoints = 1 << 11; 52 static const unsigned StructureHasRareData = 1 << 12; 53 static const unsigned StructureIsImmortal = 1 << 13; 52 static const unsigned StructureIsImmortal = 1 << 12; 54 53 55 54 class TypeInfo { … … 96 95 bool hasImpureGetOwnPropertySlot() const { return isSetOnFlags2(HasImpureGetOwnPropertySlot); } 97 96 bool newImpurePropertyFiresWatchpoints() const { return isSetOnFlags2(NewImpurePropertyFiresWatchpoints); } 98 bool structureHasRareData() const { return isSetOnFlags2(StructureHasRareData); }99 97 bool structureIsImmortal() const { return isSetOnFlags2(StructureIsImmortal); } 100 98 -
branches/ftlopt/Source/JavaScriptCore/runtime/Structure.cpp
r170129 r170215 176 176 , m_didTransition(false) 177 177 , m_staticFunctionReified(false) 178 , m_hasRareData(false) 178 179 { 179 180 ASSERT(inlineCapacity <= JSFinalObject::maxInlineCapacity()); 180 181 ASSERT(static_cast<PropertyOffset>(inlineCapacity) < firstOutOfLineOffset); 181 ASSERT(! typeInfo.structureHasRareData());182 ASSERT(!m_hasRareData); 182 183 ASSERT(hasReadOnlyOrGetterSetterPropertiesExcludingProto() || !m_classInfo->hasStaticSetterOrReadonlyProperties(vm)); 183 184 ASSERT(hasGetterSetterProperties() || !m_classInfo->hasStaticSetterOrReadonlyProperties(vm)); … … 203 204 , m_didTransition(false) 204 205 , m_staticFunctionReified(false) 206 , m_hasRareData(false) 205 207 { 206 208 TypeInfo typeInfo = TypeInfo(CellType, OverridesVisitChildren | StructureIsImmortal); … … 229 231 , m_didTransition(true) 230 232 , m_staticFunctionReified(previous->m_staticFunctionReified) 231 { 232 TypeInfo typeInfo = TypeInfo(previous->typeInfo().type(), previous->typeInfo().flags() & ~StructureHasRareData); 233 , m_hasRareData(false) 234 { 235 TypeInfo typeInfo = previous->typeInfo(); 233 236 m_blob = StructureIDBlob(vm.heap.structureIDTable().allocateID(this), previous->indexingTypeIncludingHistory(), typeInfo); 234 237 m_outOfLineTypeFlags = typeInfo.outOfLineTypeFlags(); 235 238 236 239 ASSERT(!previous->typeInfo().structureIsImmortal()); 237 if (previous-> typeInfo().structureHasRareData()&& previous->rareData()->needsCloning())240 if (previous->m_hasRareData && previous->rareData()->needsCloning()) 238 241 cloneRareDataFrom(vm, previous); 239 242 else if (previous->previousID()) … … 780 783 void Structure::allocateRareData(VM& vm) 781 784 { 782 ASSERT(! typeInfo().structureHasRareData());785 ASSERT(!m_hasRareData); 783 786 StructureRareData* rareData = StructureRareData::create(vm, previous()); 784 TypeInfo oldTypeInfo = typeInfo();785 TypeInfo newTypeInfo = TypeInfo(oldTypeInfo.type(), oldTypeInfo.flags() | StructureHasRareData);786 m_outOfLineTypeFlags = newTypeInfo.outOfLineTypeFlags();787 787 m_previousOrRareData.set(vm, this, rareData); 788 ASSERT(typeInfo().structureHasRareData()); 788 m_hasRareData = true; 789 ASSERT(m_hasRareData); 789 790 } 790 791 791 792 void Structure::cloneRareDataFrom(VM& vm, const Structure* other) 792 793 { 793 ASSERT(other->typeInfo().structureHasRareData()); 794 ASSERT(!m_hasRareData); 795 ASSERT(other->m_hasRareData); 794 796 StructureRareData* newRareData = StructureRareData::clone(vm, other->rareData()); 795 TypeInfo oldTypeInfo = typeInfo();796 TypeInfo newTypeInfo = TypeInfo(oldTypeInfo.type(), oldTypeInfo.flags() | StructureHasRareData);797 m_outOfLineTypeFlags = newTypeInfo.outOfLineTypeFlags();798 797 m_previousOrRareData.set(vm, this, newRareData); 799 ASSERT(typeInfo().structureHasRareData()); 798 m_hasRareData = true; 799 ASSERT(m_hasRareData); 800 800 } 801 801 -
branches/ftlopt/Source/JavaScriptCore/runtime/Structure.h
r169753 r170215 194 194 { 195 195 ASSERT(structure()->classInfo() == info()); 196 if ( typeInfo().structureHasRareData())196 if (m_hasRareData) 197 197 return rareData()->previousID(); 198 198 return previous(); … … 299 299 JSString* objectToStringValue() 300 300 { 301 if (! typeInfo().structureHasRareData())301 if (!m_hasRareData) 302 302 return 0; 303 303 return rareData()->objectToStringValue(); … … 306 306 void setObjectToStringValue(VM& vm, const JSCell* owner, JSString* value) 307 307 { 308 if (! typeInfo().structureHasRareData())308 if (!m_hasRareData) 309 309 allocateRareData(vm); 310 310 rareData()->setObjectToStringValue(vm, owner, value); … … 456 456 void setPreviousID(VM& vm, Structure* transition, Structure* structure) 457 457 { 458 if ( typeInfo().structureHasRareData())458 if (m_hasRareData) 459 459 rareData()->setPreviousID(vm, transition, structure); 460 460 else … … 464 464 void clearPreviousID() 465 465 { 466 if ( typeInfo().structureHasRareData())466 if (m_hasRareData) 467 467 rareData()->clearPreviousID(); 468 468 else … … 483 483 Structure* previous() const 484 484 { 485 ASSERT(! typeInfo().structureHasRareData());485 ASSERT(!m_hasRareData); 486 486 return static_cast<Structure*>(m_previousOrRareData.get()); 487 487 } … … 489 489 StructureRareData* rareData() const 490 490 { 491 ASSERT( typeInfo().structureHasRareData());491 ASSERT(m_hasRareData); 492 492 return static_cast<StructureRareData*>(m_previousOrRareData.get()); 493 493 } … … 545 545 unsigned m_didTransition : 1; 546 546 unsigned m_staticFunctionReified : 1; 547 bool m_hasRareData : 1; 547 548 }; 548 549 -
branches/ftlopt/Source/JavaScriptCore/runtime/StructureInlines.h
r168373 r170215 136 136 { 137 137 ASSERT(!isDictionary()); 138 if (! typeInfo().structureHasRareData())138 if (!m_hasRareData) 139 139 allocateRareData(vm); 140 140 rareData()->setEnumerationCache(vm, this, enumerationCache); … … 143 143 inline JSPropertyNameIterator* Structure::enumerationCache() 144 144 { 145 if (! typeInfo().structureHasRareData())145 if (!m_hasRareData) 146 146 return 0; 147 147 return rareData()->enumerationCache();
Note:
See TracChangeset
for help on using the changeset viewer.