2011-02-03 Geoffrey Garen <ggaren@apple.com>
authorggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Feb 2011 07:41:33 +0000 (07:41 +0000)
committerggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Feb 2011 07:41:33 +0000 (07:41 +0000)
commitb0a1ae15382acc1c27eb2b8c42b2e37daef49c1c
tree7de3ee1819c58782c63a10bea9dd6c14b4776d98
parentce13a112ad0683289388d1ecf440accb9d9fb5c9
2011-02-03  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Cameron Zwarich.

        Changed MarkedSpace to delegate grow/shrink decisions to Heap
        https://bugs.webkit.org/show_bug.cgi?id=53759

        SunSpider reports no change.

        * runtime/Heap.cpp:
        (JSC::Heap::Heap):
        (JSC::Heap::reset):
        * runtime/Heap.h: Reorganized a few data members for better cache locality.
        Added a grow policy.

        * runtime/MarkedSpace.cpp:
        (JSC::MarkedSpace::allocate):
        (JSC::MarkedSpace::sweep):
        (JSC::MarkedSpace::reset): Don't shrink automatically. Instead, wait for
        the heap to make an explicit sweep call.

        * runtime/MarkedSpace.h:
        (JSC::MarkedSpace::highWaterMark):
        (JSC::MarkedSpace::setHighWaterMark): Use a watermark to determine how
        many bytes to allocate before failing and giving the heap an opportunity
        to collect garbage. This also means that we allocate blocks on demand,
        instead of ahead of time.

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