2011-01-21 Geoffrey Garen <ggaren@apple.com>
authorggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 22 Jan 2011 04:27:18 +0000 (04:27 +0000)
committerggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 22 Jan 2011 04:27:18 +0000 (04:27 +0000)
commit86f2195180d0b74d779fa520957a3f3ce791750d
treec073a8503c86a84665e322b7a89bbfada0cec2ff
parent190aecd5b06c7bbe5360efb5315005d722a5cf62
2011-01-21  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Maciej Stachowiak.

        Cleaned up some conservative marking code.
        https://bugs.webkit.org/show_bug.cgi?id=52946

        SunSpider reports no change.

        * interpreter/RegisterFile.h: No need for a special marking function,
        since we already expose a start() and end().

        * runtime/Heap.cpp:
        (JSC::Heap::registerFile):
        (JSC::Heap::markRoots):
        * runtime/Heap.h:
        (JSC::Heap::contains): Migrated markConservatively() to the machine stack
        marker class. Now, Heap just provides a contains() function, which the
        machine stack marker uses for checking whether a pointer points into the heap.

        * runtime/MachineStackMarker.cpp:
        (JSC::MachineStackMarker::markCurrentThreadConservativelyInternal):
        (JSC::MachineStackMarker::markOtherThreadConservatively):
        (JSC::isPointerAligned):
        (JSC::MachineStackMarker::markConservatively):
        * runtime/MachineStackMarker.h: Move the conservative marking code here.

        * runtime/MarkStack.h:
        (JSC::ConservativeSet::add):
        (JSC::ConservativeSet::mark): Changed to using a vector instead of hash
        set. Vector seems to be a bit faster, and it generates smaller code.

        * runtime/MarkedSpace.cpp:
        (JSC::MarkedSpace::containsSlowCase):
        * runtime/MarkedSpace.h:
        (JSC::MarkedSpace::isCellAligned):
        (JSC::MarkedSpace::isPossibleCell):
        (JSC::MarkedSpace::contains): Kept the code for determining whether a
        pointer pointed into marked space, and moved the code for marking
        a set of conservative pointers into the machine stack marker.

        * wtf/HashSet.h:
        (WTF::::add): Added two missing inlines that I noticed while testing
        vector vs hash set.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76425 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/interpreter/RegisterFile.h
Source/JavaScriptCore/runtime/Heap.cpp
Source/JavaScriptCore/runtime/Heap.h
Source/JavaScriptCore/runtime/MachineStackMarker.cpp
Source/JavaScriptCore/runtime/MachineStackMarker.h
Source/JavaScriptCore/runtime/MarkStack.h
Source/JavaScriptCore/runtime/MarkedSpace.cpp
Source/JavaScriptCore/runtime/MarkedSpace.h
Source/JavaScriptCore/wtf/HashSet.h