2011-01-30 Geoffrey Garen <ggaren@apple.com>
authorggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 30 Jan 2011 23:07:11 +0000 (23:07 +0000)
committerggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 30 Jan 2011 23:07:11 +0000 (23:07 +0000)
commit7ddf61bca76824bd3638ce1cd528f8f5165664c5
treee541452f183f587a6291348bd42a52d159ec3b3c
parent9f33cba2fbf0ac3bffeb9c4fe430e4e7be9cadc0
2011-01-30  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Oliver Hunt.

        Filter all Heap collection through a common reset function, in
        preparation for adding features triggered by collection.
        https://bugs.webkit.org/show_bug.cgi?id=53396

        SunSpider reports no change.

        * runtime/Heap.cpp:
        (JSC::Heap::reportExtraMemoryCostSlowCase): When we're over the extraCost
        limit, just call collectAllGarbage() instead of rolling our own special
        way of resetting the heap. In theory, this may be slower in some cases,
        but it also fixes cases of pathological heap growth that we've seen,
        where the only objects being allocated are temporary and huge
        (<rdar://problem/8885843>).

        (JSC::Heap::allocate):
        (JSC::Heap::collectAllGarbage): Use the shared reset function.

        (JSC::Heap::reset):
        * runtime/Heap.h: Carved a new shared reset function out of the old
        collectAllGarbage.

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