Changeset 94522 in webkit
- Timestamp:
- Sep 5, 2011 3:43:34 AM (13 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r94520 r94522 1 2011-09-05 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r94445 and r94448. 4 http://trac.webkit.org/changeset/94445 5 http://trac.webkit.org/changeset/94448 6 https://bugs.webkit.org/show_bug.cgi?id=67595 7 8 It broke everything (Requested by ossy on #webkit). 9 10 * JavaScriptCore.exp: 11 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 12 * heap/Heap.cpp: 13 (JSC::Heap::collect): 14 * heap/Heap.h: 15 * heap/NewSpace.cpp: 16 (JSC::NewSpace::NewSpace): 17 * heap/NewSpace.h: 18 * jit/JITStubs.cpp: 19 (JSC::DEFINE_STUB_FUNCTION): 20 * runtime/JSObject.cpp: 21 (JSC::JSObject::allocatePropertyStorage): 22 * runtime/JSObject.h: 23 (JSC::JSObject::~JSObject): 24 (JSC::JSObject::putDirectInternal): 25 (JSC::JSObject::putDirectWithoutTransition): 26 (JSC::JSObject::putDirectFunctionWithoutTransition): 27 (JSC::JSObject::transitionTo): 28 (JSC::JSObject::visitChildrenDirect): 29 1 30 2011-09-05 Patrick Gansterer <paroga@webkit.org> 2 31 -
trunk/Source/JavaScriptCore/JavaScriptCore.exp
r94475 r94522 216 216 __ZN3JSC22objectConstructorTableE 217 217 __ZN3JSC23AbstractSamplingCounter4dumpEv 218 __ZN3JSC23AbstractSamplingCounter30s_abstractSamplingCounterChainE219 218 __ZN3JSC23objectProtoFuncToStringEPNS_9ExecStateE 220 219 __ZN3JSC23setUpStaticFunctionSlotEPNS_9ExecStateEPKNS_9HashEntryEPNS_8JSObjectERKNS_10IdentifierERNS_12PropertySlotE … … 324 323 __ZN3JSC8JSObject21getPropertyDescriptorEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE 325 324 __ZN3JSC8JSObject22fillGetterPropertySlotERNS_12PropertySlotEPNS_16WriteBarrierBaseINS_7UnknownEEE 326 __ZN3JSC8JSObject23allocatePropertyStorageE RNS_12JSGlobalDataEmm325 __ZN3JSC8JSObject23allocatePropertyStorageEmm 327 326 __ZN3JSC8JSObject24getOwnPropertyDescriptorEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE 328 327 __ZN3JSC8JSObject3putEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueERNS_15PutPropertySlotE -
trunk/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
r94452 r94522 60 60 ?addStaticGlobals@JSGlobalObject@JSC@@IAEXPAUGlobalPropertyInfo@12@H@Z 61 61 ?allocate@Heap@JSC@@QAEPAXAAUSizeClass@NewSpace@2@@Z 62 ?allocatePropertyStorage@JSObject@JSC@@QAEX AAVJSGlobalData@2@II@Z62 ?allocatePropertyStorage@JSObject@JSC@@QAEXII@Z 63 63 ?allocateSlowCase@Heap@JSC@@AAEPAXAAUSizeClass@NewSpace@2@@Z 64 64 ?append@StringBuilder@WTF@@QAEXPBDI@Z -
trunk/Source/JavaScriptCore/heap/Heap.cpp
r94477 r94522 691 691 size_t proportionalBytes = 2 * size(); 692 692 m_newSpace.setHighWaterMark(max(proportionalBytes, m_minBytesPerCycle)); 693 m_newSpace.resetPropertyStorageNursery(); 693 694 694 JAVASCRIPTCORE_GC_END(); 695 695 -
trunk/Source/JavaScriptCore/heap/Heap.h
r94477 r94522 92 92 void collectAllGarbage(); 93 93 94 inline void* allocatePropertyStorage(size_t);95 inline bool inPropertyStorageNursery(void*);96 97 94 void reportExtraMemoryCost(size_t cost); 98 95 … … 363 360 } 364 361 365 inline void* Heap::allocatePropertyStorage(size_t bytes)366 {367 ASSERT(!(bytes % sizeof(JSValue)));368 if (bytes >= NewSpace::PropertyStorageNurserySize)369 return fastMalloc(bytes);370 if (void* result = m_newSpace.allocatePropertyStorage(bytes))371 return result;372 collect(DoNotSweep);373 return m_newSpace.allocatePropertyStorage(bytes);374 }375 376 inline bool Heap::inPropertyStorageNursery(void* ptr)377 {378 return m_newSpace.inPropertyStorageNursery(ptr);379 }380 381 362 } // namespace JSC 382 363 -
trunk/Source/JavaScriptCore/heap/NewSpace.cpp
r94445 r94522 33 33 34 34 NewSpace::NewSpace(Heap* heap) 35 : m_propertyStorageNursery(static_cast<char*>(fastMalloc(PropertyStorageNurserySize))) 36 , m_propertyStorageAllocationPoint(m_propertyStorageNursery) 37 , m_waterMark(0) 35 : m_waterMark(0) 38 36 , m_highWaterMark(0) 39 37 , m_heap(heap) -
trunk/Source/JavaScriptCore/heap/NewSpace.h
r94448 r94522 47 47 public: 48 48 static const size_t maxCellSize = 1024; 49 static const size_t PropertyStorageNurserySize = 1024 * 1024 * 4;50 49 51 50 struct SizeClass { … … 65 64 SizeClass& sizeClassFor(size_t); 66 65 void* allocate(SizeClass&); 67 inline void* allocatePropertyStorage(size_t);68 inline bool inPropertyStorageNursery(void* ptr);69 inline void resetPropertyStorageNursery();70 71 66 void resetAllocator(); 72 67 … … 97 92 SizeClass m_preciseSizeClasses[preciseCount]; 98 93 SizeClass m_impreciseSizeClasses[impreciseCount]; 99 char* m_propertyStorageNursery;100 char* m_propertyStorageAllocationPoint;101 94 size_t m_waterMark; 102 95 size_t m_highWaterMark; … … 168 161 } 169 162 170 inline void NewSpace::resetPropertyStorageNursery()171 {172 m_propertyStorageAllocationPoint = m_propertyStorageNursery;173 }174 175 inline void* NewSpace::allocatePropertyStorage(size_t size)176 {177 char* result = m_propertyStorageAllocationPoint;178 if (size > PropertyStorageNurserySize)179 CRASH();180 m_propertyStorageAllocationPoint += size;181 if (static_cast<size_t>(m_propertyStorageAllocationPoint - m_propertyStorageNursery) > PropertyStorageNurserySize) {182 m_propertyStorageAllocationPoint = result;183 return 0;184 }185 return result;186 }187 188 inline bool NewSpace::inPropertyStorageNursery(void* ptr)189 {190 char* addr = static_cast<char*>(ptr);191 return static_cast<size_t>(addr - m_propertyStorageNursery) < PropertyStorageNurserySize;192 }193 194 163 template <typename Functor> inline typename Functor::ReturnType NewSpace::forEachBlock(Functor& functor) 195 164 { -
trunk/Source/JavaScriptCore/jit/JITStubs.cpp
r94445 r94522 1482 1482 ASSERT(baseValue.isObject()); 1483 1483 JSObject* base = asObject(baseValue); 1484 base->allocatePropertyStorage( *stackFrame.globalData,oldSize, newSize);1484 base->allocatePropertyStorage(oldSize, newSize); 1485 1485 1486 1486 return base; -
trunk/Source/JavaScriptCore/runtime/JSObject.cpp
r94445 r94522 595 595 } 596 596 597 void JSObject::allocatePropertyStorage( JSGlobalData& globalData,size_t oldSize, size_t newSize)597 void JSObject::allocatePropertyStorage(size_t oldSize, size_t newSize) 598 598 { 599 599 ASSERT(newSize > oldSize); … … 601 601 // It's important that this function not rely on m_structure, since 602 602 // we might be in the middle of a transition. 603 bool wasInline = (oldSize < JSObject::baseExternalStorageCapacity); 604 603 605 PropertyStorage oldPropertyStorage = m_propertyStorage; 604 PropertyStorage newPropertyStorage = static_cast<PropertyStorage>(globalData.heap.allocatePropertyStorage(newSize * sizeof(WriteBarrierBase<Unknown>))); 605 ASSERT(newPropertyStorage); 606 PropertyStorage newPropertyStorage = new WriteBarrierBase<Unknown>[newSize]; 606 607 607 608 for (unsigned i = 0; i < oldSize; ++i) 608 609 newPropertyStorage[i] = oldPropertyStorage[i]; 609 610 610 if (! isUsingInlineStorage() && !globalData.heap.inPropertyStorageNursery(oldPropertyStorage))611 if (!wasInline) 611 612 delete [] oldPropertyStorage; 612 613 -
trunk/Source/JavaScriptCore/runtime/JSObject.h
r94445 r94522 222 222 virtual ComplType exceptionType() const { return Throw; } 223 223 224 void allocatePropertyStorage( JSGlobalData&,size_t oldSize, size_t newSize);224 void allocatePropertyStorage(size_t oldSize, size_t newSize); 225 225 bool isUsingInlineStorage() const { return static_cast<const void*>(m_propertyStorage) == static_cast<const void*>(this + 1); } 226 226 … … 464 464 inline JSObject::~JSObject() 465 465 { 466 if (!isUsingInlineStorage() && !Heap::heap(this)->inPropertyStorageNursery(m_propertyStorage))466 if (!isUsingInlineStorage()) 467 467 delete [] m_propertyStorage; 468 468 } … … 658 658 offset = m_structure->addPropertyWithoutTransition(globalData, propertyName, attributes, specificFunction); 659 659 if (currentCapacity != m_structure->propertyStorageCapacity()) 660 allocatePropertyStorage( globalData,currentCapacity, m_structure->propertyStorageCapacity());660 allocatePropertyStorage(currentCapacity, m_structure->propertyStorageCapacity()); 661 661 662 662 ASSERT(offset < m_structure->propertyStorageCapacity()); … … 672 672 if (Structure* structure = Structure::addPropertyTransitionToExistingStructure(m_structure.get(), propertyName, attributes, specificFunction, offset)) { 673 673 if (currentCapacity != structure->propertyStorageCapacity()) 674 allocatePropertyStorage( globalData,currentCapacity, structure->propertyStorageCapacity());674 allocatePropertyStorage(currentCapacity, structure->propertyStorageCapacity()); 675 675 676 676 ASSERT(offset < structure->propertyStorageCapacity()); … … 722 722 723 723 if (currentCapacity != structure->propertyStorageCapacity()) 724 allocatePropertyStorage( globalData,currentCapacity, structure->propertyStorageCapacity());724 allocatePropertyStorage(currentCapacity, structure->propertyStorageCapacity()); 725 725 726 726 ASSERT(offset < structure->propertyStorageCapacity()); … … 783 783 size_t offset = m_structure->addPropertyWithoutTransition(globalData, propertyName, attributes, 0); 784 784 if (currentCapacity != m_structure->propertyStorageCapacity()) 785 allocatePropertyStorage( globalData,currentCapacity, m_structure->propertyStorageCapacity());785 allocatePropertyStorage(currentCapacity, m_structure->propertyStorageCapacity()); 786 786 putDirectOffset(globalData, offset, value); 787 787 } … … 792 792 size_t offset = m_structure->addPropertyWithoutTransition(globalData, propertyName, attributes, value); 793 793 if (currentCapacity != m_structure->propertyStorageCapacity()) 794 allocatePropertyStorage( globalData,currentCapacity, m_structure->propertyStorageCapacity());794 allocatePropertyStorage(currentCapacity, m_structure->propertyStorageCapacity()); 795 795 putDirectOffset(globalData, offset, value); 796 796 } … … 799 799 { 800 800 if (m_structure->propertyStorageCapacity() != newStructure->propertyStorageCapacity()) 801 allocatePropertyStorage( globalData,m_structure->propertyStorageCapacity(), newStructure->propertyStorageCapacity());801 allocatePropertyStorage(m_structure->propertyStorageCapacity(), newStructure->propertyStorageCapacity()); 802 802 setStructure(globalData, newStructure); 803 803 } … … 890 890 891 891 PropertyStorage storage = propertyStorage(); 892 if (Heap::heap(this)->inPropertyStorageNursery(storage)) {893 m_propertyStorage = new WriteBarrierBase<Unknown>[structure()->propertyStorageCapacity()];894 memcpy(m_propertyStorage, storage, m_structure->propertyStorageSize() * sizeof(WriteBarrierBase<Unknown>));895 }896 892 size_t storageSize = m_structure->propertyStorageSize(); 897 893 visitor.appendValues(storage, storageSize);
Note: See TracChangeset
for help on using the changeset viewer.