Changeset 169903 in webkit
- Timestamp:
- Jun 12, 2014, 11:22:46 AM (12 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 5 edited
-
ChangeLog (modified) (1 diff)
-
runtime/JSTypeInfo.h (modified) (2 diffs)
-
runtime/Structure.cpp (modified) (4 diffs)
-
runtime/Structure.h (modified) (8 diffs)
-
runtime/StructureInlines.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r169889 r169903 1 2014-06-12 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 Move structureHasRareData out of TypeInfo 4 https://bugs.webkit.org/show_bug.cgi?id=133800 5 6 Reviewed by Andreas Kling. 7 8 StructureHasRareData was originally put in TypeInfo to avoid making Structure bigger, 9 but we have a few spare bits in Structure so it would be nice to remove this hack. 10 11 * runtime/JSTypeInfo.h: 12 (JSC::TypeInfo::newImpurePropertyFiresWatchpoints): 13 (JSC::TypeInfo::structureHasRareData): Deleted. 14 * runtime/Structure.cpp: 15 (JSC::Structure::Structure): 16 (JSC::Structure::allocateRareData): 17 (JSC::Structure::cloneRareDataFrom): 18 * runtime/Structure.h: 19 (JSC::Structure::previousID): 20 (JSC::Structure::objectToStringValue): 21 (JSC::Structure::setObjectToStringValue): 22 (JSC::Structure::setPreviousID): 23 (JSC::Structure::clearPreviousID): 24 (JSC::Structure::previous): 25 (JSC::Structure::rareData): 26 * runtime/StructureInlines.h: 27 (JSC::Structure::setEnumerationCache): 28 (JSC::Structure::enumerationCache): 29 1 30 2014-06-12 Zsolt Borbely <zsborbely.u-szeged@partner.samsung.com> 2 31 -
trunk/Source/JavaScriptCore/runtime/JSTypeInfo.h
r165676 r169903 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 { … … 97 96 bool hasImpureGetOwnPropertySlot() const { return isSetOnFlags2(HasImpureGetOwnPropertySlot); } 98 97 bool newImpurePropertyFiresWatchpoints() const { return isSetOnFlags2(NewImpurePropertyFiresWatchpoints); } 99 bool structureHasRareData() const { return isSetOnFlags2(StructureHasRareData); }100 98 bool structureIsImmortal() const { return isSetOnFlags2(StructureIsImmortal); } 101 99 -
trunk/Source/JavaScriptCore/runtime/Structure.cpp
r169853 r169903 170 170 , m_didTransition(false) 171 171 , m_staticFunctionReified(false) 172 , m_hasRareData(false) 172 173 { 173 174 ASSERT(inlineCapacity <= JSFinalObject::maxInlineCapacity()); 174 175 ASSERT(static_cast<PropertyOffset>(inlineCapacity) < firstOutOfLineOffset); 175 ASSERT(! typeInfo.structureHasRareData());176 ASSERT(!m_hasRareData); 176 177 ASSERT(hasReadOnlyOrGetterSetterPropertiesExcludingProto() || !m_classInfo->hasStaticSetterOrReadonlyProperties(vm)); 177 178 ASSERT(hasGetterSetterProperties() || !m_classInfo->hasStaticSetterOrReadonlyProperties(vm)); … … 199 200 , m_didTransition(false) 200 201 , m_staticFunctionReified(false) 202 , m_hasRareData(false) 201 203 { 202 204 TypeInfo typeInfo = TypeInfo(CompoundType, OverridesVisitChildren | StructureIsImmortal); … … 227 229 , m_didTransition(true) 228 230 , m_staticFunctionReified(previous->m_staticFunctionReified) 229 { 230 TypeInfo typeInfo = TypeInfo(previous->typeInfo().type(), previous->typeInfo().flags() & ~StructureHasRareData); 231 , m_hasRareData(false) 232 { 233 TypeInfo typeInfo = previous->typeInfo(); 231 234 m_blob = StructureIDBlob(vm.heap.structureIDTable().allocateID(this), previous->indexingTypeIncludingHistory(), typeInfo); 232 235 m_outOfLineTypeFlags = typeInfo.outOfLineTypeFlags(); 233 236 234 237 ASSERT(!previous->typeInfo().structureIsImmortal()); 235 if (previous-> typeInfo().structureHasRareData()&& previous->rareData()->needsCloning())238 if (previous->m_hasRareData && previous->rareData()->needsCloning()) 236 239 cloneRareDataFrom(vm, previous); 237 240 setPreviousID(vm, this, previous); … … 791 794 void Structure::allocateRareData(VM& vm) 792 795 { 793 ASSERT(! typeInfo().structureHasRareData());796 ASSERT(!m_hasRareData); 794 797 StructureRareData* rareData = StructureRareData::create(vm, previous()); 795 TypeInfo oldTypeInfo = typeInfo();796 TypeInfo newTypeInfo = TypeInfo(oldTypeInfo.type(), oldTypeInfo.flags() | StructureHasRareData);797 m_outOfLineTypeFlags = newTypeInfo.outOfLineTypeFlags();798 798 m_previousOrRareData.set(vm, this, rareData); 799 ASSERT(typeInfo().structureHasRareData()); 799 m_hasRareData = true; 800 ASSERT(m_hasRareData); 800 801 } 801 802 802 803 void Structure::cloneRareDataFrom(VM& vm, const Structure* other) 803 804 { 804 ASSERT(other->typeInfo().structureHasRareData()); 805 ASSERT(!m_hasRareData); 806 ASSERT(other->m_hasRareData); 805 807 StructureRareData* newRareData = StructureRareData::clone(vm, other->rareData()); 806 TypeInfo oldTypeInfo = typeInfo();807 TypeInfo newTypeInfo = TypeInfo(oldTypeInfo.type(), oldTypeInfo.flags() | StructureHasRareData);808 m_outOfLineTypeFlags = newTypeInfo.outOfLineTypeFlags();809 808 m_previousOrRareData.set(vm, this, newRareData); 810 ASSERT(typeInfo().structureHasRareData()); 809 m_hasRareData = true; 810 ASSERT(m_hasRareData); 811 811 } 812 812 -
trunk/Source/JavaScriptCore/runtime/Structure.h
r169853 r169903 197 197 { 198 198 ASSERT(structure()->classInfo() == info()); 199 if ( typeInfo().structureHasRareData())199 if (m_hasRareData) 200 200 return rareData()->previousID(); 201 201 return previous(); … … 306 306 JSString* objectToStringValue() 307 307 { 308 if (! typeInfo().structureHasRareData())308 if (!m_hasRareData) 309 309 return 0; 310 310 return rareData()->objectToStringValue(); … … 313 313 void setObjectToStringValue(VM& vm, const JSCell* owner, JSString* value) 314 314 { 315 if (! typeInfo().structureHasRareData())315 if (!m_hasRareData) 316 316 allocateRareData(vm); 317 317 rareData()->setObjectToStringValue(vm, owner, value); … … 459 459 void setPreviousID(VM& vm, Structure* transition, Structure* structure) 460 460 { 461 if ( typeInfo().structureHasRareData())461 if (m_hasRareData) 462 462 rareData()->setPreviousID(vm, transition, structure); 463 463 else … … 467 467 void clearPreviousID() 468 468 { 469 if ( typeInfo().structureHasRareData())469 if (m_hasRareData) 470 470 rareData()->clearPreviousID(); 471 471 else … … 486 486 Structure* previous() const 487 487 { 488 ASSERT(! typeInfo().structureHasRareData());488 ASSERT(!m_hasRareData); 489 489 return static_cast<Structure*>(m_previousOrRareData.get()); 490 490 } … … 492 492 StructureRareData* rareData() const 493 493 { 494 ASSERT( typeInfo().structureHasRareData());494 ASSERT(m_hasRareData); 495 495 return static_cast<StructureRareData*>(m_previousOrRareData.get()); 496 496 } … … 550 550 unsigned m_didTransition : 1; 551 551 unsigned m_staticFunctionReified : 1; 552 bool m_hasRareData : 1; 552 553 }; 553 554 -
trunk/Source/JavaScriptCore/runtime/StructureInlines.h
r169823 r169903 155 155 { 156 156 ASSERT(!isDictionary()); 157 if (! typeInfo().structureHasRareData())157 if (!m_hasRareData) 158 158 allocateRareData(vm); 159 159 rareData()->setEnumerationCache(vm, this, enumerationCache); … … 162 162 inline JSPropertyNameIterator* Structure::enumerationCache() 163 163 { 164 if (! typeInfo().structureHasRareData())164 if (!m_hasRareData) 165 165 return 0; 166 166 return rareData()->enumerationCache();
Note:
See TracChangeset
for help on using the changeset viewer.