Changeset 153657 in webkit
- Timestamp:
- Aug 2, 2013, 11:27:51 AM (12 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r153648 r153657 1 2013-08-01 Filip Pizlo <fpizlo@apple.com> 2 3 hasIndexingHeader should be a property of the Structure, not just the IndexingType 4 https://bugs.webkit.org/show_bug.cgi?id=119422 5 6 Reviewed by Oliver Hunt. 7 8 This simplifies some code and also allows Structure to claim that an object 9 has an indexing header even if it doesn't have indexed properties. 10 11 I also changed some calls to use hasIndexedProperties() since in some cases, 12 that's what we actually meant. Currently the two are synonyms. 13 14 * dfg/DFGRepatch.cpp: 15 (JSC::DFG::tryCachePutByID): 16 (JSC::DFG::tryBuildPutByIdList): 17 * dfg/DFGSpeculativeJIT.cpp: 18 (JSC::DFG::SpeculativeJIT::compileAllocatePropertyStorage): 19 (JSC::DFG::SpeculativeJIT::compileReallocatePropertyStorage): 20 * runtime/ButterflyInlines.h: 21 (JSC::Butterfly::create): 22 (JSC::Butterfly::growPropertyStorage): 23 (JSC::Butterfly::growArrayRight): 24 (JSC::Butterfly::resizeArray): 25 * runtime/IndexingType.h: 26 * runtime/JSObject.cpp: 27 (JSC::JSObject::copyButterfly): 28 (JSC::JSObject::visitButterfly): 29 (JSC::JSObject::setPrototype): 30 * runtime/JSObject.h: 31 (JSC::JSObject::setButterfly): 32 * runtime/JSPropertyNameIterator.cpp: 33 (JSC::JSPropertyNameIterator::create): 34 * runtime/Structure.h: 35 (JSC::Structure::hasIndexingHeader): 36 1 37 2013-08-02 Julien Brianceau <jbrianceau@nds.com> 2 38 -
trunk/Source/JavaScriptCore/dfg/DFGRepatch.cpp
r153556 r153657 966 966 // Skip optimizing the case where we need realloc, and the structure has 967 967 // indexing storage. 968 if ( hasIndexingHeader(oldStructure->indexingType()))968 if (oldStructure->hasIndexingHeader()) 969 969 return false; 970 970 … … 1041 1041 // Skip optimizing the case where we need realloc, and the structure has 1042 1042 // indexing storage. 1043 if ( hasIndexingHeader(oldStructure->indexingType()))1043 if (oldStructure->hasIndexingHeader()) 1044 1044 return false; 1045 1045 -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
r153500 r153657 4260 4260 void SpeculativeJIT::compileAllocatePropertyStorage(Node* node) 4261 4261 { 4262 if ( hasIndexingHeader(node->structureTransitionData().previousStructure->indexingType())) {4262 if (node->structureTransitionData().previousStructure->hasIndexingHeader()) { 4263 4263 SpeculateCellOperand base(this, node->child1()); 4264 4264 … … 4303 4303 ASSERT(newSize == node->structureTransitionData().newStructure->outOfLineCapacity() * sizeof(JSValue)); 4304 4304 4305 if ( hasIndexingHeader(node->structureTransitionData().previousStructure->indexingType())) {4305 if (node->structureTransitionData().previousStructure->hasIndexingHeader()) { 4306 4306 SpeculateCellOperand base(this, node->child1()); 4307 4307 -
trunk/Source/JavaScriptCore/runtime/ButterflyInlines.h
r153189 r153657 59 59 return create( 60 60 vm, intendedOwner, 0, structure->outOfLineCapacity(), 61 hasIndexingHeader(structure->indexingType()), IndexingHeader(), 0);61 structure->hasIndexingHeader(), IndexingHeader(), 0); 62 62 } 63 63 … … 97 97 return growPropertyStorage( 98 98 vm, intendedOwner, indexingHeader()->preCapacity(structure), oldPropertyCapacity, 99 hasIndexingHeader(structure->indexingType()),99 structure->hasIndexingHeader(), 100 100 indexingHeader()->indexingPayloadSizeInBytes(structure), newPropertyCapacity); 101 101 } … … 130 130 { 131 131 ASSERT_UNUSED(oldStructure, !indexingHeader()->preCapacity(oldStructure)); 132 ASSERT_UNUSED(oldStructure, hadIndexingHeader == hasIndexingHeader(oldStructure->indexingType()));132 ASSERT_UNUSED(oldStructure, hadIndexingHeader == oldStructure->hasIndexingHeader()); 133 133 void* theBase = base(0, propertyCapacity); 134 134 size_t oldSize = totalSize(0, propertyCapacity, hadIndexingHeader, oldIndexingPayloadSizeInBytes); … … 145 145 return growArrayRight( 146 146 vm, intendedOwner, oldStructure, oldStructure->outOfLineCapacity(), 147 hasIndexingHeader(oldStructure->indexingType()), 148 indexingHeader()->indexingPayloadSizeInBytes(oldStructure), newIndexingPayloadSizeInBytes); 147 oldStructure->hasIndexingHeader(), 148 indexingHeader()->indexingPayloadSizeInBytes(oldStructure), 149 newIndexingPayloadSizeInBytes); 149 150 } 150 151 … … 172 173 size_t newIndexingPayloadSizeInBytes) 173 174 { 174 bool hasIndexingHeader = JSC::hasIndexingHeader(structure->indexingType());175 bool hasIndexingHeader = structure->hasIndexingHeader(); 175 176 return resizeArray( 176 177 vm, intendedOwner, structure->outOfLineCapacity(), hasIndexingHeader, -
trunk/Source/JavaScriptCore/runtime/IndexingType.h
r149304 r153657 102 102 } 103 103 104 static inline bool hasIndexingHeader(IndexingType type)105 {106 return hasIndexedProperties(type);107 }108 109 104 static inline bool hasUndecided(IndexingType indexingType) 110 105 { -
trunk/Source/JavaScriptCore/runtime/JSObject.cpp
r153556 r153657 103 103 size_t preCapacity; 104 104 size_t indexingPayloadSizeInBytes; 105 bool hasIndexingHeader = JSC::hasIndexingHeader(structure->indexingType());105 bool hasIndexingHeader = structure->hasIndexingHeader(); 106 106 if (UNLIKELY(hasIndexingHeader)) { 107 107 preCapacity = butterfly->indexingHeader()->preCapacity(structure); … … 149 149 break; 150 150 } 151 151 152 default: 152 CRASH();153 153 currentTarget = 0; 154 154 currentSource = 0; … … 174 174 size_t preCapacity; 175 175 size_t indexingPayloadSizeInBytes; 176 bool hasIndexingHeader = JSC::hasIndexingHeader(structure->indexingType());176 bool hasIndexingHeader = structure->hasIndexingHeader(); 177 177 if (UNLIKELY(hasIndexingHeader)) { 178 178 preCapacity = butterfly->indexingHeader()->preCapacity(structure); … … 1147 1147 } 1148 1148 1149 if (!hasIndex ingHeader(structure()->indexingType()))1149 if (!hasIndexedProperties(structure()->indexingType())) 1150 1150 return; 1151 1151 -
trunk/Source/JavaScriptCore/runtime/JSObject.h
r153556 r153657 1108 1108 { 1109 1109 ASSERT(structure); 1110 ASSERT(!butterfly == (!structure->outOfLineCapacity() && ! hasIndexingHeader(structure->indexingType())));1110 ASSERT(!butterfly == (!structure->outOfLineCapacity() && !structure->hasIndexingHeader())); 1111 1111 setStructure(vm, structure); 1112 1112 m_butterfly = butterfly; -
trunk/Source/JavaScriptCore/runtime/JSPropertyNameIterator.cpp
r148696 r153657 66 66 return jsPropertyNameIterator; 67 67 68 if (hasIndex ingHeader(o->structure()->indexingType()))68 if (hasIndexedProperties(o->structure()->indexingType())) 69 69 return jsPropertyNameIterator; 70 70 -
trunk/Source/JavaScriptCore/runtime/Structure.h
r153296 r153657 228 228 && (offset < m_inlineCapacity || offset >= firstOutOfLineOffset); 229 229 } 230 231 bool hasIndexingHeader() const 232 { 233 return hasIndexedProperties(indexingType()); 234 } 230 235 231 236 bool masqueradesAsUndefined(JSGlobalObject* lexicalGlobalObject);
Note:
See TracChangeset
for help on using the changeset viewer.