2011-04-21 Oliver Hunt <oliver@apple.com>
authoroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Apr 2011 23:08:15 +0000 (23:08 +0000)
committeroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Apr 2011 23:08:15 +0000 (23:08 +0000)
        Reviewed by Geoffrey Garen.

        Start moving to a general visitor pattern for GC traversal
        https://bugs.webkit.org/show_bug.cgi?id=59141

        This is just a rename:
            markChildren -> visitChildren
            markAggregate -> visitAggregate
            markStack -> visitor
            MarkStack -> typedef'd to SlotVisitor

        * API/JSCallbackObject.h:
        (JSC::JSCallbackObjectData::visitChildren):
        (JSC::JSCallbackObjectData::JSPrivatePropertyMap::visitChildren):
        (JSC::JSCallbackObject::visitChildren):
        * JavaScriptCore.exp:
        * bytecode/CodeBlock.cpp:
        (JSC::CodeBlock::visitStructures):
        (JSC::EvalCodeCache::visitAggregate):
        (JSC::CodeBlock::visitAggregate):
        * bytecode/CodeBlock.h:
        * bytecode/EvalCodeCache.h:
        * bytecode/Instruction.h:
        (JSC::PolymorphicAccessStructureList::visitAggregate):
        * bytecode/StructureStubInfo.cpp:
        (JSC::StructureStubInfo::visitAggregate):
        * bytecode/StructureStubInfo.h:
        * debugger/DebuggerActivation.cpp:
        (JSC::DebuggerActivation::visitChildren):
        * debugger/DebuggerActivation.h:
        * heap/HandleHeap.cpp:
        (JSC::WeakHandleOwner::isReachableFromOpaqueRoots):
        (JSC::HandleHeap::markStrongHandles):
        (JSC::HandleHeap::markWeakHandles):
        * heap/HandleHeap.h:
        * heap/HandleStack.cpp:
        (JSC::HandleStack::mark):
        * heap/HandleStack.h:
        * heap/Heap.cpp:
        (JSC::Heap::markProtectedObjects):
        (JSC::Heap::markTempSortVectors):
        (JSC::Heap::markRoots):
        * heap/Heap.h:
        * heap/MarkStack.cpp:
        (JSC::MarkStack::visitChildren):
        (JSC::MarkStack::drain):
        * heap/MarkStack.h:
        (JSC::HeapRootVisitor::HeapRootVisitor):
        (JSC::HeapRootVisitor::mark):
        (JSC::HeapRootVisitor::visitor):
        * heap/MarkedSpace.h:
        * runtime/ArgList.cpp:
        (JSC::MarkedArgumentBuffer::markLists):
        * runtime/ArgList.h:
        * runtime/Arguments.cpp:
        (JSC::Arguments::visitChildren):
        * runtime/Arguments.h:
        * runtime/Executable.cpp:
        (JSC::EvalExecutable::visitChildren):
        (JSC::ProgramExecutable::visitChildren):
        (JSC::FunctionExecutable::visitChildren):
        * runtime/Executable.h:
        * runtime/GetterSetter.cpp:
        (JSC::GetterSetter::visitChildren):
        * runtime/GetterSetter.h:
        (JSC::GetterSetter::createStructure):
        * runtime/JSAPIValueWrapper.h:
        (JSC::JSAPIValueWrapper::createStructure):
        * runtime/JSActivation.cpp:
        (JSC::JSActivation::visitChildren):
        * runtime/JSActivation.h:
        * runtime/JSArray.cpp:
        (JSC::JSArray::visitChildren):
        * runtime/JSArray.h:
        (JSC::JSArray::visitDirect):
        * runtime/JSCell.h:
        (JSC::JSCell::JSCell::visitChildren):
        * runtime/JSFunction.cpp:
        (JSC::JSFunction::visitChildren):
        * runtime/JSFunction.h:
        * runtime/JSGlobalObject.cpp:
        (JSC::visitIfNeeded):
        (JSC::JSGlobalObject::visitChildren):
        * runtime/JSGlobalObject.h:
        * runtime/JSONObject.cpp:
        * runtime/JSObject.cpp:
        (JSC::JSObject::visitChildren):
        * runtime/JSObject.h:
        (JSC::JSObject::visitDirect):
        * runtime/JSPropertyNameIterator.cpp:
        (JSC::JSPropertyNameIterator::visitChildren):
        * runtime/JSPropertyNameIterator.h:
        (JSC::JSPropertyNameIterator::createStructure):
        * runtime/JSStaticScopeObject.cpp:
        (JSC::JSStaticScopeObject::visitChildren):
        * runtime/JSStaticScopeObject.h:
        * runtime/JSTypeInfo.h:
        (JSC::TypeInfo::TypeInfo):
        (JSC::TypeInfo::overridesVisitChildren):
        * runtime/JSWrapperObject.cpp:
        (JSC::JSWrapperObject::visitChildren):
        * runtime/JSWrapperObject.h:
        * runtime/JSZombie.h:
        (JSC::JSZombie::visitChildren):
        * runtime/NativeErrorConstructor.cpp:
        (JSC::NativeErrorConstructor::visitChildren):
        * runtime/NativeErrorConstructor.h:
        * runtime/RegExpObject.cpp:
        (JSC::RegExpObject::visitChildren):
        * runtime/RegExpObject.h:
        * runtime/ScopeChain.cpp:
        (JSC::ScopeChainNode::visitChildren):
        * runtime/ScopeChain.h:
        * runtime/SmallStrings.cpp:
        (JSC::SmallStrings::visitChildren):
        * runtime/SmallStrings.h:
        * runtime/Structure.cpp:
        (JSC::Structure::Structure):
        (JSC::Structure::visitChildren):
        * runtime/Structure.h:
        * runtime/StructureChain.cpp:
        (JSC::StructureChain::visitChildren):
        * runtime/StructureChain.h:
        (JSC::StructureChain::createStructure):
2011-04-21  Oliver Hunt  <oliver@apple.com>

        Reviewed by Geoffrey Garen.

        Start moving to a general visitor pattern for GC traversal
        https://bugs.webkit.org/show_bug.cgi?id=59141

        This is just a rename:
            markChildren -> visitChildren
            markAggregate -> visitAggregate
            markStack -> visitor
            MarkStack -> typedef'd to SlotVisitor

        * UserObjectImp.cpp:
        (UserObjectImp::visitChildren):
2011-04-21  Oliver Hunt  <oliver@apple.com>

        Reviewed by Geoffrey Garen.

        Start moving to a general visitor pattern for GC traversal
        https://bugs.webkit.org/show_bug.cgi?id=59141

        This is just a rename:
            markChildren -> visitChildren
            markAggregate -> visitAggregate
            markStack -> visitor
            MarkStack -> typedef'd to SlotVisitor

        * bindings/js/JSAttrCustom.cpp:
        (WebCore::JSAttr::visitChildren):
        * bindings/js/JSAudioConstructor.cpp:
        (WebCore::constructAudio):
        * bindings/js/JSCSSRuleCustom.cpp:
        (WebCore::JSCSSRule::visitChildren):
        * bindings/js/JSCSSStyleDeclarationCustom.cpp:
        (WebCore::JSCSSStyleDeclaration::visitChildren):
        * bindings/js/JSDOMBinding.cpp:
        (WebCore::visitActiveObjectsForContext):
        (WebCore::markDOMObjectWrapper):
        * bindings/js/JSDOMBinding.h:
        * bindings/js/JSDOMGlobalObject.cpp:
        (WebCore::JSDOMGlobalObject::visitChildren):
        * bindings/js/JSDOMGlobalObject.h:
        * bindings/js/JSDOMImplementationCustom.cpp:
        (WebCore::JSDOMImplementation::visitChildren):
        * bindings/js/JSDOMWindowCustom.cpp:
        (WebCore::JSDOMWindow::visitChildren):
        * bindings/js/JSDOMWindowShell.cpp:
        (WebCore::JSDOMWindowShell::visitChildren):
        * bindings/js/JSDOMWindowShell.h:
        * bindings/js/JSDocumentCustom.cpp:
        (WebCore::JSDocument::visitChildren):
        * bindings/js/JSElementCustom.cpp:
        (WebCore::JSElement::visitChildren):
        * bindings/js/JSEventListener.cpp:
        (WebCore::JSEventListener::markJSFunction):
        * bindings/js/JSEventListener.h:
        * bindings/js/JSHTMLCanvasElementCustom.cpp:
        (WebCore::JSHTMLCanvasElement::visitChildren):
        * bindings/js/JSHTMLLinkElementCustom.cpp:
        (WebCore::JSHTMLLinkElement::visitChildren):
        * bindings/js/JSHTMLStyleElementCustom.cpp:
        (WebCore::JSHTMLStyleElement::visitChildren):
        * bindings/js/JSImageConstructor.cpp:
        (WebCore::constructImage):
        * bindings/js/JSJavaScriptAudioNodeCustom.cpp:
        (WebCore::JSJavaScriptAudioNode::visitChildren):
        * bindings/js/JSMessageChannelCustom.cpp:
        (WebCore::JSMessageChannel::visitChildren):
        * bindings/js/JSMessagePortCustom.cpp:
        (WebCore::JSMessagePort::visitChildren):
        * bindings/js/JSNamedNodeMapCustom.cpp:
        (WebCore::JSNamedNodeMapOwner::isReachableFromOpaqueRoots):
        (WebCore::JSNamedNodeMap::visitChildren):
        * bindings/js/JSNavigatorCustom.cpp:
        (WebCore::JSNavigator::visitChildren):
        * bindings/js/JSNodeCustom.cpp:
        (WebCore::isObservable):
        (WebCore::isReachableFromDOM):
        (WebCore::JSNodeOwner::isReachableFromOpaqueRoots):
        (WebCore::JSNode::visitChildren):
        * bindings/js/JSNodeCustom.h:
        * bindings/js/JSNodeFilterCondition.cpp:
        (WebCore::JSNodeFilterCondition::WeakOwner::isReachableFromOpaqueRoots):
        * bindings/js/JSNodeFilterCondition.h:
        * bindings/js/JSNodeFilterCustom.cpp:
        (WebCore::JSNodeFilter::visitChildren):
        * bindings/js/JSNodeIteratorCustom.cpp:
        (WebCore::JSNodeIterator::visitChildren):
        * bindings/js/JSNodeListCustom.cpp:
        (WebCore::JSNodeListOwner::isReachableFromOpaqueRoots):
        * bindings/js/JSProcessingInstructionCustom.cpp:
        (WebCore::JSProcessingInstruction::visitChildren):
        * bindings/js/JSSVGElementInstanceCustom.cpp:
        (WebCore::JSSVGElementInstance::visitChildren):
        * bindings/js/JSSharedWorkerCustom.cpp:
        (WebCore::JSSharedWorker::visitChildren):
        * bindings/js/JSStyleSheetCustom.cpp:
        (WebCore::JSStyleSheet::visitChildren):
        * bindings/js/JSTreeWalkerCustom.cpp:
        (WebCore::JSTreeWalker::visitChildren):
        * bindings/js/JSWebGLRenderingContextCustom.cpp:
        (WebCore::JSWebGLRenderingContext::visitChildren):
        * bindings/js/JSWebKitAnimationListCustom.cpp:
        (WebCore::JSWebKitAnimationList::visitChildren):
        * bindings/js/JSWorkerContextCustom.cpp:
        (WebCore::JSWorkerContext::visitChildren):
        * bindings/js/JSXMLHttpRequestCustom.cpp:
        (WebCore::JSXMLHttpRequest::visitChildren):
        * bindings/js/JSXMLHttpRequestUploadCustom.cpp:
        (WebCore::JSXMLHttpRequestUpload::visitChildren):
        * bindings/scripts/CodeGeneratorJS.pm:
        * bridge/qt/qt_instance.cpp:
        (JSC::Bindings::QtRuntimeObject::visitChildren):
        (JSC::Bindings::QtInstance::markAggregate):
        * bridge/qt/qt_instance.h:
        * bridge/qt/qt_pixmapruntime.cpp:
        * bridge/qt/qt_runtime.cpp:
        (JSC::Bindings::QtRuntimeMetaMethod::visitChildren):
        * bridge/qt/qt_runtime.h:
        * dom/EventListener.h:
        (WebCore::EventListener::visitJSFunction):
        * dom/EventTarget.h:
        (WebCore::EventTarget::visitJSEventListeners):
        * dom/Node.h:
        * dom/NodeFilterCondition.h:
        (WebCore::NodeFilterCondition::visitAggregate):
        * page/DOMWindow.h:
        * workers/WorkerContext.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@84556 268f45cc-cd09-0410-ab3c-d52691b4dbfc

120 files changed:
Source/JavaScriptCore/API/JSCallbackObject.h
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/JavaScriptCore.exp
Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
Source/JavaScriptCore/bytecode/CodeBlock.cpp
Source/JavaScriptCore/bytecode/CodeBlock.h
Source/JavaScriptCore/bytecode/EvalCodeCache.h
Source/JavaScriptCore/bytecode/Instruction.h
Source/JavaScriptCore/bytecode/StructureStubInfo.cpp
Source/JavaScriptCore/bytecode/StructureStubInfo.h
Source/JavaScriptCore/debugger/DebuggerActivation.cpp
Source/JavaScriptCore/debugger/DebuggerActivation.h
Source/JavaScriptCore/heap/HandleHeap.cpp
Source/JavaScriptCore/heap/HandleHeap.h
Source/JavaScriptCore/heap/HandleStack.cpp
Source/JavaScriptCore/heap/HandleStack.h
Source/JavaScriptCore/heap/Heap.cpp
Source/JavaScriptCore/heap/Heap.h
Source/JavaScriptCore/heap/MarkStack.cpp
Source/JavaScriptCore/heap/MarkStack.h
Source/JavaScriptCore/heap/MarkedSpace.h
Source/JavaScriptCore/runtime/ArgList.cpp
Source/JavaScriptCore/runtime/ArgList.h
Source/JavaScriptCore/runtime/Arguments.cpp
Source/JavaScriptCore/runtime/Arguments.h
Source/JavaScriptCore/runtime/Executable.cpp
Source/JavaScriptCore/runtime/Executable.h
Source/JavaScriptCore/runtime/GetterSetter.cpp
Source/JavaScriptCore/runtime/GetterSetter.h
Source/JavaScriptCore/runtime/JSAPIValueWrapper.h
Source/JavaScriptCore/runtime/JSActivation.cpp
Source/JavaScriptCore/runtime/JSActivation.h
Source/JavaScriptCore/runtime/JSArray.cpp
Source/JavaScriptCore/runtime/JSArray.h
Source/JavaScriptCore/runtime/JSCell.h
Source/JavaScriptCore/runtime/JSFunction.cpp
Source/JavaScriptCore/runtime/JSFunction.h
Source/JavaScriptCore/runtime/JSGlobalObject.cpp
Source/JavaScriptCore/runtime/JSGlobalObject.h
Source/JavaScriptCore/runtime/JSONObject.cpp
Source/JavaScriptCore/runtime/JSObject.cpp
Source/JavaScriptCore/runtime/JSObject.h
Source/JavaScriptCore/runtime/JSPropertyNameIterator.cpp
Source/JavaScriptCore/runtime/JSPropertyNameIterator.h
Source/JavaScriptCore/runtime/JSStaticScopeObject.cpp
Source/JavaScriptCore/runtime/JSStaticScopeObject.h
Source/JavaScriptCore/runtime/JSTypeInfo.h
Source/JavaScriptCore/runtime/JSWrapperObject.cpp
Source/JavaScriptCore/runtime/JSWrapperObject.h
Source/JavaScriptCore/runtime/JSZombie.h
Source/JavaScriptCore/runtime/NativeErrorConstructor.cpp
Source/JavaScriptCore/runtime/NativeErrorConstructor.h
Source/JavaScriptCore/runtime/RegExpObject.cpp
Source/JavaScriptCore/runtime/RegExpObject.h
Source/JavaScriptCore/runtime/ScopeChain.cpp
Source/JavaScriptCore/runtime/ScopeChain.h
Source/JavaScriptCore/runtime/SmallStrings.cpp
Source/JavaScriptCore/runtime/SmallStrings.h
Source/JavaScriptCore/runtime/Structure.cpp
Source/JavaScriptCore/runtime/Structure.h
Source/JavaScriptCore/runtime/StructureChain.cpp
Source/JavaScriptCore/runtime/StructureChain.h
Source/JavaScriptGlue/ChangeLog
Source/JavaScriptGlue/UserObjectImp.cpp
Source/JavaScriptGlue/UserObjectImp.h
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSAttrCustom.cpp
Source/WebCore/bindings/js/JSAudioConstructor.cpp
Source/WebCore/bindings/js/JSCSSRuleCustom.cpp
Source/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp
Source/WebCore/bindings/js/JSDOMBinding.cpp
Source/WebCore/bindings/js/JSDOMBinding.h
Source/WebCore/bindings/js/JSDOMGlobalObject.cpp
Source/WebCore/bindings/js/JSDOMGlobalObject.h
Source/WebCore/bindings/js/JSDOMImplementationCustom.cpp
Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
Source/WebCore/bindings/js/JSDOMWindowShell.cpp
Source/WebCore/bindings/js/JSDOMWindowShell.h
Source/WebCore/bindings/js/JSDocumentCustom.cpp
Source/WebCore/bindings/js/JSElementCustom.cpp
Source/WebCore/bindings/js/JSEventListener.cpp
Source/WebCore/bindings/js/JSEventListener.h
Source/WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp
Source/WebCore/bindings/js/JSHTMLLinkElementCustom.cpp
Source/WebCore/bindings/js/JSHTMLStyleElementCustom.cpp
Source/WebCore/bindings/js/JSImageConstructor.cpp
Source/WebCore/bindings/js/JSJavaScriptAudioNodeCustom.cpp
Source/WebCore/bindings/js/JSMessageChannelCustom.cpp
Source/WebCore/bindings/js/JSMessagePortCustom.cpp
Source/WebCore/bindings/js/JSNamedNodeMapCustom.cpp
Source/WebCore/bindings/js/JSNavigatorCustom.cpp
Source/WebCore/bindings/js/JSNodeCustom.cpp
Source/WebCore/bindings/js/JSNodeCustom.h
Source/WebCore/bindings/js/JSNodeFilterCondition.cpp
Source/WebCore/bindings/js/JSNodeFilterCondition.h
Source/WebCore/bindings/js/JSNodeFilterCustom.cpp
Source/WebCore/bindings/js/JSNodeIteratorCustom.cpp
Source/WebCore/bindings/js/JSNodeListCustom.cpp
Source/WebCore/bindings/js/JSProcessingInstructionCustom.cpp
Source/WebCore/bindings/js/JSSVGElementInstanceCustom.cpp
Source/WebCore/bindings/js/JSSharedWorkerCustom.cpp
Source/WebCore/bindings/js/JSStyleSheetCustom.cpp
Source/WebCore/bindings/js/JSTreeWalkerCustom.cpp
Source/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp
Source/WebCore/bindings/js/JSWebKitAnimationListCustom.cpp
Source/WebCore/bindings/js/JSWorkerContextCustom.cpp
Source/WebCore/bindings/js/JSXMLHttpRequestCustom.cpp
Source/WebCore/bindings/js/JSXMLHttpRequestUploadCustom.cpp
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bridge/qt/qt_instance.cpp
Source/WebCore/bridge/qt/qt_instance.h
Source/WebCore/bridge/qt/qt_pixmapruntime.cpp
Source/WebCore/bridge/qt/qt_runtime.cpp
Source/WebCore/bridge/qt/qt_runtime.h
Source/WebCore/dom/EventListener.h
Source/WebCore/dom/EventTarget.h
Source/WebCore/dom/Node.h
Source/WebCore/dom/NodeFilterCondition.h
Source/WebCore/page/DOMWindow.h
Source/WebCore/workers/WorkerContext.h

index d2e0dcb..338d057 100644 (file)
@@ -68,11 +68,11 @@ struct JSCallbackObjectData : WeakHandleOwner {
         m_privateProperties->deletePrivateProperty(propertyName);
     }
 
-    void markChildren(MarkStack& markStack)
+    void visitChildren(SlotVisitor& visitor)
     {
         if (!m_privateProperties)
             return;
-        m_privateProperties->markChildren(markStack);
+        m_privateProperties->visitChildren(visitor);
     }
 
     void* privateData;
@@ -97,11 +97,11 @@ struct JSCallbackObjectData : WeakHandleOwner {
             m_propertyMap.remove(propertyName.impl());
         }
 
-        void markChildren(MarkStack& markStack)
+        void visitChildren(SlotVisitor& visitor)
         {
             for (PrivatePropertyMap::iterator ptr = m_propertyMap.begin(); ptr != m_propertyMap.end(); ++ptr) {
                 if (ptr->second)
-                    markStack.append(&ptr->second);
+                    visitor.append(&ptr->second);
             }
         }
 
@@ -149,7 +149,7 @@ public:
     }
 
 protected:
-    static const unsigned StructureFlags = OverridesGetOwnPropertySlot | ImplementsHasInstance | OverridesHasInstance | OverridesMarkChildren | OverridesGetPropertyNames | Base::StructureFlags;
+    static const unsigned StructureFlags = OverridesGetOwnPropertySlot | ImplementsHasInstance | OverridesHasInstance | OverridesVisitChildren | OverridesGetPropertyNames | Base::StructureFlags;
 
 private:
     virtual UString className() const;
@@ -172,10 +172,10 @@ private:
     virtual ConstructType getConstructData(ConstructData&);
     virtual CallType getCallData(CallData&);
 
-    virtual void markChildren(MarkStack& markStack)
+    virtual void visitChildren(SlotVisitor& visitor)
     {
-        Base::markChildren(markStack);
-        m_callbackObjectData->markChildren(markStack);
+        Base::visitChildren(visitor);
+        m_callbackObjectData->visitChildren(visitor);
     }
 
     void init(ExecState*);
index 4cc445e..50f0823 100644 (file)
@@ -1,3 +1,130 @@
+2011-04-21  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Geoffrey Garen.
+
+        Start moving to a general visitor pattern for GC traversal
+        https://bugs.webkit.org/show_bug.cgi?id=59141
+
+        This is just a rename:
+            markChildren -> visitChildren
+            markAggregate -> visitAggregate
+            markStack -> visitor
+            MarkStack -> typedef'd to SlotVisitor
+
+        * API/JSCallbackObject.h:
+        (JSC::JSCallbackObjectData::visitChildren):
+        (JSC::JSCallbackObjectData::JSPrivatePropertyMap::visitChildren):
+        (JSC::JSCallbackObject::visitChildren):
+        * JavaScriptCore.exp:
+        * bytecode/CodeBlock.cpp:
+        (JSC::CodeBlock::visitStructures):
+        (JSC::EvalCodeCache::visitAggregate):
+        (JSC::CodeBlock::visitAggregate):
+        * bytecode/CodeBlock.h:
+        * bytecode/EvalCodeCache.h:
+        * bytecode/Instruction.h:
+        (JSC::PolymorphicAccessStructureList::visitAggregate):
+        * bytecode/StructureStubInfo.cpp:
+        (JSC::StructureStubInfo::visitAggregate):
+        * bytecode/StructureStubInfo.h:
+        * debugger/DebuggerActivation.cpp:
+        (JSC::DebuggerActivation::visitChildren):
+        * debugger/DebuggerActivation.h:
+        * heap/HandleHeap.cpp:
+        (JSC::WeakHandleOwner::isReachableFromOpaqueRoots):
+        (JSC::HandleHeap::markStrongHandles):
+        (JSC::HandleHeap::markWeakHandles):
+        * heap/HandleHeap.h:
+        * heap/HandleStack.cpp:
+        (JSC::HandleStack::mark):
+        * heap/HandleStack.h:
+        * heap/Heap.cpp:
+        (JSC::Heap::markProtectedObjects):
+        (JSC::Heap::markTempSortVectors):
+        (JSC::Heap::markRoots):
+        * heap/Heap.h:
+        * heap/MarkStack.cpp:
+        (JSC::MarkStack::visitChildren):
+        (JSC::MarkStack::drain):
+        * heap/MarkStack.h:
+        (JSC::HeapRootVisitor::HeapRootVisitor):
+        (JSC::HeapRootVisitor::mark):
+        (JSC::HeapRootVisitor::visitor):
+        * heap/MarkedSpace.h:
+        * runtime/ArgList.cpp:
+        (JSC::MarkedArgumentBuffer::markLists):
+        * runtime/ArgList.h:
+        * runtime/Arguments.cpp:
+        (JSC::Arguments::visitChildren):
+        * runtime/Arguments.h:
+        * runtime/Executable.cpp:
+        (JSC::EvalExecutable::visitChildren):
+        (JSC::ProgramExecutable::visitChildren):
+        (JSC::FunctionExecutable::visitChildren):
+        * runtime/Executable.h:
+        * runtime/GetterSetter.cpp:
+        (JSC::GetterSetter::visitChildren):
+        * runtime/GetterSetter.h:
+        (JSC::GetterSetter::createStructure):
+        * runtime/JSAPIValueWrapper.h:
+        (JSC::JSAPIValueWrapper::createStructure):
+        * runtime/JSActivation.cpp:
+        (JSC::JSActivation::visitChildren):
+        * runtime/JSActivation.h:
+        * runtime/JSArray.cpp:
+        (JSC::JSArray::visitChildren):
+        * runtime/JSArray.h:
+        (JSC::JSArray::visitDirect):
+        * runtime/JSCell.h:
+        (JSC::JSCell::JSCell::visitChildren):
+        * runtime/JSFunction.cpp:
+        (JSC::JSFunction::visitChildren):
+        * runtime/JSFunction.h:
+        * runtime/JSGlobalObject.cpp:
+        (JSC::visitIfNeeded):
+        (JSC::JSGlobalObject::visitChildren):
+        * runtime/JSGlobalObject.h:
+        * runtime/JSONObject.cpp:
+        * runtime/JSObject.cpp:
+        (JSC::JSObject::visitChildren):
+        * runtime/JSObject.h:
+        (JSC::JSObject::visitDirect):
+        * runtime/JSPropertyNameIterator.cpp:
+        (JSC::JSPropertyNameIterator::visitChildren):
+        * runtime/JSPropertyNameIterator.h:
+        (JSC::JSPropertyNameIterator::createStructure):
+        * runtime/JSStaticScopeObject.cpp:
+        (JSC::JSStaticScopeObject::visitChildren):
+        * runtime/JSStaticScopeObject.h:
+        * runtime/JSTypeInfo.h:
+        (JSC::TypeInfo::TypeInfo):
+        (JSC::TypeInfo::overridesVisitChildren):
+        * runtime/JSWrapperObject.cpp:
+        (JSC::JSWrapperObject::visitChildren):
+        * runtime/JSWrapperObject.h:
+        * runtime/JSZombie.h:
+        (JSC::JSZombie::visitChildren):
+        * runtime/NativeErrorConstructor.cpp:
+        (JSC::NativeErrorConstructor::visitChildren):
+        * runtime/NativeErrorConstructor.h:
+        * runtime/RegExpObject.cpp:
+        (JSC::RegExpObject::visitChildren):
+        * runtime/RegExpObject.h:
+        * runtime/ScopeChain.cpp:
+        (JSC::ScopeChainNode::visitChildren):
+        * runtime/ScopeChain.h:
+        * runtime/SmallStrings.cpp:
+        (JSC::SmallStrings::visitChildren):
+        * runtime/SmallStrings.h:
+        * runtime/Structure.cpp:
+        (JSC::Structure::Structure):
+        (JSC::Structure::visitChildren):
+        * runtime/Structure.h:
+        * runtime/StructureChain.cpp:
+        (JSC::StructureChain::visitChildren):
+        * runtime/StructureChain.h:
+        (JSC::StructureChain::createStructure):
+
 2011-04-21  Sheriff Bot  <webkit.review.bot@gmail.com>
 
         Unreviewed, rolling out r84548.
index 1b00c66..f33a38c 100644 (file)
@@ -156,7 +156,7 @@ __ZN3JSC13StatementNode6setLocEii
 __ZN3JSC14JSGlobalObject10globalExecEv
 __ZN3JSC14JSGlobalObject12defineGetterEPNS_9ExecStateERKNS_10IdentifierEPNS_8JSObjectEj
 __ZN3JSC14JSGlobalObject12defineSetterEPNS_9ExecStateERKNS_10IdentifierEPNS_8JSObjectEj
-__ZN3JSC14JSGlobalObject12markChildrenERNS_9MarkStackE
+__ZN3JSC14JSGlobalObject13visitChildrenERNS_9MarkStackE
 __ZN3JSC14JSGlobalObject17putWithAttributesEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueEj
 __ZN3JSC14JSGlobalObject3putEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueERNS_15PutPropertySlotE  
 __ZN3JSC14JSGlobalObject4initEPNS_8JSObjectE
@@ -168,7 +168,7 @@ __ZN3JSC14SamplingThread5startEj
 __ZN3JSC14TimeoutChecker10didTimeOutEPNS_9ExecStateE
 __ZN3JSC14TimeoutChecker5resetEv
 __ZN3JSC14throwTypeErrorEPNS_9ExecStateE
-__ZN3JSC15JSWrapperObject12markChildrenERNS_9MarkStackE
+__ZN3JSC15JSWrapperObject13visitChildrenERNS_9MarkStackE
 __ZN3JSC15WeakHandleOwner26isReachableFromOpaqueRootsENS_6HandleINS_7UnknownEEEPvRNS_9MarkStackE
 __ZN3JSC15WeakHandleOwner8finalizeENS_6HandleINS_7UnknownEEEPv
 __ZN3JSC15WeakHandleOwnerD2Ev
@@ -252,7 +252,7 @@ __ZN3JSC6JSLock9lockCountEv
 __ZN3JSC6JSLockC1EPNS_9ExecStateE
 __ZN3JSC6RegExp6createEPNS_12JSGlobalDataERKNS_7UStringENS_11RegExpFlagsE
 __ZN3JSC6RegExpD1Ev
-__ZN3JSC7JSArray12markChildrenERNS_9MarkStackE
+__ZN3JSC7JSArray13visitChildrenERNS_9MarkStackE
 __ZN3JSC7JSArray15setSubclassDataEPv
 __ZN3JSC7JSArray18getOwnPropertySlotEPNS_9ExecStateEjRNS_12PropertySlotE
 __ZN3JSC7JSArray6s_infoE
@@ -284,7 +284,7 @@ __ZN3JSC8JSObject12defineGetterEPNS_9ExecStateERKNS_10IdentifierEPS0_j
 __ZN3JSC8JSObject12defineSetterEPNS_9ExecStateERKNS_10IdentifierEPS0_j
 __ZN3JSC8JSObject12lookupGetterEPNS_9ExecStateERKNS_10IdentifierE
 __ZN3JSC8JSObject12lookupSetterEPNS_9ExecStateERKNS_10IdentifierE
-__ZN3JSC8JSObject12markChildrenERNS_9MarkStackE
+__ZN3JSC8JSObject13visitChildrenERNS_9MarkStackE
 __ZN3JSC8JSObject14deletePropertyEPNS_9ExecStateERKNS_10IdentifierE
 __ZN3JSC8JSObject14deletePropertyEPNS_9ExecStateEj
 __ZN3JSC8JSObject15unwrappedObjectEv
@@ -306,7 +306,7 @@ __ZN3JSC8JSObject22fillGetterPropertySlotERNS_12PropertySlotEPNS_16WriteBarrierB
 __ZN3JSC8JSObject23allocatePropertyStorageEmm
 __ZN3JSC8JSObject24getOwnPropertyDescriptorEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE
 __ZN3JSC8JSObject3putEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueERNS_15PutPropertySlotE
-__ZN3JSC8JSObject3putEPNS_9ExecStateEjNS_7JSValueE  
+__ZN3JSC8JSObject3putEPNS_9ExecStateEjNS_7JSValueE
 __ZN3JSC8JSObject6s_infoE
 __ZN3JSC8Profiler13stopProfilingEPNS_9ExecStateERKNS_7UStringE
 __ZN3JSC8Profiler14startProfilingEPNS_9ExecStateERKNS_7UStringE
index 0fa73f1..8be66a8 100644 (file)
@@ -237,10 +237,10 @@ EXPORTS
     ?lockCount@JSLock@JSC@@SAHXZ
     ?lookupGetter@JSObject@JSC@@UAE?AVJSValue@2@PAVExecState@2@ABVIdentifier@2@@Z
     ?lookupSetter@JSObject@JSC@@UAE?AVJSValue@2@PAVExecState@2@ABVIdentifier@2@@Z
-    ?markChildren@JSGlobalObject@JSC@@UAEXAAVMarkStack@2@@Z
-    ?markChildren@JSObject@JSC@@UAEXAAVMarkStack@2@@Z
-    ?markChildren@JSWrapperObject@JSC@@EAEXAAVMarkStack@2@@Z
-    ?markChildren@ScopeChainNode@JSC@@UAEXAAVMarkStack@2@@Z
+    ?visitChildren@JSGlobalObject@JSC@@UAEXAAVMarkStack@2@@Z
+    ?visitChildren@JSObject@JSC@@UAEXAAVMarkStack@2@@Z
+    ?visitChildren@JSWrapperObject@JSC@@EAEXAAVMarkStack@2@@Z
+    ?visitChildren@ScopeChainNode@JSC@@UAEXAAVMarkStack@2@@Z
     ?materializePropertyMap@Structure@JSC@@AAEXAAVJSGlobalData@2@@Z
     ?monthFromDayInYear@WTF@@YAHH_N@Z
     ?msToYear@WTF@@YAHN@Z
index 0e648ba..46052b2 100644 (file)
@@ -1400,37 +1400,37 @@ CodeBlock::~CodeBlock()
 #endif
 }
 
-void CodeBlock::markStructures(MarkStack& markStack, Instruction* vPC) const
+void CodeBlock::visitStructures(SlotVisitor& visitor, Instruction* vPC) const
 {
     Interpreter* interpreter = m_globalData->interpreter;
 
     if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_self) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_getter_self) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_custom_self)) {
-        markStack.append(&vPC[4].u.structure);
+        visitor.append(&vPC[4].u.structure);
         return;
     }
     if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_proto) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_getter_proto) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_custom_proto)) {
-        markStack.append(&vPC[4].u.structure);
-        markStack.append(&vPC[5].u.structure);
+        visitor.append(&vPC[4].u.structure);
+        visitor.append(&vPC[5].u.structure);
         return;
     }
     if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_chain) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_getter_chain) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_custom_chain)) {
-        markStack.append(&vPC[4].u.structure);
-        markStack.append(&vPC[5].u.structureChain);
+        visitor.append(&vPC[4].u.structure);
+        visitor.append(&vPC[5].u.structureChain);
         return;
     }
     if (vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id_transition)) {
-        markStack.append(&vPC[4].u.structure);
-        markStack.append(&vPC[5].u.structure);
-        markStack.append(&vPC[6].u.structureChain);
+        visitor.append(&vPC[4].u.structure);
+        visitor.append(&vPC[5].u.structure);
+        visitor.append(&vPC[6].u.structureChain);
         return;
     }
     if (vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id_replace)) {
-        markStack.append(&vPC[4].u.structure);
+        visitor.append(&vPC[4].u.structure);
         return;
     }
     if (vPC[0].u.opcode == interpreter->getOpcode(op_resolve_global) || vPC[0].u.opcode == interpreter->getOpcode(op_resolve_global_dynamic)) {
         if (vPC[3].u.structure)
-            markStack.append(&vPC[3].u.structure);
+            visitor.append(&vPC[3].u.structure);
         return;
     }
     if ((vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_proto_list))
@@ -1440,7 +1440,7 @@ void CodeBlock::markStructures(MarkStack& markStack, Instruction* vPC) const
         || (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_custom_proto_list))
         || (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_custom_self_list))) {
         PolymorphicAccessStructureList* polymorphicStructures = vPC[4].u.polymorphicStructures;
-        polymorphicStructures->markAggregate(markStack, vPC[5].u.operand);
+        polymorphicStructures->visitAggregate(visitor, vPC[5].u.operand);
         delete polymorphicStructures;
         return;
     }
@@ -1449,48 +1449,48 @@ void CodeBlock::markStructures(MarkStack& markStack, Instruction* vPC) const
     ASSERT(vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id) || vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_generic) || vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id_generic) || vPC[0].u.opcode == interpreter->getOpcode(op_get_array_length) || vPC[0].u.opcode == interpreter->getOpcode(op_get_string_length));
 }
 
-void EvalCodeCache::markAggregate(MarkStack& markStack)
+void EvalCodeCache::visitAggregate(SlotVisitor& visitor)
 {
     EvalCacheMap::iterator end = m_cacheMap.end();
     for (EvalCacheMap::iterator ptr = m_cacheMap.begin(); ptr != end; ++ptr)
-        markStack.append(&ptr->second);
+        visitor.append(&ptr->second);
 }
 
-void CodeBlock::markAggregate(MarkStack& markStack)
+void CodeBlock::visitAggregate(SlotVisitor& visitor)
 {
-    markStack.append(&m_globalObject);
-    markStack.append(&m_ownerExecutable);
+    visitor.append(&m_globalObject);
+    visitor.append(&m_ownerExecutable);
     if (m_rareData)
-        m_rareData->m_evalCodeCache.markAggregate(markStack);
-    markStack.appendValues(m_constantRegisters.data(), m_constantRegisters.size());
+        m_rareData->m_evalCodeCache.visitAggregate(visitor);
+    visitor.appendValues(m_constantRegisters.data(), m_constantRegisters.size());
     for (size_t i = 0; i < m_functionExprs.size(); ++i)
-        markStack.append(&m_functionExprs[i]);
+        visitor.append(&m_functionExprs[i]);
     for (size_t i = 0; i < m_functionDecls.size(); ++i)
-        markStack.append(&m_functionDecls[i]);
+        visitor.append(&m_functionDecls[i]);
 #if ENABLE(JIT_OPTIMIZE_CALL)
     for (unsigned i = 0; i < numberOfCallLinkInfos(); ++i)
         if (callLinkInfo(i).isLinked())
-            markStack.append(&callLinkInfo(i).callee);
+            visitor.append(&callLinkInfo(i).callee);
 #endif
 #if ENABLE(INTERPRETER)
     for (size_t size = m_propertyAccessInstructions.size(), i = 0; i < size; ++i)
-        markStructures(markStack, &m_instructions[m_propertyAccessInstructions[i]]);
+        markStructures(visitor, &m_instructions[m_propertyAccessInstructions[i]]);
 #endif
 #if ENABLE(JIT)
     for (size_t size = m_globalResolveInfos.size(), i = 0; i < size; ++i) {
         if (m_globalResolveInfos[i].structure)
-            markStack.append(&m_globalResolveInfos[i].structure);
+            visitor.append(&m_globalResolveInfos[i].structure);
     }
 
     for (size_t size = m_structureStubInfos.size(), i = 0; i < size; ++i)
-        m_structureStubInfos[i].markAggregate(markStack);
+        m_structureStubInfos[i].visitAggregate(visitor);
 
     for (size_t size = m_methodCallLinkInfos.size(), i = 0; i < size; ++i) {
         if (m_methodCallLinkInfos[i].cachedStructure) {
             // Both members must be filled at the same time
-            markStack.append(&m_methodCallLinkInfos[i].cachedStructure);
+            visitor.append(&m_methodCallLinkInfos[i].cachedStructure);
             ASSERT(!!m_methodCallLinkInfos[i].cachedPrototypeStructure);
-            markStack.append(&m_methodCallLinkInfos[i].cachedPrototypeStructure);
+            visitor.append(&m_methodCallLinkInfos[i].cachedPrototypeStructure);
         }
     }
 #endif
index af68eb5..5053636 100644 (file)
@@ -211,7 +211,7 @@ namespace JSC {
     public:
         virtual ~CodeBlock();
 
-        void markAggregate(MarkStack&);
+        void visitAggregate(SlotVisitor&);
 
         static void dumpStatistics();
 
@@ -481,7 +481,7 @@ namespace JSC {
         void printGetByIdOp(ExecState*, int location, Vector<Instruction>::const_iterator&, const char* op) const;
         void printPutByIdOp(ExecState*, int location, Vector<Instruction>::const_iterator&, const char* op) const;
 #endif
-        void markStructures(MarkStack&, Instruction* vPC) const;
+        void visitStructures(SlotVisitor&, Instruction* vPC) const;
 
         void createRareDataIfNecessary()
         {
index 3e450b1..df937dd 100644 (file)
@@ -42,6 +42,7 @@
 namespace JSC {
 
     class MarkStack;
+    typedef MarkStack SlotVisitor;
 
     class EvalCodeCache {
     public:
@@ -67,7 +68,7 @@ namespace JSC {
 
         bool isEmpty() const { return m_cacheMap.isEmpty(); }
 
-        void markAggregate(MarkStack&);
+        void visitAggregate(SlotVisitor&);
 
     private:
         static const unsigned maxCacheableSourceLength = 256;
index d9cbb11..866846c 100644 (file)
@@ -107,17 +107,17 @@ namespace JSC {
             list[0].set(globalData, owner, stubRoutine, firstBase, firstChain);
         }
 
-        void markAggregate(MarkStack& markStack, int count)
+        void visitAggregate(SlotVisitor& visitor, int count)
         {
             for (int i = 0; i < count; ++i) {
                 PolymorphicStubInfo& info = list[i];
                 ASSERT(info.base);
                 
-                markStack.append(&info.base);
+                visitor.append(&info.base);
                 if (info.u.proto && !info.isChain)
-                    markStack.append(&info.u.proto);
+                    visitor.append(&info.u.proto);
                 if (info.u.chain && info.isChain)
-                    markStack.append(&info.u.chain);
+                    visitor.append(&info.u.chain);
             }
         }
     };
index be5760a..9dd41a6 100644 (file)
@@ -63,37 +63,37 @@ void StructureStubInfo::deref()
     }
 }
 
-void StructureStubInfo::markAggregate(MarkStack& markStack)
+void StructureStubInfo::visitAggregate(SlotVisitor& visitor)
 {
     switch (accessType) {
     case access_get_by_id_self:
-        markStack.append(&u.getByIdSelf.baseObjectStructure);
+        visitor.append(&u.getByIdSelf.baseObjectStructure);
         return;
     case access_get_by_id_proto:
-        markStack.append(&u.getByIdProto.baseObjectStructure);
-        markStack.append(&u.getByIdProto.prototypeStructure);
+        visitor.append(&u.getByIdProto.baseObjectStructure);
+        visitor.append(&u.getByIdProto.prototypeStructure);
         return;
     case access_get_by_id_chain:
-        markStack.append(&u.getByIdChain.baseObjectStructure);
-        markStack.append(&u.getByIdChain.chain);
+        visitor.append(&u.getByIdChain.baseObjectStructure);
+        visitor.append(&u.getByIdChain.chain);
         return;
     case access_get_by_id_self_list: {
         PolymorphicAccessStructureList* polymorphicStructures = u.getByIdSelfList.structureList;
-        polymorphicStructures->markAggregate(markStack, u.getByIdSelfList.listSize);
+        polymorphicStructures->visitAggregate(visitor, u.getByIdSelfList.listSize);
         return;
     }
     case access_get_by_id_proto_list: {
         PolymorphicAccessStructureList* polymorphicStructures = u.getByIdProtoList.structureList;
-        polymorphicStructures->markAggregate(markStack, u.getByIdProtoList.listSize);
+        polymorphicStructures->visitAggregate(visitor, u.getByIdProtoList.listSize);
         return;
     }
     case access_put_by_id_transition:
-        markStack.append(&u.putByIdTransition.previousStructure);
-        markStack.append(&u.putByIdTransition.structure);
-        markStack.append(&u.putByIdTransition.chain);
+        visitor.append(&u.putByIdTransition.previousStructure);
+        visitor.append(&u.putByIdTransition.structure);
+        visitor.append(&u.putByIdTransition.chain);
         return;
     case access_put_by_id_replace:
-        markStack.append(&u.putByIdReplace.baseObjectStructure);
+        visitor.append(&u.putByIdReplace.baseObjectStructure);
         return;
     case access_get_by_id:
     case access_put_by_id:
index bfeeb1e..7f11edd 100644 (file)
@@ -116,7 +116,7 @@ namespace JSC {
         }
 
         void deref();
-        void markAggregate(MarkStack&);
+        void visitAggregate(SlotVisitor&);
 
         bool seenOnce()
         {
index 67a796a..47dcd7f 100644 (file)
@@ -38,12 +38,12 @@ DebuggerActivation::DebuggerActivation(JSGlobalData& globalData, JSObject* activ
     m_activation.set(globalData, this, static_cast<JSActivation*>(activation));
 }
 
-void DebuggerActivation::markChildren(MarkStack& markStack)
+void DebuggerActivation::visitChildren(SlotVisitor& visitor)
 {
-    JSObject::markChildren(markStack);
+    JSObject::visitChildren(visitor);
 
     if (m_activation)
-        markStack.append(&m_activation);
+        visitor.append(&m_activation);
 }
 
 UString DebuggerActivation::className() const
index bfb36db..574986a 100644 (file)
@@ -36,7 +36,7 @@ namespace JSC {
     public:
         DebuggerActivation(JSGlobalData&, JSObject*);
 
-        virtual void markChildren(MarkStack&);
+        virtual void visitChildren(SlotVisitor&);
         virtual UString className() const;
         virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&);
         virtual void put(ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
@@ -55,7 +55,7 @@ namespace JSC {
         }
 
     protected:
-        static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesMarkChildren | JSObject::StructureFlags;
+        static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesVisitChildren | JSObject::StructureFlags;
 
     private:
         WriteBarrier<JSActivation> m_activation;
index 1a0051e..9b05db2 100644 (file)
@@ -34,7 +34,7 @@ WeakHandleOwner::~WeakHandleOwner()
 {
 }
 
-bool WeakHandleOwner::isReachableFromOpaqueRoots(Handle<Unknown>, void*, MarkStack&)
+bool WeakHandleOwner::isReachableFromOpaqueRoots(Handle<Unknown>, void*, SlotVisitor&)
 {
     return false;
 }
@@ -60,16 +60,16 @@ void HandleHeap::grow()
     }
 }
 
-void HandleHeap::markStrongHandles(HeapRootMarker& heapRootMarker)
+void HandleHeap::markStrongHandles(HeapRootVisitor& heapRootMarker)
 {
     Node* end = m_strongList.end();
     for (Node* node = m_strongList.begin(); node != end; node = node->next())
         heapRootMarker.mark(node->slot());
 }
 
-void HandleHeap::markWeakHandles(HeapRootMarker& heapRootMarker)
+void HandleHeap::markWeakHandles(HeapRootVisitor& heapRootVisitor)
 {
-    MarkStack& markStack = heapRootMarker.markStack();
+    SlotVisitor& visitor = heapRootVisitor.visitor();
 
     Node* end = m_weakList.end();
     for (Node* node = m_weakList.begin(); node != end; node = node->next()) {
@@ -82,10 +82,10 @@ void HandleHeap::markWeakHandles(HeapRootMarker& heapRootMarker)
         if (!weakOwner)
             continue;
 
-        if (!weakOwner->isReachableFromOpaqueRoots(Handle<Unknown>::wrapSlot(node->slot()), node->weakOwnerContext(), markStack))
+        if (!weakOwner->isReachableFromOpaqueRoots(Handle<Unknown>::wrapSlot(node->slot()), node->weakOwnerContext(), visitor))
             continue;
 
-        heapRootMarker.mark(node->slot());
+        heapRootVisitor.mark(node->slot());
     }
 }
 
index 886c94a..5c151c3 100644 (file)
 namespace JSC {
 
 class HandleHeap;
-class HeapRootMarker;
+class HeapRootVisitor;
 class JSGlobalData;
 class JSValue;
 class MarkStack;
 class TypeCounter;
+typedef MarkStack SlotVisitor;
 
 class WeakHandleOwner {
 public:
     virtual ~WeakHandleOwner();
-    virtual bool isReachableFromOpaqueRoots(Handle<Unknown>, void* context, MarkStack&);
+    virtual bool isReachableFromOpaqueRoots(Handle<Unknown>, void* context, SlotVisitor&);
     virtual void finalize(Handle<Unknown>, void* context);
 };
 
@@ -61,8 +62,8 @@ public:
     void makeWeak(HandleSlot, WeakHandleOwner* = 0, void* context = 0);
     HandleSlot copyWeak(HandleSlot);
 
-    void markStrongHandles(HeapRootMarker&);
-    void markWeakHandles(HeapRootMarker&);
+    void markStrongHandles(HeapRootVisitor&);
+    void markWeakHandles(HeapRootVisitor&);
     void finalizeWeakHandles();
 
     void writeBarrier(HandleSlot, const JSValue&);
index 1c151af..ada4f99 100644 (file)
@@ -39,7 +39,7 @@ HandleStack::HandleStack()
     grow();
 }
 
-void HandleStack::mark(HeapRootMarker& heapRootMarker)
+void HandleStack::mark(HeapRootVisitor& heapRootMarker)
 {
     const Vector<HandleSlot>& blocks = m_blockStack.blocks();
     size_t blockLength = m_blockStack.blockLength;
index 54e6c60..115784a 100644 (file)
@@ -35,7 +35,7 @@
 namespace JSC {
 
 class LocalScope;
-class HeapRootMarker;
+class HeapRootVisitor;
 
 class HandleStack {
 public:
@@ -52,7 +52,7 @@ public:
 
     HandleSlot push();
 
-    void mark(HeapRootMarker&);
+    void mark(HeapRootVisitor&);
 
 private:
     void grow();
index 11999b7..6375b14 100644 (file)
@@ -151,7 +151,7 @@ bool Heap::unprotect(JSValue k)
     return m_protectedValues.remove(k.asCell());
 }
 
-void Heap::markProtectedObjects(HeapRootMarker& heapRootMarker)
+void Heap::markProtectedObjects(HeapRootVisitor& heapRootMarker)
 {
     ProtectCountSet::iterator end = m_protectedValues.end();
     for (ProtectCountSet::iterator it = m_protectedValues.begin(); it != end; ++it)
@@ -169,7 +169,7 @@ void Heap::popTempSortVector(Vector<ValueStringPair>* tempVector)
     m_tempSortingVectors.removeLast();
 }
     
-void Heap::markTempSortVectors(HeapRootMarker& heapRootMarker)
+void Heap::markTempSortVectors(HeapRootVisitor& heapRootMarker)
 {
     typedef Vector<Vector<ValueStringPair>* > VectorOfValueStringVectors;
 
@@ -207,8 +207,8 @@ void Heap::markRoots()
 
     m_operationInProgress = Collection;
 
-    MarkStack& markStack = m_markStack;
-    HeapRootMarker heapRootMarker(markStack);
+    MarkStack& visitor = m_markStack;
+    HeapRootVisitor heapRootMarker(visitor);
     
     // We gather conservative roots before clearing mark bits because
     // conservative gathering uses the mark bits from our last mark pass to
@@ -221,47 +221,47 @@ void Heap::markRoots()
 
     m_markedSpace.clearMarks();
 
-    markStack.append(machineThreadRoots);
-    markStack.drain();
+    visitor.append(machineThreadRoots);
+    visitor.drain();
 
-    markStack.append(registerFileRoots);
-    markStack.drain();
+    visitor.append(registerFileRoots);
+    visitor.drain();
 
     markProtectedObjects(heapRootMarker);
-    markStack.drain();
+    visitor.drain();
     
     markTempSortVectors(heapRootMarker);
-    markStack.drain();
+    visitor.drain();
 
     if (m_markListSet && m_markListSet->size())
         MarkedArgumentBuffer::markLists(heapRootMarker, *m_markListSet);
     if (m_globalData->exception)
         heapRootMarker.mark(&m_globalData->exception);
-    markStack.drain();
+    visitor.drain();
 
     m_handleHeap.markStrongHandles(heapRootMarker);
-    markStack.drain();
+    visitor.drain();
 
     m_handleStack.mark(heapRootMarker);
-    markStack.drain();
+    visitor.drain();
 
     // Mark the small strings cache as late as possible, since it will clear
     // itself if nothing else has marked it.
     // FIXME: Change the small strings cache to use Weak<T>.
-    m_globalData->smallStrings.markChildren(heapRootMarker);
-    markStack.drain();
+    m_globalData->smallStrings.visitChildren(heapRootMarker);
+    visitor.drain();
     
     // Weak handles must be marked last, because their owners use the set of
     // opaque roots to determine reachability.
     int lastOpaqueRootCount;
     do {
-        lastOpaqueRootCount = markStack.opaqueRootCount();
+        lastOpaqueRootCount = visitor.opaqueRootCount();
         m_handleHeap.markWeakHandles(heapRootMarker);
-        markStack.drain();
+        visitor.drain();
     // If the set of opaque roots has grown, more weak handles may have become reachable.
-    } while (lastOpaqueRootCount != markStack.opaqueRootCount());
+    } while (lastOpaqueRootCount != visitor.opaqueRootCount());
 
-    markStack.reset();
+    visitor.reset();
 
     m_operationInProgress = NoOperation;
 }
index c2d3bac..b85eaa3 100644 (file)
@@ -34,7 +34,7 @@ namespace JSC {
 
     class GCActivityCallback;
     class GlobalCodeBlock;
-    class HeapRootMarker;
+    class HeapRootVisitor;
     class JSCell;
     class JSGlobalData;
     class JSValue;
@@ -44,6 +44,7 @@ namespace JSC {
     class RegisterFile;
     class UString;
     class WeakGCHandlePool;
+    typedef MarkStack SlotVisitor;
 
     typedef std::pair<JSValue, UString> ValueStringPair;
     typedef HashCountedSet<JSCell*> ProtectCountSet;
@@ -114,8 +115,8 @@ namespace JSC {
         void reportExtraMemoryCostSlowCase(size_t);
 
         void markRoots();
-        void markProtectedObjects(HeapRootMarker&);
-        void markTempSortVectors(HeapRootMarker&);
+        void markProtectedObjects(HeapRootVisitor&);
+        void markTempSortVectors(HeapRootVisitor&);
 
         enum SweepToggle { DoNotSweep, DoSweep };
         void reset(SweepToggle);
index 3fb1a98..34f6d14 100644 (file)
@@ -54,32 +54,32 @@ void MarkStack::append(ConservativeRoots& conservativeRoots)
         internalAppend(roots[i]);
 }
 
-inline void MarkStack::markChildren(JSCell* cell)
+inline void MarkStack::visitChildren(JSCell* cell)
 {
     ASSERT(Heap::isMarked(cell));
     if (cell->structure()->typeInfo().type() < CompoundType) {
-        cell->JSCell::markChildren(*this);
+        cell->JSCell::visitChildren(*this);
         return;
     }
 
-    if (!cell->structure()->typeInfo().overridesMarkChildren()) {
+    if (!cell->structure()->typeInfo().overridesVisitChildren()) {
         ASSERT(cell->isObject());
 #ifdef NDEBUG
-        asObject(cell)->markChildrenDirect(*this);
+        asObject(cell)->visitChildrenDirect(*this);
 #else
         ASSERT(!m_isCheckingForDefaultMarkViolation);
         m_isCheckingForDefaultMarkViolation = true;
-        cell->markChildren(*this);
+        cell->visitChildren(*this);
         ASSERT(m_isCheckingForDefaultMarkViolation);
         m_isCheckingForDefaultMarkViolation = false;
 #endif
         return;
     }
     if (cell->vptr() == m_jsArrayVPtr) {
-        asArray(cell)->markChildrenDirect(*this);
+        asArray(cell)->visitChildrenDirect(*this);
         return;
     }
-    cell->markChildren(*this);
+    cell->visitChildren(*this);
 }
 
 void MarkStack::drain()
@@ -111,7 +111,7 @@ void MarkStack::drain()
             }
 
             if (cell->structure()->typeInfo().type() < CompoundType) {
-                cell->JSCell::markChildren(*this);
+                cell->JSCell::visitChildren(*this);
                 if (current.m_values == end) {
                     m_markSets.removeLast();
                     continue;
@@ -122,10 +122,10 @@ void MarkStack::drain()
             if (current.m_values == end)
                 m_markSets.removeLast();
 
-            markChildren(cell);
+            visitChildren(cell);
         }
         while (!m_values.isEmpty())
-            markChildren(m_values.removeLast());
+            visitChildren(m_values.removeLast());
     }
 #if !ASSERT_DISABLED
     m_isDraining = false;
index aba7647..1633516 100644 (file)
@@ -80,14 +80,14 @@ namespace JSC {
         void reset();
 
     private:
-        friend class HeapRootMarker; // Allowed to mark a JSValue* or JSCell** directly.
+        friend class HeapRootVisitor; // Allowed to mark a JSValue* or JSCell** directly.
         void append(JSValue*);
         void append(JSValue*, size_t count);
         void append(JSCell**);
 
         void internalAppend(JSCell*);
         void internalAppend(JSValue);
-        void markChildren(JSCell*);
+        void visitChildren(JSCell*);
 
         struct MarkSet {
             MarkSet(JSValue* values, JSValue* end, MarkSetProperties properties)
@@ -202,6 +202,8 @@ namespace JSC {
 #endif
     };
 
+    typedef MarkStack SlotVisitor;
+
     inline void MarkStack::append(JSValue* slot, size_t count)
     {
         if (!count)
@@ -243,10 +245,10 @@ namespace JSC {
     // this class to mark direct heap roots that are marked during every GC pass.
     // All other references should be wrapped in WriteBarriers and marked through
     // the MarkStack.
-    class HeapRootMarker {
+    class HeapRootVisitor {
     private:
         friend class Heap;
-        HeapRootMarker(MarkStack&);
+        HeapRootVisitor(SlotVisitor&);
         
     public:
         void mark(JSValue*);
@@ -254,40 +256,40 @@ namespace JSC {
         void mark(JSString**);
         void mark(JSCell**);
         
-        MarkStack& markStack();
+        SlotVisitor& visitor();
 
     private:
-        MarkStack& m_markStack;
+        SlotVisitor& m_visitor;
     };
 
-    inline HeapRootMarker::HeapRootMarker(MarkStack& markStack)
-        : m_markStack(markStack)
+    inline HeapRootVisitor::HeapRootVisitor(SlotVisitor& visitor)
+        : m_visitor(visitor)
     {
     }
 
-    inline void HeapRootMarker::mark(JSValue* slot)
+    inline void HeapRootVisitor::mark(JSValue* slot)
     {
-        m_markStack.append(slot);
+        m_visitor.append(slot);
     }
 
-    inline void HeapRootMarker::mark(JSValue* slot, size_t count)
+    inline void HeapRootVisitor::mark(JSValue* slot, size_t count)
     {
-        m_markStack.append(slot, count);
+        m_visitor.append(slot, count);
     }
 
-    inline void HeapRootMarker::mark(JSString** slot)
+    inline void HeapRootVisitor::mark(JSString** slot)
     {
-        m_markStack.append(reinterpret_cast<JSCell**>(slot));
+        m_visitor.append(reinterpret_cast<JSCell**>(slot));
     }
 
-    inline void HeapRootMarker::mark(JSCell** slot)
+    inline void HeapRootVisitor::mark(JSCell** slot)
     {
-        m_markStack.append(slot);
+        m_visitor.append(slot);
     }
 
-    inline MarkStack& HeapRootMarker::markStack()
+    inline SlotVisitor& HeapRootVisitor::visitor()
     {
-        return m_markStack;
+        return m_visitor;
     }
 
 } // namespace JSC
index 29a8cd0..d8b5ea7 100644 (file)
@@ -42,6 +42,7 @@ namespace JSC {
     class LiveObjectIterator;
     class MarkStack;
     class WeakGCHandle;
+    typedef MarkStack SlotVisitor;
 
     class MarkedSpace {
         WTF_MAKE_NONCOPYABLE(MarkedSpace);
index f46d108..c1aa9dd 100644 (file)
@@ -39,7 +39,7 @@ void ArgList::getSlice(int startIndex, ArgList& result) const
     result = ArgList(m_args + startIndex, m_argCount - startIndex);
 }
 
-void MarkedArgumentBuffer::markLists(HeapRootMarker& heapRootMarker, ListSet& markSet)
+void MarkedArgumentBuffer::markLists(HeapRootVisitor& heapRootMarker, ListSet& markSet)
 {
     ListSet::iterator end = markSet.end();
     for (ListSet::iterator it = markSet.begin(); it != end; ++it) {
index a794a04..bb2d284 100644 (file)
@@ -30,6 +30,7 @@
 namespace JSC {
 
     class MarkStack;
+    typedef MarkStack SlotVisitor;
 
     class MarkedArgumentBuffer {
         WTF_MAKE_NONCOPYABLE(MarkedArgumentBuffer);
@@ -141,7 +142,7 @@ namespace JSC {
         const_iterator begin() const { return m_buffer; }
         const_iterator end() const { return m_buffer + m_size; }
 
-        static void markLists(HeapRootMarker&, ListSet&);
+        static void markLists(HeapRootVisitor&, ListSet&);
 
     private:
         void slowAppend(JSValue);
index e201b91..838fd09 100644 (file)
@@ -43,22 +43,22 @@ Arguments::~Arguments()
         delete [] d->extraArguments;
 }
 
-void Arguments::markChildren(MarkStack& markStack)
+void Arguments::visitChildren(SlotVisitor& visitor)
 {
-    JSObject::markChildren(markStack);
+    JSObject::visitChildren(visitor);
 
     if (d->registerArray)
-        markStack.appendValues(d->registerArray.get(), d->numParameters);
+        visitor.appendValues(d->registerArray.get(), d->numParameters);
 
     if (d->extraArguments) {
         unsigned numExtraArguments = d->numArguments - d->numParameters;
-        markStack.appendValues(d->extraArguments, numExtraArguments);
+        visitor.appendValues(d->extraArguments, numExtraArguments);
     }
 
-    markStack.append(&d->callee);
+    visitor.append(&d->callee);
 
     if (d->activation)
-        markStack.append(&d->activation);
+        visitor.append(&d->activation);
 }
 
 void Arguments::copyToRegisters(ExecState* exec, Register* buffer, uint32_t maxSize)
index b5aa46b..9686d8b 100644 (file)
@@ -71,7 +71,7 @@ namespace JSC {
 
         static const ClassInfo s_info;
 
-        virtual void markChildren(MarkStack&);
+        virtual void visitChildren(SlotVisitor&);
 
         void fillArgList(ExecState*, MarkedArgumentBuffer&);
 
@@ -98,7 +98,7 @@ namespace JSC {
         }
 
     protected:
-        static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesMarkChildren | OverridesGetPropertyNames | JSObject::StructureFlags;
+        static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesVisitChildren | OverridesGetPropertyNames | JSObject::StructureFlags;
 
     private:
         void getArgumentsData(CallFrame*, JSFunction*&, ptrdiff_t& firstParameterIndex, Register*& argv, int& argc);
index fa14ad5..c179430 100644 (file)
@@ -135,11 +135,11 @@ JSObject* EvalExecutable::compileInternal(ExecState* exec, ScopeChainNode* scope
     return 0;
 }
 
-void EvalExecutable::markChildren(MarkStack& markStack)
+void EvalExecutable::visitChildren(SlotVisitor& visitor)
 {
-    ScriptExecutable::markChildren(markStack);
+    ScriptExecutable::visitChildren(visitor);
     if (m_evalCodeBlock)
-        m_evalCodeBlock->markAggregate(markStack);
+        m_evalCodeBlock->visitAggregate(visitor);
 }
 
 JSObject* ProgramExecutable::checkSyntax(ExecState* exec)
@@ -221,11 +221,11 @@ static bool tryDFGCompile(JSGlobalData* globalData, CodeBlock* codeBlock, JITCod
 }
 #endif
 
-void ProgramExecutable::markChildren(MarkStack& markStack)
+void ProgramExecutable::visitChildren(SlotVisitor& visitor)
 {
-    ScriptExecutable::markChildren(markStack);
+    ScriptExecutable::visitChildren(visitor);
     if (m_programCodeBlock)
-        m_programCodeBlock->markAggregate(markStack);
+        m_programCodeBlock->visitAggregate(visitor);
 }
 
 JSObject* FunctionExecutable::compileForCallInternal(ExecState* exec, ScopeChainNode* scopeChainNode)
@@ -321,13 +321,13 @@ JSObject* FunctionExecutable::compileForConstructInternal(ExecState* exec, Scope
     return 0;
 }
 
-void FunctionExecutable::markChildren(MarkStack& markStack)
+void FunctionExecutable::visitChildren(SlotVisitor& visitor)
 {
-    ScriptExecutable::markChildren(markStack);
+    ScriptExecutable::visitChildren(visitor);
     if (m_codeBlockForCall)
-        m_codeBlockForCall->markAggregate(markStack);
+        m_codeBlockForCall->visitAggregate(visitor);
     if (m_codeBlockForConstruct)
-        m_codeBlockForConstruct->markAggregate(markStack);
+        m_codeBlockForConstruct->visitAggregate(visitor);
 }
 
 void FunctionExecutable::discardCode()
index fbe33cf..e8b69d0 100644 (file)
@@ -235,12 +235,12 @@ namespace JSC {
         static Structure* createStructure(JSGlobalData& globalData, JSValue proto) { return Structure::create(globalData, proto, TypeInfo(CompoundType, StructureFlags), AnonymousSlotCount, 0); }
 
     private:
-        static const unsigned StructureFlags = OverridesMarkChildren | ScriptExecutable::StructureFlags;
+        static const unsigned StructureFlags = OverridesVisitChildren | ScriptExecutable::StructureFlags;
         static const ClassInfo s_info;
         EvalExecutable(ExecState*, const SourceCode&, bool);
 
         JSObject* compileInternal(ExecState*, ScopeChainNode*);
-        virtual void markChildren(MarkStack&);
+        virtual void visitChildren(SlotVisitor&);
 
         OwnPtr<EvalCodeBlock> m_evalCodeBlock;
     };
@@ -282,12 +282,12 @@ namespace JSC {
         static Structure* createStructure(JSGlobalData& globalData, JSValue proto) { return Structure::create(globalData, proto, TypeInfo(CompoundType, StructureFlags), AnonymousSlotCount, 0); }
 
     private:
-        static const unsigned StructureFlags = OverridesMarkChildren | ScriptExecutable::StructureFlags;
+        static const unsigned StructureFlags = OverridesVisitChildren | ScriptExecutable::StructureFlags;
         static const ClassInfo s_info;
         ProgramExecutable(ExecState*, const SourceCode&);
 
         JSObject* compileInternal(ExecState*, ScopeChainNode*);
-        virtual void markChildren(MarkStack&);
+        virtual void visitChildren(SlotVisitor&);
 
         OwnPtr<ProgramCodeBlock> m_programCodeBlock;
     };
@@ -370,7 +370,7 @@ namespace JSC {
         SharedSymbolTable* symbolTable() const { return m_symbolTable; }
 
         void discardCode();
-        void markChildren(MarkStack&);
+        void visitChildren(SlotVisitor&);
         static FunctionExecutable* fromGlobalCode(const Identifier&, ExecState*, Debugger*, const SourceCode&, JSObject** exception);
         static Structure* createStructure(JSGlobalData& globalData, JSValue proto) { return Structure::create(globalData, proto, TypeInfo(CompoundType, StructureFlags), AnonymousSlotCount, 0); }
 
@@ -381,7 +381,7 @@ namespace JSC {
         JSObject* compileForCallInternal(ExecState*, ScopeChainNode*);
         JSObject* compileForConstructInternal(ExecState*, ScopeChainNode*);
         
-        static const unsigned StructureFlags = OverridesMarkChildren | ScriptExecutable::StructureFlags;
+        static const unsigned StructureFlags = OverridesVisitChildren | ScriptExecutable::StructureFlags;
         static const ClassInfo s_info;
         unsigned m_numCapturedVariables : 31;
         bool m_forceUsesArguments : 1;
index 2b9f444..397e918 100644 (file)
 
 namespace JSC {
 
-void GetterSetter::markChildren(MarkStack& markStack)
+void GetterSetter::visitChildren(SlotVisitor& visitor)
 {
-    JSCell::markChildren(markStack);
+    JSCell::visitChildren(visitor);
 
     if (m_getter)
-        markStack.append(&m_getter);
+        visitor.append(&m_getter);
     if (m_setter)
-        markStack.append(&m_setter);
+        visitor.append(&m_setter);
 }
 
 bool GetterSetter::isGetterSetter() const
index a222c7a..0d65d1d 100644 (file)
@@ -42,7 +42,7 @@ namespace JSC {
         {
         }
 
-        virtual void markChildren(MarkStack&);
+        virtual void visitChildren(SlotVisitor&);
 
         JSObject* getter() const { return m_getter.get(); }
         void setGetter(JSGlobalData& globalData, JSObject* getter) { m_getter.set(globalData, this, getter); }
@@ -50,7 +50,7 @@ namespace JSC {
         void setSetter(JSGlobalData& globalData, JSObject* setter) { m_setter.set(globalData, this, setter); }
         static Structure* createStructure(JSGlobalData& globalData, JSValue prototype)
         {
-            return Structure::create(globalData, prototype, TypeInfo(GetterSetterType, OverridesMarkChildren), AnonymousSlotCount, 0);
+            return Structure::create(globalData, prototype, TypeInfo(GetterSetterType, OverridesVisitChildren), AnonymousSlotCount, 0);
         }
     private:
         virtual bool isGetterSetter() const;
index 0165488..88e8e5e 100644 (file)
@@ -38,7 +38,7 @@ namespace JSC {
 
         static Structure* createStructure(JSGlobalData& globalData, JSValue prototype)
         {
-            return Structure::create(globalData, prototype, TypeInfo(CompoundType, OverridesMarkChildren | OverridesGetPropertyNames), AnonymousSlotCount, 0);
+            return Structure::create(globalData, prototype, TypeInfo(CompoundType, OverridesVisitChildren | OverridesGetPropertyNames), AnonymousSlotCount, 0);
         }
 
         
index 4e36641..81e18c1 100644 (file)
@@ -58,19 +58,19 @@ JSActivation::~JSActivation()
     static_cast<SharedSymbolTable*>(m_symbolTable)->deref();
 }
 
-void JSActivation::markChildren(MarkStack& markStack)
+void JSActivation::visitChildren(SlotVisitor& visitor)
 {
-    Base::markChildren(markStack);
+    Base::visitChildren(visitor);
 
     // No need to mark our registers if they're still in the RegisterFile.
     WriteBarrier<Unknown>* registerArray = m_registerArray.get();
     if (!registerArray)
         return;
 
-    markStack.appendValues(registerArray, m_numParametersMinusThis);
+    visitor.appendValues(registerArray, m_numParametersMinusThis);
 
     // Skip the call frame, which sits between the parameters and vars.
-    markStack.appendValues(registerArray + m_numParametersMinusThis + RegisterFile::CallFrameHeaderSize, m_numCapturedVars, MayContainNullValues);
+    visitor.appendValues(registerArray + m_numParametersMinusThis + RegisterFile::CallFrameHeaderSize, m_numCapturedVars, MayContainNullValues);
 }
 
 inline bool JSActivation::symbolTableGet(const Identifier& propertyName, PropertySlot& slot)
index 65642f1..5f4c935 100644 (file)
@@ -45,7 +45,7 @@ namespace JSC {
         JSActivation(CallFrame*, FunctionExecutable*);
         virtual ~JSActivation();
 
-        virtual void markChildren(MarkStack&);
+        virtual void visitChildren(SlotVisitor&);
 
         virtual bool isDynamicScope(bool& requiresDynamicChecks) const;
 
@@ -69,7 +69,7 @@ namespace JSC {
         static Structure* createStructure(JSGlobalData& globalData, JSValue proto) { return Structure::create(globalData, proto, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount, &s_info); }
 
     protected:
-        static const unsigned StructureFlags = OverridesGetOwnPropertySlot | NeedsThisConversion | OverridesMarkChildren | OverridesGetPropertyNames | JSVariableObject::StructureFlags;
+        static const unsigned StructureFlags = OverridesGetOwnPropertySlot | NeedsThisConversion | OverridesVisitChildren | OverridesGetPropertyNames | JSVariableObject::StructureFlags;
 
     private:
         bool symbolTableGet(const Identifier&, PropertySlot&);
index bf61097..b0ae89a 100644 (file)
@@ -857,9 +857,9 @@ void JSArray::unshiftCount(ExecState* exec, int count)
         vector[i].clear();
 }
 
-void JSArray::markChildren(MarkStack& markStack)
+void JSArray::visitChildren(SlotVisitor& visitor)
 {
-    markChildrenDirect(markStack);
+    visitChildrenDirect(visitor);
 }
 
 static int compareNumbersForQSort(const void* a, const void* b)
index 8be8513..3cb8aad 100644 (file)
@@ -128,7 +128,7 @@ namespace JSC {
             return Structure::create(globalData, prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount, &s_info);
         }
         
-        inline void markChildrenDirect(MarkStack& markStack);
+        inline void visitChildrenDirect(SlotVisitor&);
 
         static ptrdiff_t storageOffset()
         {
@@ -141,12 +141,12 @@ namespace JSC {
         }
 
     protected:
-        static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesMarkChildren | OverridesGetPropertyNames | JSObject::StructureFlags;
+        static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesVisitChildren | OverridesGetPropertyNames | JSObject::StructureFlags;
         virtual void put(ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
         virtual bool deleteProperty(ExecState*, const Identifier& propertyName);
         virtual bool deleteProperty(ExecState*, unsigned propertyName);
         virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties);
-        virtual void markChildren(MarkStack&);
+        virtual void visitChildren(SlotVisitor&);
 
         void* subclassData() const;
         void setSubclassData(void*);
@@ -185,19 +185,19 @@ namespace JSC {
     inline bool isJSArray(JSGlobalData* globalData, JSCell* cell) { return cell->vptr() == globalData->jsArrayVPtr; }
     inline bool isJSArray(JSGlobalData* globalData, JSValue v) { return v.isCell() && isJSArray(globalData, v.asCell()); }
 
-    inline void JSArray::markChildrenDirect(MarkStack& markStack)
+    inline void JSArray::visitChildrenDirect(SlotVisitor& visitor)
     {
-        JSObject::markChildrenDirect(markStack);
+        JSObject::visitChildrenDirect(visitor);
         
         ArrayStorage* storage = m_storage;
 
         unsigned usedVectorLength = std::min(storage->m_length, m_vectorLength);
-        markStack.appendValues(storage->m_vector, usedVectorLength, MayContainNullValues);
+        visitor.appendValues(storage->m_vector, usedVectorLength, MayContainNullValues);
 
         if (SparseArrayValueMap* map = storage->m_sparseValueMap) {
             SparseArrayValueMap::iterator end = map->end();
             for (SparseArrayValueMap::iterator it = map->begin(); it != end; ++it)
-                markStack.append(&it->second);
+                visitor.append(&it->second);
         }
     }
 
index 7ee871c..18b7566 100644 (file)
@@ -118,7 +118,7 @@ namespace JSC {
         void* operator new(size_t, JSGlobalData*);
         void* operator new(size_t, void* placementNewDestination) { return placementNewDestination; }
 
-        virtual void markChildren(MarkStack&);
+        virtual void visitChildren(SlotVisitor&);
 #if ENABLE(JSC_ZOMBIES)
         virtual bool isZombie() const { return false; }
 #endif
@@ -178,9 +178,9 @@ namespace JSC {
         return m_structure.get();
     }
 
-    inline void JSCell::markChildren(MarkStack& markStack)
+    inline void JSCell::visitChildren(SlotVisitor& visitor)
     {
-        markStack.append(&m_structure);
+        visitor.append(&m_structure);
     }
 
     // --- JSValue inlines ----------------------------
index a18e973..4e9cd37 100644 (file)
@@ -133,16 +133,16 @@ const UString JSFunction::calculatedDisplayName(ExecState* exec)
     return name(exec);
 }
 
-void JSFunction::markChildren(MarkStack& markStack)
+void JSFunction::visitChildren(SlotVisitor& visitor)
 {
-    Base::markChildren(markStack);
+    Base::visitChildren(visitor);
 
-    markStack.append(&m_scopeChain);
+    visitor.append(&m_scopeChain);
     if (m_executable) {
         // Delightful race condition: m_executable may not have been initialised
         // if this is a host function, as the executable isn't necessarily created 
         // until after the function has been allocated.
-        markStack.append(&m_executable);
+        visitor.append(&m_executable);
     }
 }
 
index 174cd38..ba0a792 100644 (file)
@@ -84,7 +84,7 @@ namespace JSC {
         virtual CallType getCallData(CallData&);
 
     protected:
-        const static unsigned StructureFlags = OverridesGetOwnPropertySlot | ImplementsHasInstance | OverridesMarkChildren | OverridesGetPropertyNames | JSObject::StructureFlags;
+        const static unsigned StructureFlags = OverridesGetOwnPropertySlot | ImplementsHasInstance | OverridesVisitChildren | OverridesGetPropertyNames | JSObject::StructureFlags;
 
     private:
         explicit JSFunction(VPtrStealingHackType);
@@ -97,7 +97,7 @@ namespace JSC {
         virtual void put(ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
         virtual bool deleteProperty(ExecState*, const Identifier& propertyName);
 
-        virtual void markChildren(MarkStack&);
+        virtual void visitChildren(SlotVisitor&);
 
         static JSValue argumentsGetter(ExecState*, JSValue, const Identifier&);
         static JSValue callerGetter(ExecState*, JSValue, const Identifier&);
index b82949a..2e84ed1 100644 (file)
@@ -78,10 +78,10 @@ static const int initialTickCountThreshold = 255;
 // Preferred number of milliseconds between each timeout check
 static const int preferredScriptCheckTimeInterval = 1000;
 
-template <typename T> static inline void markIfNeeded(MarkStack& markStack, WriteBarrier<T>* v)
+template <typename T> static inline void visitIfNeeded(SlotVisitor& visitor, WriteBarrier<T>* v)
 {
     if (*v)
-        markStack.append(v);
+        visitor.append(v);
 }
 
 JSGlobalObject::~JSGlobalObject()
@@ -307,60 +307,60 @@ void JSGlobalObject::resetPrototype(JSGlobalData& globalData, JSValue prototype)
         oldLastInPrototypeChain->setPrototype(globalData, objectPrototype);
 }
 
-void JSGlobalObject::markChildren(MarkStack& markStack)
+void JSGlobalObject::visitChildren(SlotVisitor& visitor)
 {
-    JSVariableObject::markChildren(markStack);
-
-    markIfNeeded(markStack, &m_globalScopeChain);
-    markIfNeeded(markStack, &m_methodCallDummy);
-
-    markIfNeeded(markStack, &m_regExpConstructor);
-    markIfNeeded(markStack, &m_errorConstructor);
-    markIfNeeded(markStack, &m_evalErrorConstructor);
-    markIfNeeded(markStack, &m_rangeErrorConstructor);
-    markIfNeeded(markStack, &m_referenceErrorConstructor);
-    markIfNeeded(markStack, &m_syntaxErrorConstructor);
-    markIfNeeded(markStack, &m_typeErrorConstructor);
-    markIfNeeded(markStack, &m_URIErrorConstructor);
-
-    markIfNeeded(markStack, &m_evalFunction);
-    markIfNeeded(markStack, &m_callFunction);
-    markIfNeeded(markStack, &m_applyFunction);
-
-    markIfNeeded(markStack, &m_objectPrototype);
-    markIfNeeded(markStack, &m_functionPrototype);
-    markIfNeeded(markStack, &m_arrayPrototype);
-    markIfNeeded(markStack, &m_booleanPrototype);
-    markIfNeeded(markStack, &m_stringPrototype);
-    markIfNeeded(markStack, &m_numberPrototype);
-    markIfNeeded(markStack, &m_datePrototype);
-    markIfNeeded(markStack, &m_regExpPrototype);
-
-    markIfNeeded(markStack, &m_argumentsStructure);
-    markIfNeeded(markStack, &m_arrayStructure);
-    markIfNeeded(markStack, &m_booleanObjectStructure);
-    markIfNeeded(markStack, &m_callbackConstructorStructure);
-    markIfNeeded(markStack, &m_callbackFunctionStructure);
-    markIfNeeded(markStack, &m_callbackObjectStructure);
-    markIfNeeded(markStack, &m_dateStructure);
-    markIfNeeded(markStack, &m_emptyObjectStructure);
-    markIfNeeded(markStack, &m_errorStructure);
-    markIfNeeded(markStack, &m_functionStructure);
-    markIfNeeded(markStack, &m_numberObjectStructure);
-    markIfNeeded(markStack, &m_regExpMatchesArrayStructure);
-    markIfNeeded(markStack, &m_regExpStructure);
-    markIfNeeded(markStack, &m_stringObjectStructure);
-    markIfNeeded(markStack, &m_internalFunctionStructure);
+    JSVariableObject::visitChildren(visitor);
+
+    visitIfNeeded(visitor, &m_globalScopeChain);
+    visitIfNeeded(visitor, &m_methodCallDummy);
+
+    visitIfNeeded(visitor, &m_regExpConstructor);
+    visitIfNeeded(visitor, &m_errorConstructor);
+    visitIfNeeded(visitor, &m_evalErrorConstructor);
+    visitIfNeeded(visitor, &m_rangeErrorConstructor);
+    visitIfNeeded(visitor, &m_referenceErrorConstructor);
+    visitIfNeeded(visitor, &m_syntaxErrorConstructor);
+    visitIfNeeded(visitor, &m_typeErrorConstructor);
+    visitIfNeeded(visitor, &m_URIErrorConstructor);
+
+    visitIfNeeded(visitor, &m_evalFunction);
+    visitIfNeeded(visitor, &m_callFunction);
+    visitIfNeeded(visitor, &m_applyFunction);
+
+    visitIfNeeded(visitor, &m_objectPrototype);
+    visitIfNeeded(visitor, &m_functionPrototype);
+    visitIfNeeded(visitor, &m_arrayPrototype);
+    visitIfNeeded(visitor, &m_booleanPrototype);
+    visitIfNeeded(visitor, &m_stringPrototype);
+    visitIfNeeded(visitor, &m_numberPrototype);
+    visitIfNeeded(visitor, &m_datePrototype);
+    visitIfNeeded(visitor, &m_regExpPrototype);
+
+    visitIfNeeded(visitor, &m_argumentsStructure);
+    visitIfNeeded(visitor, &m_arrayStructure);
+    visitIfNeeded(visitor, &m_booleanObjectStructure);
+    visitIfNeeded(visitor, &m_callbackConstructorStructure);
+    visitIfNeeded(visitor, &m_callbackFunctionStructure);
+    visitIfNeeded(visitor, &m_callbackObjectStructure);
+    visitIfNeeded(visitor, &m_dateStructure);
+    visitIfNeeded(visitor, &m_emptyObjectStructure);
+    visitIfNeeded(visitor, &m_errorStructure);
+    visitIfNeeded(visitor, &m_functionStructure);
+    visitIfNeeded(visitor, &m_numberObjectStructure);
+    visitIfNeeded(visitor, &m_regExpMatchesArrayStructure);
+    visitIfNeeded(visitor, &m_regExpStructure);
+    visitIfNeeded(visitor, &m_stringObjectStructure);
+    visitIfNeeded(visitor, &m_internalFunctionStructure);
 
     if (m_registerArray) {
         // Outside the execution of global code, when our variables are torn off,
         // we can mark the torn-off array.
-        markStack.appendValues(m_registerArray.get(), m_registerArraySize);
+        visitor.appendValues(m_registerArray.get(), m_registerArraySize);
     } else if (m_registers) {
         // During execution of global code, when our variables are in the register file,
         // the symbol table tells us how many variables there are, and registers
         // points to where they end, and the registers used for execution begin.
-        markStack.appendValues(m_registers - symbolTable().size(), symbolTable().size());
+        visitor.appendValues(m_registers - symbolTable().size(), symbolTable().size());
     }
 }
 
index 0e36920..d2ad0ad 100644 (file)
@@ -151,7 +151,7 @@ namespace JSC {
     public:
         virtual ~JSGlobalObject();
 
-        virtual void markChildren(MarkStack&);
+        virtual void visitChildren(SlotVisitor&);
 
         virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
         virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
@@ -258,7 +258,7 @@ namespace JSC {
     protected:
 
         static const unsigned AnonymousSlotCount = JSVariableObject::AnonymousSlotCount + 1;
-        static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesMarkChildren | OverridesGetPropertyNames | JSVariableObject::StructureFlags;
+        static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesVisitChildren | OverridesGetPropertyNames | JSVariableObject::StructureFlags;
 
         struct GlobalPropertyInfo {
             GlobalPropertyInfo(const Identifier& i, JSValue v, unsigned a)
index 27fc569..8742fdc 100644 (file)
@@ -79,7 +79,7 @@ public:
     Stringifier(ExecState*, const Local<Unknown>& replacer, const Local<Unknown>& space);
     Local<Unknown> stringify(Handle<Unknown>);
 
-    void markAggregate(MarkStack&);
+    void visitAggregate(SlotVisitor&);
 
 private:
     class Holder {
index 9677f23..c711b35 100644 (file)
@@ -68,17 +68,17 @@ static inline void getClassPropertyNames(ExecState* exec, const ClassInfo* class
     }
 }
 
-void JSObject::markChildren(MarkStack& markStack)
+void JSObject::visitChildren(SlotVisitor& visitor)
 {
 #ifndef NDEBUG
-    bool wasCheckingForDefaultMarkViolation = markStack.m_isCheckingForDefaultMarkViolation;
-    markStack.m_isCheckingForDefaultMarkViolation = false;
+    bool wasCheckingForDefaultMarkViolation = visitor.m_isCheckingForDefaultMarkViolation;
+    visitor.m_isCheckingForDefaultMarkViolation = false;
 #endif
 
-    markChildrenDirect(markStack);
+    visitChildrenDirect(visitor);
 
 #ifndef NDEBUG
-    markStack.m_isCheckingForDefaultMarkViolation = wasCheckingForDefaultMarkViolation;
+    visitor.m_isCheckingForDefaultMarkViolation = wasCheckingForDefaultMarkViolation;
 #endif
 }
 
index 80735f8..b033475 100644 (file)
@@ -79,8 +79,8 @@ namespace JSC {
         friend void setUpStaticFunctionSlot(ExecState* exec, const HashEntry* entry, JSObject* thisObj, const Identifier& propertyName, PropertySlot& slot);
 
     public:
-        virtual void markChildren(MarkStack&);
-        ALWAYS_INLINE void markChildrenDirect(MarkStack& markStack);
+        virtual void visitChildren(SlotVisitor&);
+        ALWAYS_INLINE void visitChildrenDirect(SlotVisitor&);
 
         // The inline virtual destructor cannot be the first virtual function declared
         // in the class as it results in the vtable being generated as a weak symbol
@@ -820,15 +820,15 @@ inline void JSValue::put(ExecState* exec, unsigned propertyName, JSValue value)
     asCell()->put(exec, propertyName, value);
 }
 
-ALWAYS_INLINE void JSObject::markChildrenDirect(MarkStack& markStack)
+ALWAYS_INLINE void JSObject::visitChildrenDirect(SlotVisitor& visitor)
 {
-    JSCell::markChildren(markStack);
+    JSCell::visitChildren(visitor);
 
     PropertyStorage storage = propertyStorage();
     size_t storageSize = m_structure->propertyStorageSize();
-    markStack.appendValues(storage, storageSize);
+    visitor.appendValues(storage, storageSize);
     if (m_inheritorID)
-        markStack.append(&m_inheritorID);
+        visitor.append(&m_inheritorID);
 }
 
 // --- JSValue inlines ----------------------------
index d5af044..e6010de 100644 (file)
@@ -95,11 +95,11 @@ JSValue JSPropertyNameIterator::get(ExecState* exec, JSObject* base, size_t i)
     return identifier;
 }
 
-void JSPropertyNameIterator::markChildren(MarkStack& markStack)
+void JSPropertyNameIterator::visitChildren(SlotVisitor& visitor)
 {
-    markStack.appendValues(m_jsStrings.get(), m_jsStringsSize, MayContainNullValues);
+    visitor.appendValues(m_jsStrings.get(), m_jsStringsSize, MayContainNullValues);
     if (m_cachedPrototypeChain)
-        markStack.append(&m_cachedPrototypeChain);
+        visitor.append(&m_cachedPrototypeChain);
 }
 
 } // namespace JSC
index b857dc0..1a57350 100644 (file)
@@ -47,12 +47,12 @@ namespace JSC {
         
         static Structure* createStructure(JSGlobalData& globalData, JSValue prototype)
         {
-            return Structure::create(globalData, prototype, TypeInfo(CompoundType, OverridesMarkChildren), AnonymousSlotCount, &s_info);
+            return Structure::create(globalData, prototype, TypeInfo(CompoundType, OverridesVisitChildren), AnonymousSlotCount, &s_info);
         }
 
         virtual bool isPropertyNameIterator() const { return true; }
 
-        virtual void markChildren(MarkStack&);
+        virtual void visitChildren(SlotVisitor&);
 
         bool getOffset(size_t i, int& offset)
         {
index 3d4dc7c..d04ee62 100644 (file)
 namespace JSC {
 ASSERT_CLASS_FITS_IN_CELL(JSStaticScopeObject);
 
-void JSStaticScopeObject::markChildren(MarkStack& markStack)
+void JSStaticScopeObject::visitChildren(SlotVisitor& visitor)
 {
-    JSVariableObject::markChildren(markStack);
-    markStack.append(&m_registerStore);
+    JSVariableObject::visitChildren(visitor);
+    visitor.append(&m_registerStore);
 }
 
 JSObject* JSStaticScopeObject::toThisObject(ExecState* exec) const
index 8c3a249..b201fe0 100644 (file)
@@ -39,7 +39,7 @@ namespace JSC{
             symbolTable().add(ident.impl(), SymbolTableEntry(-1, attributes));
         }
 
-        virtual void markChildren(MarkStack&);
+        virtual void visitChildren(SlotVisitor&);
         bool isDynamicScope(bool& requiresDynamicChecks) const;
         virtual JSObject* toThisObject(ExecState*) const;
         virtual JSValue toStrictThisObject(ExecState*) const;
@@ -50,7 +50,7 @@ namespace JSC{
         static Structure* createStructure(JSGlobalData& globalData, JSValue proto) { return Structure::create(globalData, proto, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount, &s_info); }
 
     protected:
-        static const unsigned StructureFlags = OverridesGetOwnPropertySlot | NeedsThisConversion | OverridesMarkChildren | OverridesGetPropertyNames | JSVariableObject::StructureFlags;
+        static const unsigned StructureFlags = OverridesGetOwnPropertySlot | NeedsThisConversion | OverridesVisitChildren | OverridesGetPropertyNames | JSVariableObject::StructureFlags;
 
     private:
         SymbolTable m_symbolTable;
index acde81f..a18c757 100644 (file)
@@ -41,7 +41,7 @@ namespace JSC {
     static const unsigned ImplementsDefaultHasInstance = 1 << 3;
     static const unsigned NeedsThisConversion = 1 << 4;
     static const unsigned OverridesGetOwnPropertySlot = 1 << 5;
-    static const unsigned OverridesMarkChildren = 1 << 6;
+    static const unsigned OverridesVisitChildren = 1 << 6;
     static const unsigned OverridesGetPropertyNames = 1 << 7;
     static const unsigned IsJSFinalObject = 1 << 8;
 
@@ -54,7 +54,7 @@ namespace JSC {
         {
             ASSERT(flags <= 0x1FF);
             ASSERT(type <= 0xFF);
-            ASSERT(type >= CompoundType || !(flags & OverridesMarkChildren));
+            ASSERT(type >= CompoundType || !(flags & OverridesVisitChildren));
             // ImplementsDefaultHasInstance means (ImplementsHasInstance & !OverridesHasInstance)
             if ((m_flags & (ImplementsHasInstance | OverridesHasInstance)) == ImplementsHasInstance)
                 m_flags |= ImplementsDefaultHasInstance;
@@ -67,7 +67,7 @@ namespace JSC {
         bool overridesHasInstance() const { return m_flags & OverridesHasInstance; }
         bool needsThisConversion() const { return m_flags & NeedsThisConversion; }
         bool overridesGetOwnPropertySlot() const { return m_flags & OverridesGetOwnPropertySlot; }
-        bool overridesMarkChildren() const { return m_flags & OverridesMarkChildren; }
+        bool overridesVisitChildren() const { return m_flags & OverridesVisitChildren; }
         bool overridesGetPropertyNames() const { return m_flags & OverridesGetPropertyNames; }
         unsigned flags() const { return m_flags; }
         unsigned isFinal() const { return m_flags2 && (IsJSFinalObject >> 8); }
index 6c73b2f..2bf4a90 100644 (file)
@@ -26,11 +26,11 @@ namespace JSC {
 
 ASSERT_CLASS_FITS_IN_CELL(JSWrapperObject);
 
-void JSWrapperObject::markChildren(MarkStack& markStack
+void JSWrapperObject::visitChildren(SlotVisitor& visitor
 {
-    JSObject::markChildren(markStack);
+    JSObject::visitChildren(visitor);
     if (m_internalValue)
-        markStack.append(&m_internalValue);
+        visitor.append(&m_internalValue);
 }
 
 } // namespace JSC
index a7dbe0d..8972648 100644 (file)
@@ -42,10 +42,10 @@ namespace JSC {
         }
 
     protected:
-        static const unsigned StructureFlags = OverridesMarkChildren | JSNonFinalObject::StructureFlags;
+        static const unsigned StructureFlags = OverridesVisitChildren | JSNonFinalObject::StructureFlags;
 
     private:
-        virtual void markChildren(MarkStack&);
+        virtual void visitChildren(SlotVisitor&);
         
         WriteBarrier<Unknown> m_internalValue;
     };
index 0559b96..795036e 100644 (file)
@@ -55,7 +55,7 @@ public:
     virtual double toNumber(ExecState*) const { ASSERT_NOT_REACHED(); return 0.0; }
     virtual UString toString(ExecState*) const { ASSERT_NOT_REACHED(); return ""; }
     virtual JSObject* toObject(ExecState*) const { ASSERT_NOT_REACHED(); return 0; }
-    virtual void markChildren(MarkStack&) { ASSERT_NOT_REACHED(); }
+    virtual void visitChildren(SlotVisitor&) { ASSERT_NOT_REACHED(); }
     virtual void put(ExecState*, const Identifier&, JSValue, PutPropertySlot&) { ASSERT_NOT_REACHED(); }
     virtual void put(ExecState*, unsigned, JSValue) { ASSERT_NOT_REACHED(); }
     virtual bool deleteProperty(ExecState*, const Identifier&) { ASSERT_NOT_REACHED(); return false; }
index 9cd5dcb..5c4f009 100644 (file)
@@ -46,11 +46,11 @@ NativeErrorConstructor::NativeErrorConstructor(ExecState* exec, JSGlobalObject*
     ASSERT(m_errorStructure->typeInfo().type() == ObjectType);
 }
 
-void NativeErrorConstructor::markChildren(MarkStack& markStack)
+void NativeErrorConstructor::visitChildren(SlotVisitor& visitor)
 {
-    InternalFunction::markChildren(markStack);
+    InternalFunction::visitChildren(visitor);
     if (m_errorStructure)
-        markStack.append(&m_errorStructure);
+        visitor.append(&m_errorStructure);
 }
 
 static EncodedJSValue JSC_HOST_CALL constructWithNativeErrorConstructor(ExecState* exec)
index e96daf6..4fb16f1 100644 (file)
@@ -43,10 +43,10 @@ namespace JSC {
         Structure* errorStructure() { return m_errorStructure.get(); }
 
     private:
-        static const unsigned StructureFlags = OverridesMarkChildren | InternalFunction::StructureFlags;
+        static const unsigned StructureFlags = OverridesVisitChildren | InternalFunction::StructureFlags;
         virtual ConstructType getConstructData(ConstructData&);
         virtual CallType getCallData(CallData&);
-        virtual void markChildren(MarkStack&);
+        virtual void visitChildren(SlotVisitor&);
 
         WriteBarrier<Structure> m_errorStructure;
     };
index d824ecd..ffc0112 100644 (file)
@@ -72,11 +72,11 @@ RegExpObject::~RegExpObject()
 {
 }
 
-void RegExpObject::markChildren(MarkStack& markStack)
+void RegExpObject::visitChildren(SlotVisitor& visitor)
 {
-    Base::markChildren(markStack);
+    Base::visitChildren(visitor);
     if (UNLIKELY(!d->lastIndex.get().isInt32()))
-        markStack.append(&d->lastIndex);
+        visitor.append(&d->lastIndex);
 }
 
 bool RegExpObject::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
index 4274fff..a0803eb 100644 (file)
@@ -64,10 +64,10 @@ namespace JSC {
         }
 
     protected:
-        static const unsigned StructureFlags = OverridesMarkChildren | OverridesGetOwnPropertySlot | JSObjectWithGlobalObject::StructureFlags;
+        static const unsigned StructureFlags = OverridesVisitChildren | OverridesGetOwnPropertySlot | JSObjectWithGlobalObject::StructureFlags;
 
     private:
-        virtual void markChildren(MarkStack&);
+        virtual void visitChildren(SlotVisitor&);
 
         bool match(ExecState*);
 
index 026d729..ed60bb1 100644 (file)
@@ -67,13 +67,13 @@ int ScopeChainNode::localDepth()
     return scopeDepth;
 }
 
-void ScopeChainNode::markChildren(MarkStack& markStack)
+void ScopeChainNode::visitChildren(SlotVisitor& visitor)
 {
     if (next)
-        markStack.append(&next);
-    markStack.append(&object);
-    markStack.append(&globalObject);
-    markStack.append(&globalThis);
+        visitor.append(&next);
+    visitor.append(&object);
+    visitor.append(&globalObject);
+    visitor.append(&globalThis);
 }
 
 } // namespace JSC
index d0a2672..8481bdc 100644 (file)
@@ -32,6 +32,7 @@ namespace JSC {
     class JSObject;
     class MarkStack;
     class ScopeChainIterator;
+    typedef MarkStack SlotVisitor;
     
     class ScopeChainNode : public JSCell {
     public:
@@ -66,9 +67,9 @@ namespace JSC {
 #endif
         
         static Structure* createStructure(JSGlobalData& globalData, JSValue proto) { return Structure::create(globalData, proto, TypeInfo(CompoundType, StructureFlags), AnonymousSlotCount, &s_info); }
-        virtual void markChildren(MarkStack&);
+        virtual void visitChildren(SlotVisitor&);
     private:
-        static const unsigned StructureFlags = OverridesMarkChildren;
+        static const unsigned StructureFlags = OverridesVisitChildren;
         static const ClassInfo s_info;
     };
 
index ac67020..8741e9b 100644 (file)
@@ -74,7 +74,7 @@ SmallStrings::~SmallStrings()
 {
 }
 
-void SmallStrings::markChildren(HeapRootMarker& heapRootMarker)
+void SmallStrings::visitChildren(HeapRootVisitor& heapRootMarker)
 {
     /*
        Our hypothesis is that small strings are very common. So, we cache them
index b54d020..17607bb 100644 (file)
 
 namespace JSC {
 
-    class HeapRootMarker;
+    class HeapRootVisitor;
     class JSGlobalData;
     class JSString;
     class MarkStack;
     class SmallStringsStorage;
+    typedef MarkStack SlotVisitor;
 
     static const unsigned maxSingleCharacterString = 0xFF;
 
@@ -63,7 +64,7 @@ namespace JSC {
 
         StringImpl* singleCharacterStringRep(unsigned char character);
 
-        void markChildren(HeapRootMarker&);
+        void visitChildren(HeapRootVisitor&);
         void clear();
 
         unsigned count() const;
index dcc8e7c..7aabf00 100644 (file)
@@ -198,7 +198,7 @@ const ClassInfo Structure::s_info = { "Structure", 0, 0, 0 };
 
 Structure::Structure(JSGlobalData& globalData)
     : JSCell(globalData, this)
-    , m_typeInfo(CompoundType, OverridesMarkChildren)
+    , m_typeInfo(CompoundType, OverridesVisitChildren)
     , m_prototype(globalData, this, jsNull())
     , m_classInfo(&s_info)
     , m_propertyStorageCapacity(0)
@@ -765,24 +765,24 @@ void Structure::getPropertyNames(JSGlobalData& globalData, PropertyNameArray& pr
     }
 }
 
-void Structure::markChildren(MarkStack& markStack)
+void Structure::visitChildren(SlotVisitor& visitor)
 {
-    JSCell::markChildren(markStack);
+    JSCell::visitChildren(visitor);
     if (m_prototype)
-        markStack.append(&m_prototype);
+        visitor.append(&m_prototype);
     if (m_cachedPrototypeChain)
-        markStack.append(&m_cachedPrototypeChain);
+        visitor.append(&m_cachedPrototypeChain);
     if (m_previous)
-        markStack.append(&m_previous);
+        visitor.append(&m_previous);
     if (m_specificValueInPrevious)
-        markStack.append(&m_specificValueInPrevious);
+        visitor.append(&m_specificValueInPrevious);
     if (m_enumerationCache)
-        markStack.append(&m_enumerationCache);
+        visitor.append(&m_enumerationCache);
     if (m_propertyTable) {
         PropertyTable::iterator end = m_propertyTable->end();
         for (PropertyTable::iterator ptr = m_propertyTable->begin(); ptr != end; ++ptr) {
             if (ptr->specificValue)
-                markStack.append(&ptr->specificValue);
+                visitor.append(&ptr->specificValue);
         }
     }
 }
index fe9ce6b..27065a8 100644 (file)
@@ -47,6 +47,7 @@ namespace JSC {
     class PropertyNameArray;
     class PropertyNameArrayData;
     class StructureChain;
+    typedef MarkStack SlotVisitor;
 
     struct ClassInfo;
 
@@ -99,7 +100,7 @@ namespace JSC {
         JSValue storedPrototype() const { return m_prototype.get(); }
         JSValue prototypeForLookup(ExecState*) const;
         StructureChain* prototypeChain(ExecState*) const;
-        void markChildren(MarkStack&);
+        void visitChildren(SlotVisitor&);
 
         Structure* previousID() const { return m_previous.get(); }
 
index ad6abff..062951d 100644 (file)
@@ -53,11 +53,11 @@ StructureChain::~StructureChain()
 {
 }
 
-void StructureChain::markChildren(MarkStack& markStack)
+void StructureChain::visitChildren(SlotVisitor& visitor)
 {
     size_t i = 0;
     while (m_vector[i])
-        markStack.append(&m_vector[i++]);
+        visitor.append(&m_vector[i++]);
 }
 
 } // namespace JSC
index b984be6..50323fd 100644 (file)
@@ -44,9 +44,9 @@ namespace JSC {
     public:
         static StructureChain* create(JSGlobalData& globalData, Structure* head) { return new (&globalData) StructureChain(globalData, globalData.structureChainStructure.get(), head); }
         WriteBarrier<Structure>* head() { return m_vector.get(); }
-        void markChildren(MarkStack&);
+        void visitChildren(SlotVisitor&);
 
-        static Structure* createStructure(JSGlobalData& globalData, JSValue prototype) { return Structure::create(globalData, prototype, TypeInfo(CompoundType, OverridesMarkChildren), 0, &s_info); }
+        static Structure* createStructure(JSGlobalData& globalData, JSValue prototype) { return Structure::create(globalData, prototype, TypeInfo(CompoundType, OverridesVisitChildren), 0, &s_info); }
 
     private:
         StructureChain(JSGlobalData&, Structure*, Structure* head);
index 3b8abdd..6dd5f00 100644 (file)
@@ -1,3 +1,19 @@
+2011-04-21  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Geoffrey Garen.
+
+        Start moving to a general visitor pattern for GC traversal
+        https://bugs.webkit.org/show_bug.cgi?id=59141
+
+        This is just a rename:
+            markChildren -> visitChildren
+            markAggregate -> visitAggregate
+            markStack -> visitor
+            MarkStack -> typedef'd to SlotVisitor
+
+        * UserObjectImp.cpp:
+        (UserObjectImp::visitChildren):
+
 2011-04-19  Renata Hodovan  <reni@webkit.org>
 
         Reviewed by Eric Seidel.
index c93748f..ad3693b 100644 (file)
@@ -404,9 +404,9 @@ UString UserObjectImp::toString(ExecState *exec) const
     return result;
 }
 
-void UserObjectImp::markChildren(MarkStack& markStack)
+void UserObjectImp::visitChildren(SlotVisitor& visitor)
 {
-    JSObject::markChildren(markStack);
+    JSObject::visitChildren(visitor);
     if (fJSUserObject)
         fJSUserObject->Mark();
 }
index 9bd6f0f..5e0f8ed 100644 (file)
@@ -54,13 +54,13 @@ public:
     virtual double toNumber(ExecState *exec) const;
     virtual UString toString(ExecState *exec) const;
 
-    virtual void markChildren(MarkStack&);
+    virtual void visitChildren(SlotVisitor&);
 
     JSUserObject *GetJSUserObject() const;
 
     static Structure* createStructure(JSGlobalData& globalData, JSValue prototype)
     {
-        return Structure::create(globalData, prototype, TypeInfo(ObjectType, OverridesGetOwnPropertySlot | OverridesMarkChildren | OverridesGetPropertyNames), AnonymousSlotCount, &s_info);
+        return Structure::create(globalData, prototype, TypeInfo(ObjectType, OverridesGetOwnPropertySlot | OverridesVisitChildren | OverridesGetPropertyNames), AnonymousSlotCount, &s_info);
     }
 
 private:
index bae6db2..5a994d9 100644 (file)
@@ -1,3 +1,118 @@
+2011-04-21  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Geoffrey Garen.
+
+        Start moving to a general visitor pattern for GC traversal
+        https://bugs.webkit.org/show_bug.cgi?id=59141
+
+        This is just a rename:
+            markChildren -> visitChildren
+            markAggregate -> visitAggregate
+            markStack -> visitor
+            MarkStack -> typedef'd to SlotVisitor
+
+        * bindings/js/JSAttrCustom.cpp:
+        (WebCore::JSAttr::visitChildren):
+        * bindings/js/JSAudioConstructor.cpp:
+        (WebCore::constructAudio):
+        * bindings/js/JSCSSRuleCustom.cpp:
+        (WebCore::JSCSSRule::visitChildren):
+        * bindings/js/JSCSSStyleDeclarationCustom.cpp:
+        (WebCore::JSCSSStyleDeclaration::visitChildren):
+        * bindings/js/JSDOMBinding.cpp:
+        (WebCore::visitActiveObjectsForContext):
+        (WebCore::markDOMObjectWrapper):
+        * bindings/js/JSDOMBinding.h:
+        * bindings/js/JSDOMGlobalObject.cpp:
+        (WebCore::JSDOMGlobalObject::visitChildren):
+        * bindings/js/JSDOMGlobalObject.h:
+        * bindings/js/JSDOMImplementationCustom.cpp:
+        (WebCore::JSDOMImplementation::visitChildren):
+        * bindings/js/JSDOMWindowCustom.cpp:
+        (WebCore::JSDOMWindow::visitChildren):
+        * bindings/js/JSDOMWindowShell.cpp:
+        (WebCore::JSDOMWindowShell::visitChildren):
+        * bindings/js/JSDOMWindowShell.h:
+        * bindings/js/JSDocumentCustom.cpp:
+        (WebCore::JSDocument::visitChildren):
+        * bindings/js/JSElementCustom.cpp:
+        (WebCore::JSElement::visitChildren):
+        * bindings/js/JSEventListener.cpp:
+        (WebCore::JSEventListener::markJSFunction):
+        * bindings/js/JSEventListener.h:
+        * bindings/js/JSHTMLCanvasElementCustom.cpp:
+        (WebCore::JSHTMLCanvasElement::visitChildren):
+        * bindings/js/JSHTMLLinkElementCustom.cpp:
+        (WebCore::JSHTMLLinkElement::visitChildren):
+        * bindings/js/JSHTMLStyleElementCustom.cpp:
+        (WebCore::JSHTMLStyleElement::visitChildren):
+        * bindings/js/JSImageConstructor.cpp:
+        (WebCore::constructImage):
+        * bindings/js/JSJavaScriptAudioNodeCustom.cpp:
+        (WebCore::JSJavaScriptAudioNode::visitChildren):
+        * bindings/js/JSMessageChannelCustom.cpp:
+        (WebCore::JSMessageChannel::visitChildren):
+        * bindings/js/JSMessagePortCustom.cpp:
+        (WebCore::JSMessagePort::visitChildren):
+        * bindings/js/JSNamedNodeMapCustom.cpp:
+        (WebCore::JSNamedNodeMapOwner::isReachableFromOpaqueRoots):
+        (WebCore::JSNamedNodeMap::visitChildren):
+        * bindings/js/JSNavigatorCustom.cpp:
+        (WebCore::JSNavigator::visitChildren):
+        * bindings/js/JSNodeCustom.cpp:
+        (WebCore::isObservable):
+        (WebCore::isReachableFromDOM):
+        (WebCore::JSNodeOwner::isReachableFromOpaqueRoots):
+        (WebCore::JSNode::visitChildren):
+        * bindings/js/JSNodeCustom.h:
+        * bindings/js/JSNodeFilterCondition.cpp:
+        (WebCore::JSNodeFilterCondition::WeakOwner::isReachableFromOpaqueRoots):
+        * bindings/js/JSNodeFilterCondition.h:
+        * bindings/js/JSNodeFilterCustom.cpp:
+        (WebCore::JSNodeFilter::visitChildren):
+        * bindings/js/JSNodeIteratorCustom.cpp:
+        (WebCore::JSNodeIterator::visitChildren):
+        * bindings/js/JSNodeListCustom.cpp:
+        (WebCore::JSNodeListOwner::isReachableFromOpaqueRoots):
+        * bindings/js/JSProcessingInstructionCustom.cpp:
+        (WebCore::JSProcessingInstruction::visitChildren):
+        * bindings/js/JSSVGElementInstanceCustom.cpp:
+        (WebCore::JSSVGElementInstance::visitChildren):
+        * bindings/js/JSSharedWorkerCustom.cpp:
+        (WebCore::JSSharedWorker::visitChildren):
+        * bindings/js/JSStyleSheetCustom.cpp:
+        (WebCore::JSStyleSheet::visitChildren):
+        * bindings/js/JSTreeWalkerCustom.cpp:
+        (WebCore::JSTreeWalker::visitChildren):
+        * bindings/js/JSWebGLRenderingContextCustom.cpp:
+        (WebCore::JSWebGLRenderingContext::visitChildren):
+        * bindings/js/JSWebKitAnimationListCustom.cpp:
+        (WebCore::JSWebKitAnimationList::visitChildren):
+        * bindings/js/JSWorkerContextCustom.cpp:
+        (WebCore::JSWorkerContext::visitChildren):
+        * bindings/js/JSXMLHttpRequestCustom.cpp:
+        (WebCore::JSXMLHttpRequest::visitChildren):
+        * bindings/js/JSXMLHttpRequestUploadCustom.cpp:
+        (WebCore::JSXMLHttpRequestUpload::visitChildren):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        * bridge/qt/qt_instance.cpp:
+        (JSC::Bindings::QtRuntimeObject::visitChildren):
+        (JSC::Bindings::QtInstance::markAggregate):
+        * bridge/qt/qt_instance.h:
+        * bridge/qt/qt_pixmapruntime.cpp:
+        * bridge/qt/qt_runtime.cpp:
+        (JSC::Bindings::QtRuntimeMetaMethod::visitChildren):
+        * bridge/qt/qt_runtime.h:
+        * dom/EventListener.h:
+        (WebCore::EventListener::visitJSFunction):
+        * dom/EventTarget.h:
+        (WebCore::EventTarget::visitJSEventListeners):
+        * dom/Node.h:
+        * dom/NodeFilterCondition.h:
+        (WebCore::NodeFilterCondition::visitAggregate):
+        * page/DOMWindow.h:
+        * workers/WorkerContext.h:
+
 2011-04-21  Beth Dakin  <bdakin@apple.com>
 
         Reviewed by Dan Bernstein.
index 305dc81..1cd3359 100644 (file)
@@ -39,14 +39,14 @@ namespace WebCore {
 
 using namespace HTMLNames;
 
-void JSAttr::markChildren(MarkStack& markStack)
+void JSAttr::visitChildren(SlotVisitor& visitor)
 {
-    Base::markChildren(markStack);
+    Base::visitChildren(visitor);
 
     Element* element = impl()->ownerElement();
     if (!element)
         return;
-    markStack.addOpaqueRoot(root(element));
+    visitor.addOpaqueRoot(root(element));
 }
 
 } // namespace WebCore
index 9ac797b..3988fdd 100644 (file)
@@ -56,7 +56,7 @@ static EncodedJSValue JSC_HOST_CALL constructAudio(ExecState* exec)
         return throwVMError(exec, createReferenceError(exec, "Audio constructor associated document is unavailable"));
 
     // Calling toJS on the document causes the JS document wrapper to be
-    // added to the window object. This is done to ensure that JSDocument::markChildren
+    // added to the window object. This is done to ensure that JSDocument::visitChildren
     // will be called, which will cause the audio element to be marked if necessary.
     toJS(exec, jsConstructor->globalObject(), document);
 
index 03d2960..7d41712 100644 (file)
@@ -79,10 +79,10 @@ inline void* wrapperContext(DOMWrapperWorld* world, CSSRule*)
     return world;
 }
 
-void JSCSSRule::markChildren(MarkStack& markStack)
+void JSCSSRule::visitChildren(SlotVisitor& visitor)
 {
-    Base::markChildren(markStack);
-    markStack.addOpaqueRoot(root(impl()));
+    Base::visitChildren(visitor);
+    visitor.addOpaqueRoot(root(impl()));
 }
 
 JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, CSSRule* rule)
index e46a492..3bb3571 100644 (file)
@@ -73,10 +73,10 @@ inline void* wrapperContext(DOMWrapperWorld* world, CSSStyleDeclaration*)
     return world;
 }
 
-void JSCSSStyleDeclaration::markChildren(MarkStack& markStack)
+void JSCSSStyleDeclaration::visitChildren(SlotVisitor& visitor)
 {
-    Base::markChildren(markStack);
-    markStack.addOpaqueRoot(root(impl()));
+    Base::visitChildren(visitor);
+    visitor.addOpaqueRoot(root(impl()));
 }
 
 // Check for a CSS prefix.
index 5ac07a7..e40caed 100644 (file)
@@ -134,7 +134,7 @@ const JSC::HashTable* getHashTableForGlobalData(JSGlobalData& globalData, const
     return DOMObjectHashTableMap::mapFor(globalData).get(staticTable);
 }
 
-void markActiveObjectsForContext(MarkStack& markStack, JSGlobalData& globalData, ScriptExecutionContext* scriptExecutionContext)
+void visitActiveObjectsForContext(SlotVisitor& visitor, JSGlobalData& globalData, ScriptExecutionContext* scriptExecutionContext)
 {
     // If an element has pending activity that may result in event listeners being called
     // (e.g. an XMLHttpRequest), we need to keep JS wrappers alive.
@@ -145,7 +145,7 @@ void markActiveObjectsForContext(MarkStack& markStack, JSGlobalData& globalData,
         if (iter->first->hasPendingActivity()) {
             // Generally, an active object with pending activity must have a wrapper to mark its listeners.
             // However, some ActiveDOMObjects don't have JS wrappers.
-            markDOMObjectWrapper(markStack, globalData, iter->second);
+            markDOMObjectWrapper(visitor, globalData, iter->second);
         }
     }
 
@@ -154,11 +154,11 @@ void markActiveObjectsForContext(MarkStack& markStack, JSGlobalData& globalData,
     for (HashSet<MessagePort*>::const_iterator iter = messagePorts.begin(); iter != portsEnd; ++iter) {
         // If the message port is remotely entangled, then always mark it as in-use because we can't determine reachability across threads.
         if (!(*iter)->locallyEntangledPort() || (*iter)->hasPendingActivity())
-            markDOMObjectWrapper(markStack, globalData, *iter);
+            markDOMObjectWrapper(visitor, globalData, *iter);
     }
 }
 
-void markDOMObjectWrapper(MarkStack& markStack, JSGlobalData& globalData, void* object)
+void markDOMObjectWrapper(SlotVisitor& visitor, JSGlobalData& globalData, void* object)
 {
     // FIXME: This could be changed to only mark wrappers that are "observable"
     // as markDOMNodesForDocument does, allowing us to collect more wrappers,
@@ -168,7 +168,7 @@ void markDOMObjectWrapper(MarkStack& markStack, JSGlobalData& globalData, void*
 
     for (JSGlobalDataWorldIterator worldIter(&globalData); worldIter; ++worldIter) {
         if (JSDOMWrapper* wrapper = worldIter->m_wrappers.get(object).get())
-            markStack.deprecatedAppend(reinterpret_cast<JSCell**>(&wrapper));
+            visitor.deprecatedAppend(reinterpret_cast<JSCell**>(&wrapper));
     }
 }
 
index 803429f..e5405df 100644 (file)
@@ -89,7 +89,7 @@ namespace WebCore {
         }
 
     protected:
-        static const unsigned StructureFlags = JSC::ImplementsHasInstance | JSC::OverridesMarkChildren | JSDOMWrapperWithGlobalPointer::StructureFlags;
+        static const unsigned StructureFlags = JSC::ImplementsHasInstance | JSC::OverridesVisitChildren | JSDOMWrapperWithGlobalPointer::StructureFlags;
         DOMConstructorObject(JSC::Structure* structure, JSDOMGlobalObject* globalObject)
             : JSDOMWrapperWithGlobalPointer(structure, globalObject)
         {
@@ -113,8 +113,8 @@ namespace WebCore {
         }
     };
     
-    void markActiveObjectsForContext(JSC::MarkStack&, JSC::JSGlobalData&, ScriptExecutionContext*);
-    void markDOMObjectWrapper(JSC::MarkStack&, JSC::JSGlobalData& globalData, void* object);
+    void visitActiveObjectsForContext(JSC::SlotVisitor&, JSC::JSGlobalData&, ScriptExecutionContext*);
+    void markDOMObjectWrapper(JSC::SlotVisitor&, JSC::JSGlobalData&, void*);
 
     JSC::Structure* getCachedDOMStructure(JSDOMGlobalObject*, const JSC::ClassInfo*);
     JSC::Structure* cacheDOMStructure(JSDOMGlobalObject*, JSC::Structure*, const JSC::ClassInfo*);
index 3e3d037..3280a62 100644 (file)
@@ -50,20 +50,20 @@ JSDOMGlobalObject::JSDOMGlobalObject(JSGlobalData& globalData, Structure* struct
     ASSERT(inherits(&s_info));
 }
 
-void JSDOMGlobalObject::markChildren(MarkStack& markStack)
+void JSDOMGlobalObject::visitChildren(SlotVisitor& visitor)
 {
-    Base::markChildren(markStack);
+    Base::visitChildren(visitor);
 
     JSDOMStructureMap::iterator end = structures().end();
     for (JSDOMStructureMap::iterator it = structures().begin(); it != end; ++it)
-        markStack.append(&it->second);
+        visitor.append(&it->second);
 
     JSDOMConstructorMap::iterator end2 = constructors().end();
     for (JSDOMConstructorMap::iterator it2 = constructors().begin(); it2 != end2; ++it2)
-        markStack.append(&it2->second);
+        visitor.append(&it2->second);
 
     if (m_injectedScript)
-        markStack.append(&m_injectedScript);
+        visitor.append(&m_injectedScript);
 }
 
 void JSDOMGlobalObject::setCurrentEvent(Event* currentEvent)
index 9190e01..1a1ad4e 100644 (file)
@@ -63,7 +63,7 @@ namespace WebCore {
         void setInjectedScript(JSObject*);
         JSObject* injectedScript() const;
 
-        virtual void markChildren(JSC::MarkStack&);
+        virtual void visitChildren(JSC::SlotVisitor&);
 
         DOMWrapperWorld* world() { return m_world.get(); }
 
index aa3a607..44979ae 100644 (file)
@@ -29,14 +29,14 @@ using namespace JSC;
 
 namespace WebCore {
 
-void JSDOMImplementation::markChildren(MarkStack& markStack)
+void JSDOMImplementation::visitChildren(SlotVisitor& visitor)
 {
-    Base::markChildren(markStack);
+    Base::visitChildren(visitor);
 
     Document* ownerDocument = impl()->ownerDocument();
     if (!ownerDocument)
         return;
-    markStack.addOpaqueRoot(ownerDocument);
+    visitor.addOpaqueRoot(ownerDocument);
 }
 
 }
index 4bde9e5..163fa9c 100644 (file)
@@ -72,33 +72,33 @@ using namespace JSC;
 
 namespace WebCore {
 
-void JSDOMWindow::markChildren(MarkStack& markStack)
+void JSDOMWindow::visitChildren(SlotVisitor& visitor)
 {
-    Base::markChildren(markStack);
+    Base::visitChildren(visitor);
 
-    impl()->markJSEventListeners(markStack);
+    impl()->visitJSEventListeners(visitor);
 
     JSGlobalData& globalData = *Heap::heap(this)->globalData();
 
-    markDOMObjectWrapper(markStack, globalData, impl()->optionalConsole());
-    markDOMObjectWrapper(markStack, globalData, impl()->optionalHistory());
-    markDOMObjectWrapper(markStack, globalData, impl()->optionalLocationbar());
-    markDOMObjectWrapper(markStack, globalData, impl()->optionalMenubar());
-    markDOMObjectWrapper(markStack, globalData, impl()->optionalNavigator());
-    markDOMObjectWrapper(markStack, globalData, impl()->optionalPersonalbar());
-    markDOMObjectWrapper(markStack, globalData, impl()->optionalScreen());
-    markDOMObjectWrapper(markStack, globalData, impl()->optionalScrollbars());
-    markDOMObjectWrapper(markStack, globalData, impl()->optionalSelection());
-    markDOMObjectWrapper(markStack, globalData, impl()->optionalStatusbar());
-    markDOMObjectWrapper(markStack, globalData, impl()->optionalToolbar());
-    markDOMObjectWrapper(markStack, globalData, impl()->optionalLocation());
-    markDOMObjectWrapper(markStack, globalData, impl()->optionalMedia());
+    markDOMObjectWrapper(visitor, globalData, impl()->optionalConsole());
+    markDOMObjectWrapper(visitor, globalData, impl()->optionalHistory());
+    markDOMObjectWrapper(visitor, globalData, impl()->optionalLocationbar());
+    markDOMObjectWrapper(visitor, globalData, impl()->optionalMenubar());
+    markDOMObjectWrapper(visitor, globalData, impl()->optionalNavigator());
+    markDOMObjectWrapper(visitor, globalData, impl()->optionalPersonalbar());
+    markDOMObjectWrapper(visitor, globalData, impl()->optionalScreen());
+    markDOMObjectWrapper(visitor, globalData, impl()->optionalScrollbars());
+    markDOMObjectWrapper(visitor, globalData, impl()->optionalSelection());
+    markDOMObjectWrapper(visitor, globalData, impl()->optionalStatusbar());
+    markDOMObjectWrapper(visitor, globalData, impl()->optionalToolbar());
+    markDOMObjectWrapper(visitor, globalData, impl()->optionalLocation());
+    markDOMObjectWrapper(visitor, globalData, impl()->optionalMedia());
 #if ENABLE(DOM_STORAGE)
-    markDOMObjectWrapper(markStack, globalData, impl()->optionalSessionStorage());
-    markDOMObjectWrapper(markStack, globalData, impl()->optionalLocalStorage());
+    markDOMObjectWrapper(visitor, globalData, impl()->optionalSessionStorage());
+    markDOMObjectWrapper(visitor, globalData, impl()->optionalLocalStorage());
 #endif
 #if ENABLE(OFFLINE_WEB_APPLICATIONS)
-    markDOMObjectWrapper(markStack, globalData, impl()->optionalApplicationCache());
+    markDOMObjectWrapper(visitor, globalData, impl()->optionalApplicationCache());
 #endif
 }
 
index 4c157c9..a986144 100644 (file)
@@ -32,6 +32,7 @@
 #include "Frame.h"
 #include "JSDOMWindow.h"
 #include "DOMWindow.h"
+#include "ScriptController.h"
 #include <runtime/JSObject.h>
 
 using namespace JSC;
@@ -72,11 +73,11 @@ void JSDOMWindowShell::setWindow(PassRefPtr<DOMWindow> domWindow)
 // JSObject methods
 // ----
 
-void JSDOMWindowShell::markChildren(MarkStack& markStack)
+void JSDOMWindowShell::visitChildren(SlotVisitor& visitor)
 {
-    Base::markChildren(markStack);
+    Base::visitChildren(visitor);
     if (m_window)
-        markStack.append(&m_window);
+        visitor.append(&m_window);
 }
 
 UString JSDOMWindowShell::className() const
index c2c5336..5674776 100644 (file)
@@ -66,9 +66,9 @@ namespace WebCore {
         DOMWrapperWorld* world() { return m_world.get(); }
 
     private:
-        static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::OverridesMarkChildren | JSC::OverridesGetPropertyNames | Base::StructureFlags;
+        static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::OverridesVisitChildren | JSC::OverridesGetPropertyNames | Base::StructureFlags;
 
-        virtual void markChildren(JSC::MarkStack&);
+        virtual void visitChildren(JSC::SlotVisitor&);
         virtual JSC::UString className() const;
         virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
         virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
index 8404a67..08d5c2c 100644 (file)
@@ -34,6 +34,7 @@
 #include "JSTouch.h"
 #include "JSTouchList.h"
 #include "Location.h"
+#include "ScriptController.h"
 #include "TouchList.h"
 
 #if ENABLE(SVG)
@@ -47,15 +48,15 @@ using namespace JSC;
 
 namespace WebCore {
 
-void JSDocument::markChildren(MarkStack& markStack)
+void JSDocument::visitChildren(SlotVisitor& visitor)
 {
-    JSNode::markChildren(markStack);
+    JSNode::visitChildren(visitor);
 
     Document* document = impl();
     JSGlobalData& globalData = *Heap::heap(this)->globalData();
 
-    markActiveObjectsForContext(markStack, globalData, document);
-    markDOMObjectWrapper(markStack, globalData, document->implementation());
+    visitActiveObjectsForContext(visitor, globalData, document);
+    markDOMObjectWrapper(visitor, globalData, document->implementation());
 }
 
 JSValue JSDocument::location(ExecState* exec) const
index 4bedf3a..e09d806 100644 (file)
@@ -51,19 +51,19 @@ namespace WebCore {
 
 using namespace HTMLNames;
 
-void JSElement::markChildren(MarkStack& markStack)
+void JSElement::visitChildren(SlotVisitor& visitor)
 {
-    Base::markChildren(markStack);
+    Base::visitChildren(visitor);
 
     Element* element = impl();
     JSGlobalData& globalData = *Heap::heap(this)->globalData();
 
-    markDOMObjectWrapper(markStack, globalData, element->attributeMap());
-    markDOMObjectWrapper(markStack, globalData, element->optionalClassList());
-    markDOMObjectWrapper(markStack, globalData, element->optionalDataset());
+    markDOMObjectWrapper(visitor, globalData, element->attributeMap());
+    markDOMObjectWrapper(visitor, globalData, element->optionalClassList());
+    markDOMObjectWrapper(visitor, globalData, element->optionalDataset());
 
     if (element->isStyledElement())
-        markDOMObjectWrapper(markStack, globalData, static_cast<StyledElement*>(element)->inlineStyleDecl());
+        markDOMObjectWrapper(visitor, globalData, static_cast<StyledElement*>(element)->inlineStyleDecl());
 }
 
 JSValue toJSNewlyCreated(ExecState* exec, JSDOMGlobalObject* globalObject, Element* element)
index 436251e..18355f8 100644 (file)
@@ -56,10 +56,10 @@ JSObject* JSEventListener::initializeJSFunction(ScriptExecutionContext*) const
     return 0;
 }
 
-void JSEventListener::markJSFunction(MarkStack& markStack)
+void JSEventListener::markJSFunction(SlotVisitor& visitor)
 {
     if (m_jsFunction)
-        markStack.append(&m_jsFunction);
+        visitor.append(&m_jsFunction);
 }
 
 void JSEventListener::handleEvent(ScriptExecutionContext* scriptExecutionContext, Event* event)
index a599be7..17f24c4 100644 (file)
@@ -57,7 +57,7 @@ namespace WebCore {
 
     private:
         virtual JSC::JSObject* initializeJSFunction(ScriptExecutionContext*) const;
-        virtual void markJSFunction(JSC::MarkStack&);
+        virtual void markJSFunction(JSC::SlotVisitor&);
         virtual bool virtualisAttribute() const;
 
     protected:
index 72aec4b..1541d6a 100644 (file)
@@ -40,14 +40,14 @@ using namespace JSC;
 
 namespace WebCore {
 
-void JSHTMLCanvasElement::markChildren(MarkStack& markStack)
+void JSHTMLCanvasElement::visitChildren(SlotVisitor& visitor)
 {
-    Base::markChildren(markStack);
+    Base::visitChildren(visitor);
 
     HTMLCanvasElement* canvas = static_cast<HTMLCanvasElement*>(impl());
     JSGlobalData& globalData = *Heap::heap(this)->globalData();
 
-    markDOMObjectWrapper(markStack, globalData, canvas->renderingContext());
+    markDOMObjectWrapper(visitor, globalData, canvas->renderingContext());
 }
 
 JSValue JSHTMLCanvasElement::getContext(ExecState* exec)
index 8cc8d5f..285883b 100644 (file)
@@ -32,12 +32,12 @@ using namespace JSC;
 
 namespace WebCore {
 
-void JSHTMLLinkElement::markChildren(MarkStack& markStack)
+void JSHTMLLinkElement::visitChildren(SlotVisitor& visitor)
 {
-    Base::markChildren(markStack);
+    Base::visitChildren(visitor);
 
     if (StyleSheet* sheet = static_cast<HTMLLinkElement*>(impl())->sheet())
-        markDOMObjectWrapper(markStack, *Heap::heap(this)->globalData(), sheet);
+        markDOMObjectWrapper(visitor, *Heap::heap(this)->globalData(), sheet);
 }
 
 }
index 9b0d1a7..8f4e933 100644 (file)
@@ -32,12 +32,12 @@ using namespace JSC;
 
 namespace WebCore {
 
-void JSHTMLStyleElement::markChildren(MarkStack& markStack)
+void JSHTMLStyleElement::visitChildren(SlotVisitor& visitor)
 {
-    Base::markChildren(markStack);
+    Base::visitChildren(visitor);
 
     if (StyleSheet* sheet = static_cast<HTMLStyleElement*>(impl())->sheet())
-        markDOMObjectWrapper(markStack, *Heap::heap(this)->globalData(), sheet);
+        markDOMObjectWrapper(visitor, *Heap::heap(this)->globalData(), sheet);
 }
 
 }
index be75af0..5476183 100644 (file)
@@ -49,7 +49,7 @@ static EncodedJSValue JSC_HOST_CALL constructImage(ExecState* exec)
         return throwVMError(exec, createReferenceError(exec, "Image constructor associated document is unavailable"));
 
     // Calling toJS on the document causes the JS document wrapper to be
-    // added to the window object. This is done to ensure that JSDocument::markChildren
+    // added to the window object. This is done to ensure that JSDocument::visit
     // will be called, which will cause the image element to be marked if necessary.
     toJS(exec, jsConstructor->globalObject(), document);
     int width;
index 9acabf3..c7aab8f 100644 (file)
@@ -34,10 +34,10 @@ using namespace JSC;
 
 namespace WebCore {
 
-void JSJavaScriptAudioNode::markChildren(MarkStack& markStack)
+void JSJavaScriptAudioNode::visitChildren(SlotVisitor& visitor)
 {
-    Base::markChildren(markStack);
-    static_cast<JavaScriptAudioNode*>(impl())->markJSEventListeners(markStack);
+    Base::visitChildren(visitor);
+    static_cast<JavaScriptAudioNode*>(impl())->markJSEventListeners(visitor);
 }
 
 } // namespace WebCore
index c2f5779..0a0efbe 100644 (file)
@@ -33,15 +33,15 @@ using namespace JSC;
 
 namespace WebCore {
     
-void JSMessageChannel::markChildren(MarkStack& markStack)
+void JSMessageChannel::visitChildren(SlotVisitor& visitor)
 {
-    Base::markChildren(markStack);
+    Base::visitChildren(visitor);
 
     if (MessagePort* port = m_impl->port1())
-        markDOMObjectWrapper(markStack, *Heap::heap(this)->globalData(), port);
+        markDOMObjectWrapper(visitor, *Heap::heap(this)->globalData(), port);
 
     if (MessagePort* port = m_impl->port2())
-        markDOMObjectWrapper(markStack, *Heap::heap(this)->globalData(), port);
+        markDOMObjectWrapper(visitor, *Heap::heap(this)->globalData(), port);
 }
 
 EncodedJSValue JSC_HOST_CALL JSMessageChannelConstructor::constructJSMessageChannel(ExecState* exec)
index 06b4178..a849876 100644 (file)
@@ -41,15 +41,15 @@ using namespace JSC;
 
 namespace WebCore {
 
-void JSMessagePort::markChildren(MarkStack& markStack)
+void JSMessagePort::visitChildren(SlotVisitor& visitor)
 {
-    Base::markChildren(markStack);
+    Base::visitChildren(visitor);
 
     // If we have a locally entangled port, we can directly mark it as reachable. Ports that are remotely entangled are marked in-use by markActiveObjectsForContext().
     if (MessagePort* entangledPort = m_impl->locallyEntangledPort())
-        markDOMObjectWrapper(markStack, *Heap::heap(this)->globalData(), entangledPort);
+        markDOMObjectWrapper(visitor, *Heap::heap(this)->globalData(), entangledPort);
 
-    m_impl->markJSEventListeners(markStack);
+    m_impl->visitJSEventListeners(visitor);
 }
 
 JSC::JSValue JSMessagePort::postMessage(JSC::ExecState* exec)
index 9b06767..393905d 100644 (file)
@@ -27,6 +27,7 @@
 #include "JSNamedNodeMap.h"
 
 #include "JSNode.h"
+
 #include "Element.h"
 #include "NamedNodeMap.h"
 
@@ -35,11 +36,11 @@ using namespace JSC;
 namespace WebCore {
 
 class JSNamedNodeMapOwner : public JSC::WeakHandleOwner {
-    virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::MarkStack&);
+    virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);
     virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);
 };
 
-bool JSNamedNodeMapOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, MarkStack& markStack)
+bool JSNamedNodeMapOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
 {
     JSNamedNodeMap* jsNamedNodeMap = static_cast<JSNamedNodeMap*>(handle.get().asCell());
     if (!jsNamedNodeMap->hasCustomProperties())
@@ -47,7 +48,7 @@ bool JSNamedNodeMapOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> h
     Element* element = jsNamedNodeMap->impl()->element();
     if (!element)
         return false;
-    return markStack.containsOpaqueRoot(root(element));
+    return visitor.containsOpaqueRoot(root(element));
 }
 
 void JSNamedNodeMapOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
@@ -79,9 +80,9 @@ JSValue JSNamedNodeMap::nameGetter(ExecState* exec, JSValue slotBase, const Iden
     return toJS(exec, thisObj->impl()->getNamedItem(identifierToString(propertyName)));
 }
 
-void JSNamedNodeMap::markChildren(MarkStack& markStack)
+void JSNamedNodeMap::visitChildren(SlotVisitor& visitor)
 {
-    Base::markChildren(markStack);
+    Base::visitChildren(visitor);
 
     // We need to keep the wrapper for our underlying NamedNodeMap's element
     // alive because NamedNodeMap and Attr rely on the element for data, and
@@ -90,7 +91,7 @@ void JSNamedNodeMap::markChildren(MarkStack& markStack)
     Element* element = impl()->element();
     if (!element)
         return;
-    markStack.addOpaqueRoot(root(element));
+    visitor.addOpaqueRoot(root(element));
 }
 
 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, NamedNodeMap* impl)
index 50fb4da..1e7c5d3 100644 (file)
@@ -32,13 +32,13 @@ namespace WebCore {
 
 using namespace JSC;
 
-void JSNavigator::markChildren(MarkStack& markStack)
+void JSNavigator::visitChildren(SlotVisitor& visitor)
 {
-    Base::markChildren(markStack);
+    Base::visitChildren(visitor);
 
     JSGlobalData& globalData = *Heap::heap(this)->globalData();
 
-    markDOMObjectWrapper(markStack, globalData, impl()->optionalGeolocation());
+    markDOMObjectWrapper(visitor, globalData, impl()->optionalGeolocation());
 }
 
 #if ENABLE(MEDIA_STREAM)
index 8ba9671..f0d6093 100644 (file)
@@ -108,7 +108,7 @@ static bool isObservable(JSNode* jsNode, Node* node, DOMWrapperWorld* world)
     // the wrapper must be treated as observable, because future access to
     // those objects through the DOM must reflect those properties.
     // FIXME: It would be better if this logic could be in the node next to
-    // the custom markChildren functions rather than here.
+    // the custom visit functions rather than here.
     // Note that for some compound objects like stylesheets and CSSStyleDeclarations,
     // we don't descend to check children for custom properties, and just conservatively
     // keep the node wrappers protecting them alive.
@@ -147,7 +147,7 @@ static bool isObservable(JSNode* jsNode, Node* node, DOMWrapperWorld* world)
     return false;
 }
 
-static inline bool isReachableFromDOM(JSNode* jsNode, Node* node, DOMWrapperWorld* world, MarkStack& markStack)
+static inline bool isReachableFromDOM(JSNode* jsNode, Node* node, DOMWrapperWorld* world, SlotVisitor& visitor)
 {
     if (!node->inDocument()) {
         // If a wrapper is the last reference to an image or script element
@@ -170,14 +170,14 @@ static inline bool isReachableFromDOM(JSNode* jsNode, Node* node, DOMWrapperWorl
             return true;
     }
 
-    return isObservable(jsNode, node, world) && markStack.containsOpaqueRoot(root(node));
+    return isObservable(jsNode, node, world) && visitor.containsOpaqueRoot(root(node));
 }
 
-bool JSNodeOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void* context, MarkStack& markStack)
+bool JSNodeOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void* context, SlotVisitor& visitor)
 {
     JSNode* jsNode = static_cast<JSNode*>(handle.get().asCell());
     DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
-    return isReachableFromDOM(jsNode, jsNode->impl(), world, markStack);
+    return isReachableFromDOM(jsNode, jsNode->impl(), world, visitor);
 }
 
 void JSNodeOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
@@ -236,14 +236,14 @@ ScopeChainNode* JSNode::pushEventHandlerScope(ExecState*, ScopeChainNode* node)
     return node;
 }
 
-void JSNode::markChildren(MarkStack& markStack)
+void JSNode::visitChildren(SlotVisitor& visitor)
 {
-    Base::markChildren(markStack);
+    Base::visitChildren(visitor);
 
     Node* node = m_impl.get();
-    node->markJSEventListeners(markStack);
+    node->visitJSEventListeners(visitor);
 
-    markStack.addOpaqueRoot(root(node));
+    visitor.addOpaqueRoot(root(node));
 }
 
 static ALWAYS_INLINE JSValue createWrapperInline(ExecState* exec, JSDOMGlobalObject* globalObject, Node* node)
index 67ffde0..51e795e 100644 (file)
@@ -35,7 +35,7 @@ namespace WebCore {
 class CSSValue;
 
 class JSNodeOwner : public JSC::WeakHandleOwner {
-    virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::MarkStack&);
+    virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);
     virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);
 };
 
index 927b1a3..9d5df04 100644 (file)
@@ -83,9 +83,9 @@ short JSNodeFilterCondition::acceptNode(JSC::ExecState* exec, Node* filterNode)
     return intResult;
 }
 
-bool JSNodeFilterCondition::WeakOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, MarkStack& markStack)
+bool JSNodeFilterCondition::WeakOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, SlotVisitor& visitor)
 {
-    return markStack.containsOpaqueRoot(context);
+    return visitor.containsOpaqueRoot(context);
 }
 
 } // namespace WebCore
index 80148f1..9b056a0 100644 (file)
@@ -43,7 +43,7 @@ namespace WebCore {
         virtual short acceptNode(ScriptState*, Node*) const;
 
         class WeakOwner : public JSC::WeakHandleOwner {
-            virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::MarkStack&);
+            virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);
         };
         WeakOwner m_weakOwner;
         mutable JSC::Weak<JSC::Unknown> m_filter;
index ad4aa7e..1fcf487 100644 (file)
@@ -36,10 +36,10 @@ using namespace JSC;
 
 namespace WebCore {
 
-void JSNodeFilter::markChildren(MarkStack& markStack)
+void JSNodeFilter::visitChildren(SlotVisitor& visitor)
 {
-    Base::markChildren(markStack);
-    markStack.addOpaqueRoot(impl());
+    Base::visitChildren(visitor);
+    visitor.addOpaqueRoot(impl());
 }
 
 PassRefPtr<NodeFilter> toNodeFilter(JSGlobalData& globalData, JSValue value)
index 77f2dc3..682e913 100644 (file)
@@ -29,12 +29,12 @@ using namespace JSC;
 
 namespace WebCore {
 
-void JSNodeIterator::markChildren(MarkStack& markStack)
+void JSNodeIterator::visitChildren(SlotVisitor& visitor)
 {
-    Base::markChildren(markStack);
+    Base::visitChildren(visitor);
 
     if (NodeFilter* filter = m_impl->filter())
-        markStack.addOpaqueRoot(filter);
+        visitor.addOpaqueRoot(filter);
 }
 
 }
index a52ac64..533b434 100644 (file)
@@ -37,18 +37,18 @@ using namespace JSC;
 namespace WebCore {
 
 class JSNodeListOwner : public JSC::WeakHandleOwner {
-    virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::MarkStack&);
+    virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);
     virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);
 };
 
-bool JSNodeListOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, MarkStack& markStack)
+bool JSNodeListOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
 {
     JSNodeList* jsNodeList = static_cast<JSNodeList*>(handle.get().asCell());
     if (!jsNodeList->hasCustomProperties())
         return false;
     if (!jsNodeList->impl()->isDynamicNodeList())
         return false;
-    return markStack.containsOpaqueRoot(root(static_cast<DynamicNodeList*>(jsNodeList->impl())->rootNode()));
+    return visitor.containsOpaqueRoot(root(static_cast<DynamicNodeList*>(jsNodeList->impl())->rootNode()));
 }
 
 void JSNodeListOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
index 868e319..cf3477c 100644 (file)
@@ -32,12 +32,12 @@ using namespace JSC;
 
 namespace WebCore {
 
-void JSProcessingInstruction::markChildren(MarkStack& markStack)
+void JSProcessingInstruction::visitChildren(SlotVisitor& visitor)
 {
-    Base::markChildren(markStack);
+    Base::visitChildren(visitor);
 
     if (StyleSheet* sheet = static_cast<ProcessingInstruction*>(impl())->sheet())
-        markDOMObjectWrapper(markStack, *Heap::heap(this)->globalData(), sheet);
+        markDOMObjectWrapper(visitor, *Heap::heap(this)->globalData(), sheet);
 }
 
 }
index defbd5f..b3beeb5 100644 (file)
 
 namespace WebCore {
 
-void JSSVGElementInstance::markChildren(JSC::MarkStack& markStack)
+void JSSVGElementInstance::visitChildren(JSC::SlotVisitor& visitor)
 {
-    Base::markChildren(markStack);
-    markStack.addOpaqueRoot(root(impl()->correspondingElement()));
+    Base::visitChildren(visitor);
+    visitor.addOpaqueRoot(root(impl()->correspondingElement()));
 }
 
 } // namespace WebCore
index 0d576e0..34b9c3c 100644 (file)
@@ -43,12 +43,12 @@ using namespace JSC;
 
 namespace WebCore {
 
-void JSSharedWorker::markChildren(MarkStack& markStack)
+void JSSharedWorker::visitChildren(SlotVisitor& visitor)
 {
-    Base::markChildren(markStack);
+    Base::visitChildren(visitor);
 
     if (MessagePort* port = impl()->port())
-        markDOMObjectWrapper(markStack, *Heap::heap(this)->globalData(), port);
+        markDOMObjectWrapper(visitor, *Heap::heap(this)->globalData(), port);
 }
 
 EncodedJSValue JSC_HOST_CALL JSSharedWorkerConstructor::constructJSSharedWorker(ExecState* exec)
index f836d8e..fb02530 100644 (file)
@@ -66,10 +66,10 @@ inline void* wrapperContext(DOMWrapperWorld* world, StyleSheet*)
     return world;
 }
 
-void JSStyleSheet::markChildren(MarkStack& markStack)
+void JSStyleSheet::visitChildren(SlotVisitor& visitor)
 {
-    Base::markChildren(markStack);
-    markStack.addOpaqueRoot(root(impl()));
+    Base::visitChildren(visitor);
+    visitor.addOpaqueRoot(root(impl()));
 }
 
 JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, StyleSheet* styleSheet)
index fc64900..69f6c3b 100644 (file)
@@ -29,12 +29,12 @@ using namespace JSC;
 
 namespace WebCore {
     
-void JSTreeWalker::markChildren(MarkStack& markStack)
+void JSTreeWalker::visitChildren(SlotVisitor& visitor)
 {
-    Base::markChildren(markStack);
+    Base::visitChildren(visitor);
 
     if (NodeFilter* filter = m_impl->filter())
-        markStack.addOpaqueRoot(filter);
+        visitor.addOpaqueRoot(filter);
 }
 
 }
index 0f52301..54dc405 100644 (file)
@@ -192,13 +192,13 @@ static JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, WebGLExten
     return jsNull();
 }
 
-void JSWebGLRenderingContext::markChildren(MarkStack& markStack)
+void JSWebGLRenderingContext::visitChildren(SlotVisitor& visitor)
 {
-    Base::markChildren(markStack);
+    Base::visitChildren(visitor);
 
     WebGLRenderingContext* context = static_cast<WebGLRenderingContext*>(impl());
     for (int i = 0; i < context->getNumberOfExtensions(); ++i)
-        markDOMObjectWrapper(markStack, *Heap::heap(this)->globalData(), context->getExtensionNumber(i));
+        markDOMObjectWrapper(visitor, *Heap::heap(this)->globalData(), context->getExtensionNumber(i));
 }
 
 JSValue JSWebGLRenderingContext::getAttachedShaders(ExecState* exec)
index eaf77cf..b4ef381 100644 (file)
@@ -32,16 +32,16 @@ using namespace JSC;
 
 namespace WebCore {
 
-void JSWebKitAnimationList::markChildren(MarkStack& markStack)
+void JSWebKitAnimationList::visitChildren(SlotVisitor& visitor)
 {
-    Base::markChildren(markStack);
+    Base::visitChildren(visitor);
 
     WebKitAnimationList* list = impl();
     JSGlobalData& globalData = *Heap::heap(this)->globalData();
 
     unsigned length = list->length();
     for (unsigned i = 0; i < length; ++i)
-        markDOMObjectWrapper(markStack, globalData, list->item(i));
+        markDOMObjectWrapper(visitor, globalData, list->item(i));
 }
 
 }
index 1103d0b..53c6b98 100644 (file)
@@ -53,18 +53,18 @@ using namespace JSC;
 
 namespace WebCore {
 
-void JSWorkerContext::markChildren(MarkStack& markStack)
+void JSWorkerContext::visitChildren(SlotVisitor& visitor)
 {
-    Base::markChildren(markStack);
+    Base::visitChildren(visitor);
 
     JSGlobalData& globalData = this->globalData();
 
-    markActiveObjectsForContext(markStack, globalData, scriptExecutionContext());
+    visitActiveObjectsForContext(visitor, globalData, scriptExecutionContext());
 
-    markDOMObjectWrapper(markStack, globalData, impl()->optionalLocation());
-    markDOMObjectWrapper(markStack, globalData, impl()->optionalNavigator());
+    markDOMObjectWrapper(visitor, globalData, impl()->optionalLocation());
+    markDOMObjectWrapper(visitor, globalData, impl()->optionalNavigator());
 
-    impl()->markJSEventListeners(markStack);
+    impl()->visitJSEventListeners(visitor);
 }
 
 bool JSWorkerContext::getOwnPropertySlotDelegate(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
index eba5db7..8dd1761 100644 (file)
@@ -54,25 +54,25 @@ using namespace JSC;
 
 namespace WebCore {
 
-void JSXMLHttpRequest::markChildren(MarkStack& markStack)
+void JSXMLHttpRequest::visitChildren(SlotVisitor& visitor)
 {
-    Base::markChildren(markStack);
+    Base::visitChildren(visitor);
 
     if (XMLHttpRequestUpload* upload = m_impl->optionalUpload())
-        markDOMObjectWrapper(markStack, *Heap::heap(this)->globalData(), upload);
+        markDOMObjectWrapper(visitor, *Heap::heap(this)->globalData(), upload);
 
     if (Document* responseDocument = m_impl->optionalResponseXML())
-        markDOMObjectWrapper(markStack, *Heap::heap(this)->globalData(), responseDocument);
+        markDOMObjectWrapper(visitor, *Heap::heap(this)->globalData(), responseDocument);
 
     if (ArrayBuffer* responseArrayBuffer = m_impl->optionalResponseArrayBuffer())
-        markDOMObjectWrapper(markStack, *Heap::heap(this)->globalData(), responseArrayBuffer);
+        markDOMObjectWrapper(visitor, *Heap::heap(this)->globalData(), responseArrayBuffer);
 
 #if ENABLE(XHR_RESPONSE_BLOB)
     if (Blob* responseBlob = m_impl->optionalResponseBlob())
-        markDOMObjectWrapper(markStack, *Heap::heap(this)->globalData(), responseBlob);
+        markDOMObjectWrapper(visitor, *Heap::heap(this)->globalData(), responseBlob);
 #endif
 
-    m_impl->markJSEventListeners(markStack);
+    m_impl->visitJSEventListeners(visitor);
 }
 
 // Custom functions
index 091c380..6b80bb4 100644 (file)
@@ -41,14 +41,14 @@ using namespace JSC;
 
 namespace WebCore {
 
-void JSXMLHttpRequestUpload::markChildren(MarkStack& markStack)
+void JSXMLHttpRequestUpload::visitChildren(SlotVisitor& visitor)
 {
-    Base::markChildren(markStack);
+    Base::visitChildren(visitor);
 
     if (XMLHttpRequest* xmlHttpRequest = m_impl->associatedXMLHttpRequest())
-        markDOMObjectWrapper(markStack, *Heap::heap(this)->globalData(), xmlHttpRequest);
+        markDOMObjectWrapper(visitor, *Heap::heap(this)->globalData(), xmlHttpRequest);
 
-    m_impl->markJSEventListeners(markStack);
+    m_impl->visitJSEventListeners(visitor);
 }
 
 } // namespace WebCore
index 181fd24..016216b 100644 (file)
@@ -751,10 +751,10 @@ sub GenerateHeader
         "        return JSC::Structure::create(globalData, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info);\n" .
         "    }\n\n");
 
-    # markChildren function
+    # visit function
     if ($needsMarkChildren) {
-        push(@headerContent, "    virtual void markChildren(JSC::MarkStack&);\n\n");
-        $structureFlags{"JSC::OverridesMarkChildren"} = 1;
+        push(@headerContent, "    virtual void visitChildren(JSC::SlotVisitor&);\n\n");
+        $structureFlags{"JSC::OverridesVisitChildren"} = 1;
     }
 
     # Custom pushEventHandlerScope function
@@ -955,7 +955,7 @@ sub GenerateHeader
         $structureFlags{"JSC::OverridesGetOwnPropertySlot"} = 1;
     }
     if ($dataNode->extendedAttributes->{"CustomMarkFunction"} or $needsMarkChildren) {
-        $structureFlags{"JSC::OverridesMarkChildren"} = 1;
+        $structureFlags{"JSC::OverridesVisitChildren"} = 1;
     }
     push(@headerContent,
         "    static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype)\n" .
@@ -1431,10 +1431,10 @@ sub GenerateImplementation
     push(@implContent, "}\n\n");
 
     if ($needsMarkChildren && !$dataNode->extendedAttributes->{"CustomMarkFunction"}) {
-        push(@implContent, "void ${className}::markChildren(MarkStack& markStack)\n");
+        push(@implContent, "void ${className}::visitChildren(SlotVisitor& visitor)\n");
         push(@implContent, "{\n");
-        push(@implContent, "    Base::markChildren(markStack);\n");
-        push(@implContent, "    impl()->markJSEventListeners(markStack);\n");
+        push(@implContent, "    Base::visitChildren(visitor);\n");
+        push(@implContent, "    impl()->visitJSEventListeners(visitor);\n");
         push(@implContent, "}\n\n");
     }
 
index 2d29e01..68e2954 100644 (file)
@@ -51,12 +51,12 @@ public:
 
     static const ClassInfo s_info;
 
-    virtual void markChildren(MarkStack& markStack)
+    virtual void visitChildren(SlotVisitor& visitor)
     {
-        RuntimeObject::markChildren(markStack);
+        RuntimeObject::visitChildren(visitor);
         QtInstance* instance = static_cast<QtInstance*>(getInternalInstance());
         if (instance)
-            instance->markAggregate(markStack);
+            instance->visitAggregate(visitor);
     }
 
     static Structure* createStructure(JSGlobalData& globalData, JSValue prototype)
@@ -65,7 +65,7 @@ public:
     }
 
 protected:
-    static const unsigned StructureFlags = RuntimeObject::StructureFlags | OverridesMarkChildren;
+    static const unsigned StructureFlags = RuntimeObject::StructureFlags | OverridesVisitChildren;
 };
 
 const ClassInfo QtRuntimeObject::s_info = { "QtRuntimeObject", &RuntimeObject::s_info, 0, 0 };
@@ -185,12 +185,12 @@ RuntimeObject* QtInstance::newRuntimeObject(ExecState* exec)
     return new (exec) QtRuntimeObject(exec, exec->lexicalGlobalObject(), this);
 }
 
-void QtInstance::markAggregate(MarkStack& markStack)
+void QtInstance::visitAggregate(SlotVisitor& visitor)
 {
     if (m_defaultMethod)
-        markStack.append(&m_defaultMethod);
+        visitor.append(&m_defaultMethod);
     for (QHash<QByteArray, WriteBarrier<JSObject> >::Iterator it = m_methods.begin(), end = m_methods.end(); it != end; ++it)
-        markStack.append(&it.value());
+        visitor.append(&it.value());
 }
 
 void QtInstance::begin()
index b802500..1d51ca2 100644 (file)
@@ -48,7 +48,7 @@ public:
     virtual JSValue valueOf(ExecState*) const;
     virtual JSValue defaultValue(ExecState*, PreferredPrimitiveType) const;
 
-    void markAggregate(MarkStack&);
+    void visitAggregate(SlotVisitor&);
 
     virtual JSValue getMethod(ExecState* exec, const Identifier& propertyName);
     virtual JSValue invokeMethod(ExecState*, RuntimeMethod*);
index c498637..2ddaad6 100644 (file)
@@ -156,7 +156,7 @@ public:
     }
 
 protected:
-    static const unsigned StructureFlags = RuntimeObject::StructureFlags | OverridesMarkChildren;
+    static const unsigned StructureFlags = RuntimeObject::StructureFlags | OverridesVisitChildren;
 };
 
 QtPixmapRuntimeObject::QtPixmapRuntimeObject(ExecState* exec, JSGlobalObject* globalObject, PassRefPtr<Instance> instance)
index 87ee522..ac76ef3 100644 (file)
@@ -1400,14 +1400,14 @@ QtRuntimeMetaMethod::QtRuntimeMetaMethod(ExecState* exec, const Identifier& iden
     d->m_allowPrivate = allowPrivate;
 }
 
-void QtRuntimeMetaMethod::markChildren(MarkStack& markStack)
+void QtRuntimeMetaMethod::visitChildren(SlotVisitor& visitor)
 {
-    QtRuntimeMethod::markChildren(markStack);
+    QtRuntimeMethod::visitChildren(visitor);
     QW_D(QtRuntimeMetaMethod);
     if (d->m_connect)
-        markStack.append(&d->m_connect);
+        visitor.append(&d->m_connect);
     if (d->m_disconnect)
-        markStack.append(&d->m_disconnect);
+        visitor.append(&d->m_disconnect);
 }
 
 EncodedJSValue QtRuntimeMetaMethod::call(ExecState* exec)
index fa5ce62..bdb1aed 100644 (file)
@@ -159,7 +159,7 @@ public:
     }
 
 protected:
-    static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesGetPropertyNames | InternalFunction::StructureFlags | OverridesMarkChildren;
+    static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesGetPropertyNames | InternalFunction::StructureFlags | OverridesVisitChildren;
 
     QtRuntimeMethodData *d_func() const {return d_ptr;}
     QtRuntimeMethod(QtRuntimeMethodData *dd, ExecState *exec, const Identifier &n, PassRefPtr<QtInstance> inst);
@@ -175,7 +175,7 @@ public:
     virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
     virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties);
 
-    virtual void markChildren(MarkStack& markStack);
+    virtual void visitChildren(SlotVisitor&);
 
 protected:
     QtRuntimeMetaMethodData* d_func() const {return reinterpret_cast<QtRuntimeMetaMethodData*>(d_ptr);}
index 348704f..3086135 100644 (file)
@@ -26,6 +26,7 @@
 namespace JSC {
     class JSObject;
     class MarkStack;
+    typedef MarkStack SlotVisitor;
 }
 
 namespace WebCore {
@@ -53,7 +54,7 @@ namespace WebCore {
         virtual bool wasCreatedFromMarkup() const { return false; }
 
 #if USE(JSC)
-        virtual void markJSFunction(JSC::MarkStack&) { }
+        virtual void visitJSFunction(JSC::SlotVisitor&) { }
 #endif
 
         bool isAttribute() const { return virtualisAttribute(); }
index 3544ce6..81902d0 100644 (file)
@@ -170,7 +170,7 @@ namespace WebCore {
         bool isFiringEventListeners();
 
 #if USE(JSC)
-        void markJSEventListeners(JSC::MarkStack&);
+        void visitJSEventListeners(JSC::SlotVisitor&);
         void invalidateJSEventListeners(JSC::JSObject*);
 #endif
 
@@ -223,7 +223,7 @@ namespace WebCore {
 #endif
 
 #if USE(JSC)
-    inline void EventTarget::markJSEventListeners(JSC::MarkStack& markStack)
+    inline void EventTarget::visitJSEventListeners(JSC::SlotVisitor& visitor)
     {
         EventTargetData* d = eventTargetData();
         if (!d)
@@ -233,7 +233,7 @@ namespace WebCore {
         for (EventListenerMap::iterator it = d->eventListenerMap.begin(); it != end; ++it) {
             EventListenerVector& entry = *it->second;
             for (size_t i = 0; i < entry.size(); ++i)
-                entry[i].listener->markJSFunction(markStack);
+                entry[i].listener->visitJSFunction(visitor);
         }
     }
 #endif
index 3acaefc..301c4de 100644 (file)
@@ -37,6 +37,7 @@
 namespace JSC {
     class JSGlobalData;
     class MarkStack;
+    typedef MarkStack SlotVisitor;
 }
 #endif
 
index 0d6313f..4660764 100644 (file)
@@ -30,6 +30,7 @@
 
 namespace JSC {
     class MarkStack;
+    typedef MarkStack SlotVisitor;
 }
 
 namespace WebCore {
@@ -40,7 +41,7 @@ namespace WebCore {
     public:
         virtual ~NodeFilterCondition() { }
         virtual short acceptNode(ScriptState*, Node*) const = 0;
-        virtual void markAggregate(JSC::MarkStack&) { }
+        virtual void visitAggregate(JSC::SlotVisitor&) { }
     };
 
 } // namespace WebCore
index 6c9640e..99c9ab7 100644 (file)
@@ -340,7 +340,7 @@ namespace WebCore {
 
         void finishedLoading();
 
-        // These functions are used for GC marking. See JSDOMWindow::markChildren(MarkStack&) in JSDOMWindowCustom.cpp.
+        // These functions are used for GC marking. See JSDOMWindow::visitChildren(SlotVisitor&) in JSDOMWindowCustom.cpp.
         Screen* optionalScreen() const { return m_screen.get(); }
         DOMSelection* optionalSelection() const { return m_selection.get(); }
         History* optionalHistory() const { return m_history.get(); }
index 8237da1..0737679 100644 (file)
@@ -141,7 +141,7 @@ namespace WebCore {
 #if ENABLE(INSPECTOR)
         WorkerInspectorController* workerInspectorController() { return m_workerInspectorController.get(); }
 #endif
-        // These methods are used for GC marking. See JSWorkerContext::markChildren(MarkStack&) in
+        // These methods are used for GC marking. See JSWorkerContext::visitChildren(SlotVisitor&) in
         // JSWorkerContextCustom.cpp.
         WorkerNavigator* optionalNavigator() const { return m_navigator.get(); }
         WorkerLocation* optionalLocation() const { return m_location.get(); }