2011-02-08 Geoffrey Garen <ggaren@apple.com>
authorggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Feb 2011 05:59:03 +0000 (05:59 +0000)
committerggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Feb 2011 05:59:03 +0000 (05:59 +0000)
commit7baf3c7cbb7fa31de66ea3e35f9e2a824fe5d2cc
tree96247d97e1d487cc0e6e9d6ca43c8d34a0f1fae4
parentdd451a4e122532f4c75ff47bd63300416cff0555
2011-02-08  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Sam Weinig.

        Use a vector to track blocks in the Heap, instead of hand-rolled vector-like code
        https://bugs.webkit.org/show_bug.cgi?id=54062

        SunSpider reports no change.

        * runtime/CollectorHeapIterator.h:
        (JSC::CollectorHeapIterator::isValid):
        (JSC::CollectorHeapIterator::isLive): Updated for new mark invariant: To
        know if an object is live, you just need to test its mark bit.

        * runtime/MarkedSpace.cpp:
        (JSC::MarkedSpace::MarkedSpace): Moved waterMark and highWaterMark from
        CollectorHeap into MarkedSpace, since they're global state. Removed call
        to memset since CollectorHeap is a true class with its own constructor now.

        (JSC::MarkedSpace::destroy): Change uses of m_heap.usedBlocks to
        m_heap.blocks.size(), and m_heap.numBlocks to m_heap.blocks.capacity().

        (JSC::MarkedSpace::allocateBlock):
        (JSC::MarkedSpace::freeBlock): No need to manage our vector manually anymore.

        (JSC::MarkedSpace::allocate):
        (JSC::MarkedSpace::shrink):
        (JSC::MarkedSpace::clearMarkBits):
        (JSC::MarkedSpace::markedCells):
        (JSC::MarkedSpace::sweep):
        (JSC::MarkedSpace::objectCount):
        (JSC::MarkedSpace::capacity):
        (JSC::MarkedSpace::reset):
        (JSC::MarkedSpace::primaryHeapEnd):
        * runtime/MarkedSpace.h:
        (JSC::CollectorHeap::CollectorHeap):
        (JSC::MarkedSpace::highWaterMark):
        (JSC::MarkedSpace::setHighWaterMark):
        (JSC::MarkedSpace::contains): Same as above.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@78017 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/CollectorHeapIterator.h
Source/JavaScriptCore/runtime/MarkedSpace.cpp
Source/JavaScriptCore/runtime/MarkedSpace.h