Changeset 144113 in webkit
- Timestamp:
- Feb 26, 2013 2:57:17 PM (11 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 1 deleted
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/CMakeLists.txt
r144074 r144113 281 281 runtime/PropertyNameArray.cpp 282 282 runtime/PropertySlot.cpp 283 runtime/PropertyTable.cpp284 283 runtime/PrototypeMap.cpp 285 284 runtime/RegExp.cpp -
trunk/Source/JavaScriptCore/ChangeLog
r144111 r144113 1 2013-02-26 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r144074. 4 http://trac.webkit.org/changeset/144074 5 https://bugs.webkit.org/show_bug.cgi?id=110897 6 7 Causing 20+ crashes on Mac (Requested by bradee-oh on 8 #webkit). 9 10 * CMakeLists.txt: 11 * GNUmakefile.list.am: 12 * JavaScriptCore.gypi: 13 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 14 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: 15 * JavaScriptCore.xcodeproj/project.pbxproj: 16 * Target.pri: 17 * runtime/JSGlobalData.cpp: 18 (JSC::JSGlobalData::JSGlobalData): 19 * runtime/JSGlobalData.h: 20 (JSGlobalData): 21 * runtime/PropertyMapHashTable.h: 22 (PropertyTable): 23 (JSC::PropertyTable::PropertyTable): 24 (JSC): 25 (JSC::PropertyTable::~PropertyTable): 26 (JSC::PropertyTable::copy): 27 * runtime/PropertyTable.cpp: Removed. 28 * runtime/Structure.cpp: 29 (JSC::Structure::materializePropertyMap): 30 (JSC::Structure::addPropertyTransition): 31 (JSC::Structure::changePrototypeTransition): 32 (JSC::Structure::despecifyFunctionTransition): 33 (JSC::Structure::attributeChangeTransition): 34 (JSC::Structure::toDictionaryTransition): 35 (JSC::Structure::preventExtensionsTransition): 36 (JSC::Structure::nonPropertyTransition): 37 (JSC::Structure::copyPropertyTable): 38 (JSC::Structure::copyPropertyTableForPinning): 39 (JSC::Structure::putSpecificValue): 40 (JSC::Structure::createPropertyMap): 41 (JSC::Structure::visitChildren): 42 * runtime/Structure.h: 43 (JSC): 44 (JSC::Structure::putWillGrowOutOfLineStorage): 45 (JSC::Structure::checkOffsetConsistency): 46 (Structure): 47 * runtime/StructureInlines.h: 48 1 49 2013-02-26 Roger Fong <roger_fong@apple.com> 2 50 -
trunk/Source/JavaScriptCore/GNUmakefile.list.am
r144074 r144113 723 723 Source/JavaScriptCore/runtime/PropertySlot.cpp \ 724 724 Source/JavaScriptCore/runtime/PropertySlot.h \ 725 Source/JavaScriptCore/runtime/PropertyTable.cpp \726 725 Source/JavaScriptCore/runtime/PrototypeMap.cpp \ 727 726 Source/JavaScriptCore/runtime/PrototypeMap.h \ -
trunk/Source/JavaScriptCore/JavaScriptCore.gypi
r144074 r144113 760 760 'runtime/PropertySlot.cpp', 761 761 'runtime/PropertySlot.h', 762 'runtime/PropertyTable.cpp',763 762 'runtime/PropertyStorage.h', 764 763 'runtime/Protect.h', -
trunk/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
r144074 r144113 1175 1175 </File> 1176 1176 <File 1177 RelativePath="..\..\runtime\PropertyTable.cpp"1178 >1179 </File>1180 <File1181 1177 RelativePath="..\..\runtime\PrototypeMap.cpp" 1182 1178 > -
trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj
r144074 r144113 306 306 <ClCompile Include="..\runtime\PropertyNameArray.cpp" /> 307 307 <ClCompile Include="..\runtime\PropertySlot.cpp" /> 308 <ClCompile Include="..\runtime\PropertyTable.cpp" />309 308 <ClCompile Include="..\runtime\PrototypeMap.cpp" /> 310 309 <ClCompile Include="..\runtime\RegExp.cpp" /> -
trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r144074 r144113 706 706 A7FB61001040C38B0017A286 /* PropertyDescriptor.h in Headers */ = {isa = PBXBuildFile; fileRef = A7FB604B103F5EAB0017A286 /* PropertyDescriptor.h */; settings = {ATTRIBUTES = (Private, ); }; }; 707 707 A8A4748E151A8306004123FF /* libWTF.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A8A4748D151A8306004123FF /* libWTF.a */; }; 708 ADE39FFF16DD144B0003CD4A /* PropertyTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD1CF06816DCAB2D00B97123 /* PropertyTable.cpp */; };709 708 BC02E90D0E1839DB000F9297 /* ErrorConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = BC02E9050E1839DB000F9297 /* ErrorConstructor.h */; }; 710 709 BC02E90F0E1839DB000F9297 /* ErrorPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = BC02E9070E1839DB000F9297 /* ErrorPrototype.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 1624 1623 A8E894310CD0602400367179 /* JSCallbackObjectFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCallbackObjectFunctions.h; sourceTree = "<group>"; }; 1625 1624 A8E894330CD0603F00367179 /* JSGlobalObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSGlobalObject.h; sourceTree = "<group>"; }; 1626 AD1CF06816DCAB2D00B97123 /* PropertyTable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PropertyTable.cpp; sourceTree = "<group>"; };1627 1625 BC021BF2136900C300FC5467 /* ToolExecutable.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = ToolExecutable.xcconfig; sourceTree = "<group>"; }; 1628 1626 BC02E9040E1839DB000F9297 /* ErrorConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ErrorConstructor.cpp; sourceTree = "<group>"; }; … … 2515 2513 65621E6C089E859700760F35 /* PropertySlot.h */, 2516 2514 0FB7F39015ED8E3800F167B2 /* PropertyStorage.h */, 2517 AD1CF06816DCAB2D00B97123 /* PropertyTable.cpp */,2518 2515 65C02FBB0637462A003E7EE6 /* Protect.h */, 2519 2516 14D844A216AA2C7000A65AF0 /* PrototypeMap.cpp */, … … 4035 4032 0FBE0F7616C1DB0F0082C5E8 /* DFGUnificationPhase.cpp in Sources */, 4036 4033 0F493AFA16D0CAD30084508B /* SourceProvider.cpp in Sources */, 4037 ADE39FFF16DD144B0003CD4A /* PropertyTable.cpp in Sources */,4038 4034 ); 4039 4035 runOnlyForDeploymentPostprocessing = 0; -
trunk/Source/JavaScriptCore/Target.pri
r144074 r144113 299 299 runtime/PropertyNameArray.cpp \ 300 300 runtime/PropertySlot.cpp \ 301 runtime/PropertyTable.cpp \302 301 runtime/PrototypeMap.cpp \ 303 302 runtime/RegExpConstructor.cpp \ -
trunk/Source/JavaScriptCore/runtime/JSGlobalData.cpp
r144074 r144113 233 233 unlinkedEvalCodeBlockStructure.set(*this, UnlinkedEvalCodeBlock::createStructure(*this, 0, jsNull())); 234 234 unlinkedFunctionCodeBlockStructure.set(*this, UnlinkedFunctionCodeBlock::createStructure(*this, 0, jsNull())); 235 propertyTableStructure.set(*this, PropertyTable::createStructure(*this, 0, jsNull()));236 235 smallStrings.initializeCommonStrings(*this); 237 236 -
trunk/Source/JavaScriptCore/runtime/JSGlobalData.h
r144074 r144113 257 257 Strong<Structure> unlinkedEvalCodeBlockStructure; 258 258 Strong<Structure> unlinkedFunctionCodeBlockStructure; 259 Strong<Structure> propertyTableStructure;260 259 261 260 IdentifierTable* identifierTable; -
trunk/Source/JavaScriptCore/runtime/PropertyMapHashTable.h
r144074 r144113 23 23 24 24 #include "PropertyOffset.h" 25 #include "Structure.h"26 25 #include "WriteBarrier.h" 27 26 #include <wtf/HashTable.h> … … 87 86 }; 88 87 89 class PropertyTable : public JSCell { 88 class PropertyTable { 89 WTF_MAKE_FAST_ALLOCATED; 90 90 91 91 // This is the implementation for 'iterator' and 'const_iterator', … … 130 130 131 131 public: 132 static const bool needsDestruction = true;133 static const bool hasImmortalStructure = true;134 static void destroy(JSCell*);135 136 static JS_EXPORTDATA const ClassInfo s_info;137 138 static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype)139 {140 return Structure::create(globalData, globalObject, prototype, TypeInfo(CompoundType, OverridesVisitChildren), &s_info);141 }142 143 static void visitChildren(JSCell*, SlotVisitor&);144 145 132 typedef StringImpl* KeyType; 146 133 typedef PropertyMapEntry ValueType; … … 156 143 157 144 // Constructor is passed an initial capacity, a PropertyTable to copy, or both. 158 static PropertyTable* create(JSGlobalData&,unsigned initialCapacity);159 static PropertyTable* clone(JSGlobalData&, JSCell* owner, const PropertyTable&);160 static PropertyTable* clone(JSGlobalData&, JSCell* owner, unsigned initialCapacity, const PropertyTable&);145 explicit PropertyTable(unsigned initialCapacity); 146 PropertyTable(JSGlobalData&, JSCell*, const PropertyTable&); 147 PropertyTable(JSGlobalData&, JSCell*, unsigned initialCapacity, const PropertyTable&); 161 148 ~PropertyTable(); 162 149 … … 195 182 196 183 // Copy this PropertyTable, ensuring the copy has at least the capacity provided. 197 P ropertyTable*copy(JSGlobalData&, JSCell* owner, unsigned newCapacity);184 PassOwnPtr<PropertyTable> copy(JSGlobalData&, JSCell* owner, unsigned newCapacity); 198 185 199 186 #ifndef NDEBUG … … 203 190 204 191 private: 205 PropertyTable(JSGlobalData&, unsigned initialCapacity);206 PropertyTable(JSGlobalData&, JSCell*, const PropertyTable&);207 PropertyTable(JSGlobalData&, JSCell*, unsigned initialCapacity, const PropertyTable&);208 209 192 PropertyTable(const PropertyTable&); 210 193 // Used to insert a value known not to be in the table, and where we know capacity to be available. … … 257 240 }; 258 241 242 inline PropertyTable::PropertyTable(unsigned initialCapacity) 243 : m_indexSize(sizeForCapacity(initialCapacity)) 244 , m_indexMask(m_indexSize - 1) 245 , m_index(static_cast<unsigned*>(fastZeroedMalloc(dataSize()))) 246 , m_keyCount(0) 247 , m_deletedCount(0) 248 { 249 ASSERT(isPowerOf2(m_indexSize)); 250 } 251 252 inline PropertyTable::PropertyTable(JSGlobalData&, JSCell* owner, const PropertyTable& other) 253 : m_indexSize(other.m_indexSize) 254 , m_indexMask(other.m_indexMask) 255 , m_index(static_cast<unsigned*>(fastMalloc(dataSize()))) 256 , m_keyCount(other.m_keyCount) 257 , m_deletedCount(other.m_deletedCount) 258 { 259 ASSERT(isPowerOf2(m_indexSize)); 260 261 memcpy(m_index, other.m_index, dataSize()); 262 263 iterator end = this->end(); 264 for (iterator iter = begin(); iter != end; ++iter) { 265 iter->key->ref(); 266 Heap::writeBarrier(owner, iter->specificValue.get()); 267 } 268 269 // Copy the m_deletedOffsets vector. 270 Vector<PropertyOffset>* otherDeletedOffsets = other.m_deletedOffsets.get(); 271 if (otherDeletedOffsets) 272 m_deletedOffsets = adoptPtr(new Vector<PropertyOffset>(*otherDeletedOffsets)); 273 } 274 275 inline PropertyTable::PropertyTable(JSGlobalData&, JSCell* owner, unsigned initialCapacity, const PropertyTable& other) 276 : m_indexSize(sizeForCapacity(initialCapacity)) 277 , m_indexMask(m_indexSize - 1) 278 , m_index(static_cast<unsigned*>(fastZeroedMalloc(dataSize()))) 279 , m_keyCount(0) 280 , m_deletedCount(0) 281 { 282 ASSERT(isPowerOf2(m_indexSize)); 283 ASSERT(initialCapacity >= other.m_keyCount); 284 285 const_iterator end = other.end(); 286 for (const_iterator iter = other.begin(); iter != end; ++iter) { 287 ASSERT(canInsert()); 288 reinsert(*iter); 289 iter->key->ref(); 290 Heap::writeBarrier(owner, iter->specificValue.get()); 291 } 292 293 // Copy the m_deletedOffsets vector. 294 Vector<PropertyOffset>* otherDeletedOffsets = other.m_deletedOffsets.get(); 295 if (otherDeletedOffsets) 296 m_deletedOffsets = adoptPtr(new Vector<PropertyOffset>(*otherDeletedOffsets)); 297 } 298 299 inline PropertyTable::~PropertyTable() 300 { 301 iterator end = this->end(); 302 for (iterator iter = begin(); iter != end; ++iter) 303 iter->key->deref(); 304 305 fastFree(m_index); 306 } 307 259 308 inline PropertyTable::iterator PropertyTable::begin() 260 309 { … … 454 503 } 455 504 456 inline P ropertyTable*PropertyTable::copy(JSGlobalData& globalData, JSCell* owner, unsigned newCapacity)505 inline PassOwnPtr<PropertyTable> PropertyTable::copy(JSGlobalData& globalData, JSCell* owner, unsigned newCapacity) 457 506 { 458 507 ASSERT(newCapacity >= m_keyCount); … … 461 510 // save rehashing all keys. 462 511 if (sizeForCapacity(newCapacity) == m_indexSize) 463 return PropertyTable::clone(globalData, owner, *this);464 return PropertyTable::clone(globalData, owner, newCapacity, *this);512 return adoptPtr(new PropertyTable(globalData, owner, *this)); 513 return adoptPtr(new PropertyTable(globalData, owner, newCapacity, *this)); 465 514 } 466 515 -
trunk/Source/JavaScriptCore/runtime/Structure.cpp
r144074 r144113 248 248 ASSERT(!structure->previousID()); 249 249 250 m_propertyTable .set(globalData, this, structure->m_propertyTable->copy(globalData, 0, numberOfSlotsForLastOffset(m_offset, m_inlineCapacity)));250 m_propertyTable = structure->m_propertyTable->copy(globalData, 0, numberOfSlotsForLastOffset(m_offset, m_inlineCapacity)); 251 251 break; 252 252 } … … 256 256 257 257 if (!m_propertyTable) 258 createPropertyMap( globalData,numberOfSlotsForLastOffset(m_offset, m_inlineCapacity));258 createPropertyMap(numberOfSlotsForLastOffset(m_offset, m_inlineCapacity)); 259 259 260 260 for (ptrdiff_t i = structures.size() - 1; i >= 0; --i) { … … 377 377 structure->checkOffsetConsistency(); 378 378 if (structure->m_isPinnedPropertyTable) 379 transition->m_propertyTable.set(globalData, transition, structure->m_propertyTable->copy(globalData, transition, structure->m_propertyTable->size() + 1)); 380 else { 381 transition->m_propertyTable.set(globalData, transition, structure->m_propertyTable.get()); 382 structure->m_propertyTable.clear(); 383 } 379 transition->m_propertyTable = structure->m_propertyTable->copy(globalData, transition, structure->m_propertyTable->size() + 1); 380 else 381 transition->m_propertyTable = structure->m_propertyTable.release(); 384 382 } else { 385 383 if (structure->previousID()) 386 384 transition->materializePropertyMap(globalData); 387 385 else 388 transition->createPropertyMap( globalData);386 transition->createPropertyMap(); 389 387 } 390 388 transition->m_offset = structure->m_offset; … … 418 416 419 417 structure->materializePropertyMapIfNecessary(globalData); 420 transition->m_propertyTable .set(globalData, transition, structure->copyPropertyTableForPinning(globalData, transition));418 transition->m_propertyTable = structure->copyPropertyTableForPinning(globalData, transition); 421 419 transition->m_offset = structure->m_offset; 422 420 transition->pin(); … … 434 432 435 433 structure->materializePropertyMapIfNecessary(globalData); 436 transition->m_propertyTable .set(globalData, transition, structure->copyPropertyTableForPinning(globalData, transition));434 transition->m_propertyTable = structure->copyPropertyTableForPinning(globalData, transition); 437 435 transition->m_offset = structure->m_offset; 438 436 transition->pin(); … … 455 453 456 454 structure->materializePropertyMapIfNecessary(globalData); 457 transition->m_propertyTable .set(globalData, transition, structure->copyPropertyTableForPinning(globalData, transition));455 transition->m_propertyTable = structure->copyPropertyTableForPinning(globalData, transition); 458 456 transition->m_offset = structure->m_offset; 459 457 transition->pin(); … … 478 476 479 477 structure->materializePropertyMapIfNecessary(globalData); 480 transition->m_propertyTable .set(globalData, transition, structure->copyPropertyTableForPinning(globalData, transition));478 transition->m_propertyTable = structure->copyPropertyTableForPinning(globalData, transition); 481 479 transition->m_offset = structure->m_offset; 482 480 transition->m_dictionaryKind = kind; … … 538 536 539 537 structure->materializePropertyMapIfNecessary(globalData); 540 transition->m_propertyTable .set(globalData, transition, structure->copyPropertyTableForPinning(globalData, transition));538 transition->m_propertyTable = structure->copyPropertyTableForPinning(globalData, transition); 541 539 transition->m_offset = structure->m_offset; 542 540 transition->m_preventExtensions = true; … … 578 576 structure->checkOffsetConsistency(); 579 577 if (structure->m_isPinnedPropertyTable) 580 transition->m_propertyTable.set(globalData, transition, structure->m_propertyTable->copy(globalData, transition, structure->m_propertyTable->size() + 1)); 581 else { 582 transition->m_propertyTable.set(globalData, transition, structure->m_propertyTable.get()); 583 structure->m_propertyTable.clear(); 584 } 578 transition->m_propertyTable = structure->m_propertyTable->copy(globalData, transition, structure->m_propertyTable->size() + 1); 579 else 580 transition->m_propertyTable = structure->m_propertyTable.release(); 585 581 } else { 586 582 if (structure->previousID()) 587 583 transition->materializePropertyMap(globalData); 588 584 else 589 transition->createPropertyMap( globalData);585 transition->createPropertyMap(); 590 586 } 591 587 … … 742 738 #endif 743 739 744 PropertyTable* Structure::copyPropertyTable(JSGlobalData& globalData, Structure* owner) 745 { 746 if (!m_propertyTable) 747 return 0; 748 return PropertyTable::clone(globalData, owner, *m_propertyTable.get()); 749 } 750 751 PropertyTable* Structure::copyPropertyTableForPinning(JSGlobalData& globalData, Structure* owner) 752 { 753 if (m_propertyTable) 754 return PropertyTable::clone(globalData, owner, *m_propertyTable.get()); 755 return PropertyTable::create(globalData, numberOfSlotsForLastOffset(m_offset, m_inlineCapacity)); 740 PassOwnPtr<PropertyTable> Structure::copyPropertyTable(JSGlobalData& globalData, Structure* owner) 741 { 742 return adoptPtr(m_propertyTable ? new PropertyTable(globalData, owner, *m_propertyTable) : 0); 743 } 744 745 PassOwnPtr<PropertyTable> Structure::copyPropertyTableForPinning(JSGlobalData& globalData, Structure* owner) 746 { 747 return adoptPtr(m_propertyTable ? new PropertyTable(globalData, owner, *m_propertyTable) : new PropertyTable(numberOfSlotsForLastOffset(m_offset, m_inlineCapacity))); 756 748 } 757 749 … … 810 802 811 803 if (!m_propertyTable) 812 createPropertyMap( globalData);804 createPropertyMap(); 813 805 814 806 PropertyOffset newOffset = m_propertyTable->nextOffset(m_inlineCapacity); … … 842 834 } 843 835 844 void Structure::createPropertyMap( JSGlobalData& globalData,unsigned capacity)836 void Structure::createPropertyMap(unsigned capacity) 845 837 { 846 838 ASSERT(!m_propertyTable); 847 839 848 840 checkConsistency(); 849 m_propertyTable .set(globalData, this, PropertyTable::create(globalData,capacity));841 m_propertyTable = adoptPtr(new PropertyTable(capacity)); 850 842 } 851 843 … … 891 883 visitor.append(&thisObject->m_previousOrRareData); 892 884 visitor.append(&thisObject->m_specificValueInPrevious); 893 894 if (thisObject->m_isPinnedPropertyTable) { 895 ASSERT(thisObject->m_propertyTable); 896 visitor.append(&thisObject->m_propertyTable); 897 } else if (thisObject->m_propertyTable) 898 thisObject->m_propertyTable.clear(); 885 if (thisObject->m_propertyTable) { 886 PropertyTable::iterator end = thisObject->m_propertyTable->end(); 887 for (PropertyTable::iterator ptr = thisObject->m_propertyTable->begin(); ptr != end; ++ptr) 888 visitor.append(&ptr->specificValue); 889 } 899 890 } 900 891 -
trunk/Source/JavaScriptCore/runtime/Structure.h
r144074 r144113 32 32 #include "JSCell.h" 33 33 #include "JSType.h" 34 #include "PropertyMapHashTable.h" 34 35 #include "PropertyName.h" 35 36 #include "PropertyNameArray.h" 36 #include "PropertyOffset.h"37 37 #include "Protect.h" 38 38 #include "StructureRareData.h" … … 41 41 #include "Watchpoint.h" 42 42 #include "Weak.h" 43 #include <wtf/PassOwnPtr.h> 43 44 #include <wtf/PassRefPtr.h> 44 45 #include <wtf/RefCounted.h> … … 51 52 class PropertyNameArray; 52 53 class PropertyNameArrayData; 53 class PropertyTable;54 54 class StructureChain; 55 55 class SlotVisitor; … … 109 109 bool isExtensible() const { return !m_preventExtensions; } 110 110 bool didTransition() const { return m_didTransition; } 111 bool putWillGrowOutOfLineStorage(); 111 bool putWillGrowOutOfLineStorage() 112 { 113 checkOffsetConsistency(); 114 115 ASSERT(outOfLineCapacity() >= outOfLineSize()); 116 117 if (!m_propertyTable) { 118 unsigned currentSize = numberOfOutOfLineSlotsForLastOffset(m_offset); 119 ASSERT(outOfLineCapacity() >= currentSize); 120 return currentSize == outOfLineCapacity(); 121 } 122 123 ASSERT(totalStorageCapacity() >= m_propertyTable->propertyStorageSize()); 124 if (m_propertyTable->hasDeletedOffset()) 125 return false; 126 127 ASSERT(totalStorageCapacity() >= m_propertyTable->size()); 128 return m_propertyTable->size() == totalStorageCapacity(); 129 } 112 130 JS_EXPORT_PRIVATE size_t suggestedNewOutOfLineStorageCapacity(); 113 131 … … 365 383 PropertyOffset remove(PropertyName); 366 384 367 void createPropertyMap( JSGlobalData&,unsigned keyCount = 0);385 void createPropertyMap(unsigned keyCount = 0); 368 386 void checkConsistency(); 369 387 … … 371 389 void despecifyAllFunctions(JSGlobalData&); 372 390 373 P ropertyTable*copyPropertyTable(JSGlobalData&, Structure* owner);374 P ropertyTable*copyPropertyTableForPinning(JSGlobalData&, Structure* owner);391 PassOwnPtr<PropertyTable> copyPropertyTable(JSGlobalData&, Structure* owner); 392 PassOwnPtr<PropertyTable> copyPropertyTableForPinning(JSGlobalData&, Structure* owner); 375 393 JS_EXPORT_PRIVATE void materializePropertyMap(JSGlobalData&); 376 394 void materializePropertyMapIfNecessary(JSGlobalData& globalData) … … 428 446 } 429 447 430 bool checkOffsetConsistency() const; 448 ALWAYS_INLINE bool checkOffsetConsistency() const 449 { 450 if (!m_propertyTable) { 451 ASSERT(!m_isPinnedPropertyTable); 452 return true; 453 } 454 455 RELEASE_ASSERT(numberOfSlotsForLastOffset(m_offset, m_inlineCapacity) == m_propertyTable->propertyStorageSize()); 456 unsigned totalSize = m_propertyTable->propertyStorageSize(); 457 RELEASE_ASSERT((totalSize < inlineCapacity() ? 0 : totalSize - inlineCapacity()) == numberOfOutOfLineSlotsForLastOffset(m_offset)); 458 459 return true; 460 } 431 461 432 462 void allocateRareData(JSGlobalData&); … … 453 483 StructureTransitionTable m_transitionTable; 454 484 455 WriteBarrier<PropertyTable> m_propertyTable;485 OwnPtr<PropertyTable> m_propertyTable; 456 486 457 487 mutable InlineWatchpointSet m_transitionWatchpointSet; -
trunk/Source/JavaScriptCore/runtime/StructureInlines.h
r144074 r144113 27 27 #define StructureInlines_h 28 28 29 #include "PropertyMapHashTable.h"30 29 #include "Structure.h" 31 30 … … 181 180 } 182 181 183 inline bool Structure::putWillGrowOutOfLineStorage()184 {185 checkOffsetConsistency();186 187 ASSERT(outOfLineCapacity() >= outOfLineSize());188 189 if (!m_propertyTable) {190 unsigned currentSize = numberOfOutOfLineSlotsForLastOffset(m_offset);191 ASSERT(outOfLineCapacity() >= currentSize);192 return currentSize == outOfLineCapacity();193 }194 195 ASSERT(totalStorageCapacity() >= m_propertyTable->propertyStorageSize());196 if (m_propertyTable->hasDeletedOffset())197 return false;198 199 ASSERT(totalStorageCapacity() >= m_propertyTable->size());200 return m_propertyTable->size() == totalStorageCapacity();201 }202 203 ALWAYS_INLINE bool Structure::checkOffsetConsistency() const204 {205 if (!m_propertyTable) {206 ASSERT(!m_isPinnedPropertyTable);207 return true;208 }209 210 RELEASE_ASSERT(numberOfSlotsForLastOffset(m_offset, m_inlineCapacity) == m_propertyTable->propertyStorageSize());211 unsigned totalSize = m_propertyTable->propertyStorageSize();212 RELEASE_ASSERT((totalSize < inlineCapacity() ? 0 : totalSize - inlineCapacity()) == numberOfOutOfLineSlotsForLastOffset(m_offset));213 214 return true;215 }216 217 182 } // namespace JSC 218 183
Note: See TracChangeset
for help on using the changeset viewer.