Ignore:
Timestamp:
Sep 20, 2011, 11:31:37 AM (14 years ago)
Author:
[email protected]
Message:

Refactor Heap allocation logic into separate AllocationSpace class
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.

(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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSGlobalData.cpp

    r95510 r95559  
    448448    ASSERT(!dynamicGlobalObject);
    449449   
    450     heap.forEachCell<Recompiler>();
     450    heap.objectSpace().forEachCell<Recompiler>();
    451451}
    452452
     
    489489               
    490490        }
    491         heap.forEachCell<StackPreservingRecompiler>(recompiler);
     491        heap.objectSpace().forEachCell<StackPreservingRecompiler>(recompiler);
    492492    }
    493493    m_regExpCache->invalidateCode();
Note: See TracChangeset for help on using the changeset viewer.