Skip to content
  • oliver@apple.com's avatar
    Refactor Heap allocation logic into separate AllocationSpace class · 44d8954c
    oliver@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=68409
    
    Reviewed by Gavin Barraclough.
    
    ../../../../Volumes/Data/git/WebKit/OpenSource/Source/JavaScriptCore:
    
    This patch hoists direct manipulation of the MarkedSpace and related
    data out of Heap and into a separate class.  This will allow us to
    have multiple allocation spaces in future, so easing the way towards
    having GC'd backing stores for objects.
    
    * CMakeLists.txt:
    * GNUmakefile.list.am:
    * JavaScriptCore.exp:
    * JavaScriptCore.gypi:
    * JavaScriptCore.pro:
    * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
    * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
    * JavaScriptCore.xcodeproj/project.pbxproj:
    * debugger/Debugger.cpp:
    (JSC::Debugger::recompileAllJSFunctions):
    * heap/AllocationSpace.cpp: Added.
    (JSC::AllocationSpace::tryAllocate):
    (JSC::AllocationSpace::allocateSlowCase):
    (JSC::AllocationSpace::allocateBlock):
    (JSC::AllocationSpace::freeBlocks):
    (JSC::TakeIfEmpty::TakeIfEmpty):
    (JSC::TakeIfEmpty::operator()):
    (JSC::TakeIfEmpty::returnValue):
    (JSC::AllocationSpace::shrink):
    * heap/AllocationSpace.h: Added.
    (JSC::AllocationSpace::AllocationSpace):
    (JSC::AllocationSpace::blocks):
    (JSC::AllocationSpace::sizeClassFor):
    (JSC::AllocationSpace::setHighWaterMark):
    (JSC::AllocationSpace::highWaterMark):
    (JSC::AllocationSpace::canonicalizeBlocks):
    (JSC::AllocationSpace::resetAllocator):
    (JSC::AllocationSpace::forEachCell):
    (JSC::AllocationSpace::forEachBlock):
    (JSC::AllocationSpace::allocate):
    * heap/Heap.cpp:
    (JSC::Heap::Heap):
    (JSC::Heap::reportExtraMemoryCostSlowCase):
    (JSC::Heap::getConservativeRegisterRoots):
    (JSC::Heap::markRoots):
    (JSC::Heap::clearMarks):
    (JSC::Heap::sweep):
    (JSC::Heap::objectCount):
    (JSC::Heap::size):
    (JSC::Heap::capacity):
    (JSC::Heap::globalObjectCount):
    (JSC::Heap::objectTypeCounts):
    (JSC::Heap::collect):
    (JSC::Heap::canonicalizeBlocks):
    (JSC::Heap::resetAllocator):
    (JSC::Heap::freeBlocks):
    (JSC::Heap::shrink):
    * heap/Heap.h:
    (JSC::Heap::objectSpace):
    (JSC::Heap::sizeClassForObject):
    (JSC::Heap::allocate):
    * jit/JITInlineMethods.h:
    (JSC::JIT::emitAllocateBasicJSObject):
    * runtime/JSGlobalData.cpp:
    (JSC::JSGlobalData::recompileAllJSFunctions):
    (JSC::JSGlobalData::releaseExecutableMemory):
    
    ../../../../Volumes/Data/git/WebKit/OpenSource/Source/WebCore:
    
    Adding a forwarding header.
    
    * ForwardingHeaders/heap/AllocationSpace.h: Added.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@95559 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    44d8954c