2011-05-26 Geoffrey Garen <ggaren@apple.com>
authorggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 May 2011 17:39:35 +0000 (17:39 +0000)
committerggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 May 2011 17:39:35 +0000 (17:39 +0000)
commitd887ac60c5fe40343f1c558770813fa65c44b8ab
tree8267062e24313e8b9dd850e6afc6c428dd49aed3
parent7b41f03a905c9ddeb77900e4f6445f23b4ece5bc
2011-05-26  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Oliver Hunt.

        Optimized ConservativeSet to avoid double-visiting objects
        https://bugs.webkit.org/show_bug.cgi?id=61592

        SunSpider thinks this might be a 1% speedup

        * heap/ConservativeRoots.h:
        (JSC::ConservativeRoots::add): Use testAndClearMarked to avoid double-visiting
        an object.

        * heap/Heap.h:
        (JSC::Heap::isMarked):
        (JSC::Heap::testAndSetMarked):
        (JSC::Heap::testAndClearMarked):
        (JSC::Heap::setMarked): Added testAndClearMarked. Changed argument type
        to void*, since clients want to ask questions about arbitrary pointers
        into the heap, even when they aren't known to be JSCells.

        * heap/MarkedBlock.h:
        (JSC::MarkedBlock::testAndClearMarked):
        * heap/MarkedSpace.h:
        (JSC::MarkedSpace::isMarked):
        (JSC::MarkedSpace::testAndSetMarked):
        (JSC::MarkedSpace::testAndClearMarked):
        (JSC::MarkedSpace::setMarked):
        (JSC::MarkedSpace::contains): Ditto.

        * wtf/Bitmap.h:
        (WTF::::testAndClear): New function for ConservativeRoots's inverted
        marking pass.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@87522 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/heap/ConservativeRoots.h
Source/JavaScriptCore/heap/Heap.h
Source/JavaScriptCore/heap/MarkedBlock.h
Source/JavaScriptCore/heap/MarkedSpace.h
Source/JavaScriptCore/wtf/Bitmap.h