Ignore:
Timestamp:
Feb 3, 2012, 11:21:28 AM (13 years ago)
Author:
[email protected]
Message:

Refactor MarkedBlock::SizeClass into a separate class
https://bugs.webkit.org/show_bug.cgi?id=77600

Reviewed by Geoffrey Garen.

We pulled SizeClass out into its own class, named MarkedAllocator, and gave it
the responsibility of allocating objects from the collection of MarkedBlocks
that it manages. Also limited the amount of coupling to internal data fields
from other places, although it's mostly unavoidable in the JIT code.

Eventually MarkedAllocator will implement various policies to do with object
management, e.g. whether or not to run destructors on objects that it manages.
MarkedSpace will manage a collection of MarkedAllocators with varying policies,
as it does now but to a larger extent.

  • CMakeLists.txt:
  • GNUmakefile.list.am:
  • JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  • JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • Target.pri:
  • dfg/DFGSpeculativeJIT.h:

(JSC::DFG::SpeculativeJIT::emitAllocateJSFinalObject):

  • heap/Heap.cpp:

(JSC::Heap::collect):
(JSC::Heap::resetAllocators):

  • heap/Heap.h:

(JSC::Heap::allocatorForObject):
(Heap):

  • heap/MarkedAllocator.cpp: Added.

(JSC):
(JSC::MarkedAllocator::tryAllocateHelper):
(JSC::MarkedAllocator::tryAllocate):
(JSC::MarkedAllocator::allocateSlowCase):
(JSC::MarkedAllocator::allocateBlock):
(JSC::MarkedAllocator::addBlock):
(JSC::MarkedAllocator::removeBlock):

  • heap/MarkedAllocator.h: Added.

(JSC):
(DFG):
(MarkedAllocator):
(JSC::MarkedAllocator::cellSize):
(JSC::MarkedAllocator::heap):
(JSC::MarkedAllocator::setHeap):
(JSC::MarkedAllocator::setCellSize):
(JSC::MarkedAllocator::setMarkedSpace):
(JSC::MarkedAllocator::MarkedAllocator):
(JSC::MarkedAllocator::allocate):
(JSC::MarkedAllocator::reset):
(JSC::MarkedAllocator::zapFreeList):
(JSC::MarkedAllocator::forEachBlock):

  • heap/MarkedSpace.cpp:

(JSC::MarkedSpace::MarkedSpace):
(JSC::MarkedSpace::resetAllocators):
(JSC::MarkedSpace::canonicalizeCellLivenessData):
(JSC::TakeIfUnmarked::operator()):

  • heap/MarkedSpace.h:

(MarkedSpace):
(JSC::MarkedSpace::allocatorFor):
(JSC::MarkedSpace::allocate):
(JSC::MarkedSpace::forEachBlock):
(JSC::MarkedSpace::didAddBlock):
(JSC::MarkedSpace::didConsumeFreeList):

  • jit/JITInlineMethods.h:

(JSC::JIT::emitAllocateBasicJSObject):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/heap/Heap.cpp

    r105442 r106676  
    812812    {
    813813        GCPHASE(ResetAllocator);
    814         resetAllocator();
     814        resetAllocators();
    815815    }
    816816   
     
    847847}
    848848
    849 void Heap::resetAllocator()
     849void Heap::resetAllocators()
    850850{
    851851    m_extraCost = 0;
    852     m_objectSpace.resetAllocator();
     852    m_objectSpace.resetAllocators();
    853853}
    854854
Note: See TracChangeset for help on using the changeset viewer.