• mhahnenberg@apple.com's avatar
    We're collecting pathologically due to small allocations · 8b5cfd3b
    mhahnenberg@apple.com authored
    Reviewed by Geoffrey Garen.
    No change in performance on run-jsc-benchmarks.
    * dfg/DFGSpeculativeJIT.h: Replacing m_firstFreeCell with m_freeList.
    * heap/CopiedSpace.cpp: Getting rid of any water mark related stuff, since it's no 
    longer useful. 
    (JSC::CopiedSpace::tryAllocateSlowCase): We now only call didAllocate here rather than 
    carrying out a somewhat complicated accounting job for our old water mark throughout CopiedSpace.
    (JSC::CopiedSpace::tryAllocateOversize):  Call the new didAllocate to notify the Heap of 
    newly allocated stuff.
    * heap/CopiedSpace.h:
    * heap/CopiedSpaceInlineMethods.h:
    * heap/Heap.cpp: Removed water mark related stuff, replaced with new bytesAllocated and 
    bytesAllocatedLimit to track how much memory has been allocated since the last collection.
    (JSC::Heap::collect): We now set the new limit of bytes that we can allocate before triggering 
    a collection to be the size of the Heap after the previous collection. Thus, we still have our 
    2x allocation amount.
    (JSC::Heap::didAllocate): Notifies the GC activity timer of how many bytes have been allocated 
    thus far and then adds the new number of bytes to the current total.
    * heap/Heap.h: Removed water mark related stuff.
    * heap/MarkedAllocator.cpp: 
    (JSC::MarkedAllocator::tryAllocateHelper): Refactored to use MarkedBlock's new FreeList struct.
    * heap/MarkedAllocator.h: 
    (JSC::MarkedAllocator::zapFreeList): Refactored to take in a FreeList instead of a FreeCell.
    * heap/MarkedBlock.cpp:
    * heap/MarkedBlock.h:
    (FreeList): Added a new struct that keeps track of the current MarkedAllocator's
    free list including the number of bytes of stuff in the free list so that when the free list is 
    exhausted, the correct amount can be reported to Heap.
    * heap/MarkedSpace.cpp: Removing all water mark related stuff.
    * heap/MarkedSpace.h:
    * heap/WeakSet.cpp:
    (JSC::WeakSet::findAllocator): Refactored to use the didAllocate interface with the Heap. This 
    function still needs work though now that the Heap knows how many bytes have been allocated 
    since the last collection.
    * jit/JITInlineMethods.h: Refactored to use MarkedBlock's new FreeList struct.
    (JSC::JIT::emitAllocateBasicJSObject): Ditto.
    * llint/LowLevelInterpreter.asm: Ditto.
    * runtime/GCActivityCallback.cpp: 
    * runtime/GCActivityCallback.h:
    (JSC::GCActivityCallback::didAllocate): Renamed willAllocate to didAllocate to indicate that 
    the allocation that is being reported has already taken place.
    * runtime/GCActivityCallbackCF.cpp:
    (JSC::DefaultGCActivityCallback::didAllocate): Refactored to return early if the amount of 
    allocation since the last collection is not above a threshold (initially arbitrarily chosen to 
    be 128KB). 
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114698 268f45cc-cd09-0410-ab3c-d52691b4dbfc
MarkedAllocator.h 2.48 KB