2011-04-05 Geoffrey Garen <ggaren@apple.com>
authorggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Apr 2011 03:44:48 +0000 (03:44 +0000)
committerggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Apr 2011 03:44:48 +0000 (03:44 +0000)
commita1ec9d824b8772aad04c2400939567126f1f0ade
treeebea21a6a346bb41d51f17dc7628042196c4f640
parente58448cdaef709e1078d015c63d4361e591b7000
2011-04-05  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Oliver Hunt.

        Introduced the concept of opaque roots, in preparation for marking the DOM with them
        https://bugs.webkit.org/show_bug.cgi?id=57903

        * JavaScriptCore.exp: Who likes export files? I do!

        * collector/handles/HandleHeap.cpp:
        (JSC::isValidWeakHandle): Factored out a helper function for ASSERTs.

        (JSC::WeakHandleOwner::~WeakHandleOwner): Moved from header to avoid
        weak linkage problems.

        (JSC::WeakHandleOwner::isReachableFromOpaqueRoots): New callback.
        Currently unused.

        (JSC::WeakHandleOwner::finalize): Switched from pure virtual to a
        default empty implementation, since not all clients necessarily want
        or need non-trivial finalizers.

        (JSC::HandleHeap::markWeakHandles): Split updateWeakHandles into two
        passes. The first pass marks all reachable weak handles. The second pass
        finalizes all unreachable weak handles. This must be two passes because
        we don't know the set of finalizable weak handles until we're done
        marking all weak handles.

        (JSC::HandleHeap::finalizeWeakHandles): Use new helper function.

        * collector/handles/HandleHeap.h: Ditto.

        * runtime/Heap.cpp:
        (JSC::Heap::destroy):
        (JSC::Heap::markRoots):
        (JSC::Heap::reset): Split out handle marking from handle finalization.

        * runtime/MarkStack.cpp:
        (JSC::MarkStack::reset):
        * runtime/MarkStack.h:
        (JSC::MarkStack::addOpaqueRoot):
        (JSC::MarkStack::containsOpaqueRoot):
        (JSC::MarkStack::opaqueRootCount):
        (JSC::HeapRootMarker::markStack): New helper functions for managing the
        set of opaque roots.

        * runtime/WeakGCMap.h:
        (JSC::WeakGCMap::finalize): Renamed to match parent class declaration.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@83011 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/JavaScriptCore.exp
Source/JavaScriptCore/collector/handles/HandleHeap.cpp
Source/JavaScriptCore/collector/handles/HandleHeap.h
Source/JavaScriptCore/runtime/Heap.cpp
Source/JavaScriptCore/runtime/MarkStack.cpp
Source/JavaScriptCore/runtime/MarkStack.h
Source/JavaScriptCore/runtime/WeakGCMap.h