Changeset 94522 in webkit


Ignore:
Timestamp:
Sep 5, 2011 3:43:34 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

Unreviewed, rolling out r94445 and r94448.
http://trac.webkit.org/changeset/94445
http://trac.webkit.org/changeset/94448
https://bugs.webkit.org/show_bug.cgi?id=67595

It broke everything (Requested by ossy on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2011-09-05

(JSC::Heap::collect):

  • heap/Heap.h:
  • heap/NewSpace.cpp:

(JSC::NewSpace::NewSpace):

  • heap/NewSpace.h:
  • jit/JITStubs.cpp:

(JSC::DEFINE_STUB_FUNCTION):

  • runtime/JSObject.cpp:

(JSC::JSObject::allocatePropertyStorage):

  • runtime/JSObject.h:

(JSC::JSObject::~JSObject):
(JSC::JSObject::putDirectInternal):
(JSC::JSObject::putDirectWithoutTransition):
(JSC::JSObject::putDirectFunctionWithoutTransition):
(JSC::JSObject::transitionTo):
(JSC::JSObject::visitChildrenDirect):

Location:
trunk/Source/JavaScriptCore
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r94520 r94522  
     12011-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
    1302011-09-05  Patrick Gansterer  <paroga@webkit.org>
    231
  • trunk/Source/JavaScriptCore/JavaScriptCore.exp

    r94475 r94522  
    216216__ZN3JSC22objectConstructorTableE
    217217__ZN3JSC23AbstractSamplingCounter4dumpEv
    218 __ZN3JSC23AbstractSamplingCounter30s_abstractSamplingCounterChainE
    219218__ZN3JSC23objectProtoFuncToStringEPNS_9ExecStateE
    220219__ZN3JSC23setUpStaticFunctionSlotEPNS_9ExecStateEPKNS_9HashEntryEPNS_8JSObjectERKNS_10IdentifierERNS_12PropertySlotE
     
    324323__ZN3JSC8JSObject21getPropertyDescriptorEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE
    325324__ZN3JSC8JSObject22fillGetterPropertySlotERNS_12PropertySlotEPNS_16WriteBarrierBaseINS_7UnknownEEE
    326 __ZN3JSC8JSObject23allocatePropertyStorageERNS_12JSGlobalDataEmm
     325__ZN3JSC8JSObject23allocatePropertyStorageEmm
    327326__ZN3JSC8JSObject24getOwnPropertyDescriptorEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE
    328327__ZN3JSC8JSObject3putEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueERNS_15PutPropertySlotE
  • trunk/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def

    r94452 r94522  
    6060    ?addStaticGlobals@JSGlobalObject@JSC@@IAEXPAUGlobalPropertyInfo@12@H@Z
    6161    ?allocate@Heap@JSC@@QAEPAXAAUSizeClass@NewSpace@2@@Z
    62     ?allocatePropertyStorage@JSObject@JSC@@QAEXAAVJSGlobalData@2@II@Z
     62    ?allocatePropertyStorage@JSObject@JSC@@QAEXII@Z
    6363    ?allocateSlowCase@Heap@JSC@@AAEPAXAAUSizeClass@NewSpace@2@@Z
    6464    ?append@StringBuilder@WTF@@QAEXPBDI@Z
  • trunk/Source/JavaScriptCore/heap/Heap.cpp

    r94477 r94522  
    691691    size_t proportionalBytes = 2 * size();
    692692    m_newSpace.setHighWaterMark(max(proportionalBytes, m_minBytesPerCycle));
    693     m_newSpace.resetPropertyStorageNursery();
     693
    694694    JAVASCRIPTCORE_GC_END();
    695695
  • trunk/Source/JavaScriptCore/heap/Heap.h

    r94477 r94522  
    9292        void collectAllGarbage();
    9393
    94         inline void* allocatePropertyStorage(size_t);
    95         inline bool inPropertyStorageNursery(void*);
    96 
    9794        void reportExtraMemoryCost(size_t cost);
    9895
     
    363360    }
    364361
    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 
    381362} // namespace JSC
    382363
  • trunk/Source/JavaScriptCore/heap/NewSpace.cpp

    r94445 r94522  
    3333
    3434NewSpace::NewSpace(Heap* heap)
    35     : m_propertyStorageNursery(static_cast<char*>(fastMalloc(PropertyStorageNurserySize)))
    36     , m_propertyStorageAllocationPoint(m_propertyStorageNursery)
    37     , m_waterMark(0)
     35    : m_waterMark(0)
    3836    , m_highWaterMark(0)
    3937    , m_heap(heap)
  • trunk/Source/JavaScriptCore/heap/NewSpace.h

    r94448 r94522  
    4747    public:
    4848        static const size_t maxCellSize = 1024;
    49         static const size_t PropertyStorageNurserySize = 1024 * 1024 * 4;
    5049
    5150        struct SizeClass {
     
    6564        SizeClass& sizeClassFor(size_t);
    6665        void* allocate(SizeClass&);
    67         inline void* allocatePropertyStorage(size_t);
    68         inline bool inPropertyStorageNursery(void* ptr);
    69         inline void resetPropertyStorageNursery();
    70        
    7166        void resetAllocator();
    7267
     
    9792        SizeClass m_preciseSizeClasses[preciseCount];
    9893        SizeClass m_impreciseSizeClasses[impreciseCount];
    99         char* m_propertyStorageNursery;
    100         char* m_propertyStorageAllocationPoint;
    10194        size_t m_waterMark;
    10295        size_t m_highWaterMark;
     
    168161    }
    169162
    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    
    194163    template <typename Functor> inline typename Functor::ReturnType NewSpace::forEachBlock(Functor& functor)
    195164    {
  • trunk/Source/JavaScriptCore/jit/JITStubs.cpp

    r94445 r94522  
    14821482    ASSERT(baseValue.isObject());
    14831483    JSObject* base = asObject(baseValue);
    1484     base->allocatePropertyStorage(*stackFrame.globalData, oldSize, newSize);
     1484    base->allocatePropertyStorage(oldSize, newSize);
    14851485
    14861486    return base;
  • trunk/Source/JavaScriptCore/runtime/JSObject.cpp

    r94445 r94522  
    595595}
    596596
    597 void JSObject::allocatePropertyStorage(JSGlobalData& globalData, size_t oldSize, size_t newSize)
     597void JSObject::allocatePropertyStorage(size_t oldSize, size_t newSize)
    598598{
    599599    ASSERT(newSize > oldSize);
     
    601601    // It's important that this function not rely on m_structure, since
    602602    // we might be in the middle of a transition.
     603    bool wasInline = (oldSize < JSObject::baseExternalStorageCapacity);
     604
    603605    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];
    606607
    607608    for (unsigned i = 0; i < oldSize; ++i)
    608609       newPropertyStorage[i] = oldPropertyStorage[i];
    609610
    610     if (!isUsingInlineStorage() && !globalData.heap.inPropertyStorageNursery(oldPropertyStorage))
     611    if (!wasInline)
    611612        delete [] oldPropertyStorage;
    612613
  • trunk/Source/JavaScriptCore/runtime/JSObject.h

    r94445 r94522  
    222222        virtual ComplType exceptionType() const { return Throw; }
    223223
    224         void allocatePropertyStorage(JSGlobalData&, size_t oldSize, size_t newSize);
     224        void allocatePropertyStorage(size_t oldSize, size_t newSize);
    225225        bool isUsingInlineStorage() const { return static_cast<const void*>(m_propertyStorage) == static_cast<const void*>(this + 1); }
    226226
     
    464464inline JSObject::~JSObject()
    465465{
    466     if (!isUsingInlineStorage() && !Heap::heap(this)->inPropertyStorageNursery(m_propertyStorage))
     466    if (!isUsingInlineStorage())
    467467        delete [] m_propertyStorage;
    468468}
     
    658658        offset = m_structure->addPropertyWithoutTransition(globalData, propertyName, attributes, specificFunction);
    659659        if (currentCapacity != m_structure->propertyStorageCapacity())
    660             allocatePropertyStorage(globalData, currentCapacity, m_structure->propertyStorageCapacity());
     660            allocatePropertyStorage(currentCapacity, m_structure->propertyStorageCapacity());
    661661
    662662        ASSERT(offset < m_structure->propertyStorageCapacity());
     
    672672    if (Structure* structure = Structure::addPropertyTransitionToExistingStructure(m_structure.get(), propertyName, attributes, specificFunction, offset)) {   
    673673        if (currentCapacity != structure->propertyStorageCapacity())
    674             allocatePropertyStorage(globalData, currentCapacity, structure->propertyStorageCapacity());
     674            allocatePropertyStorage(currentCapacity, structure->propertyStorageCapacity());
    675675
    676676        ASSERT(offset < structure->propertyStorageCapacity());
     
    722722
    723723    if (currentCapacity != structure->propertyStorageCapacity())
    724         allocatePropertyStorage(globalData, currentCapacity, structure->propertyStorageCapacity());
     724        allocatePropertyStorage(currentCapacity, structure->propertyStorageCapacity());
    725725
    726726    ASSERT(offset < structure->propertyStorageCapacity());
     
    783783    size_t offset = m_structure->addPropertyWithoutTransition(globalData, propertyName, attributes, 0);
    784784    if (currentCapacity != m_structure->propertyStorageCapacity())
    785         allocatePropertyStorage(globalData, currentCapacity, m_structure->propertyStorageCapacity());
     785        allocatePropertyStorage(currentCapacity, m_structure->propertyStorageCapacity());
    786786    putDirectOffset(globalData, offset, value);
    787787}
     
    792792    size_t offset = m_structure->addPropertyWithoutTransition(globalData, propertyName, attributes, value);
    793793    if (currentCapacity != m_structure->propertyStorageCapacity())
    794         allocatePropertyStorage(globalData, currentCapacity, m_structure->propertyStorageCapacity());
     794        allocatePropertyStorage(currentCapacity, m_structure->propertyStorageCapacity());
    795795    putDirectOffset(globalData, offset, value);
    796796}
     
    799799{
    800800    if (m_structure->propertyStorageCapacity() != newStructure->propertyStorageCapacity())
    801         allocatePropertyStorage(globalData, m_structure->propertyStorageCapacity(), newStructure->propertyStorageCapacity());
     801        allocatePropertyStorage(m_structure->propertyStorageCapacity(), newStructure->propertyStorageCapacity());
    802802    setStructure(globalData, newStructure);
    803803}
     
    890890
    891891    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     }
    896892    size_t storageSize = m_structure->propertyStorageSize();
    897893    visitor.appendValues(storage, storageSize);
Note: See TracChangeset for help on using the changeset viewer.