Add static version of JSCell::visitChildren
authormhahnenberg@apple.com <mhahnenberg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Sep 2011 19:40:09 +0000 (19:40 +0000)
committermhahnenberg@apple.com <mhahnenberg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Sep 2011 19:40:09 +0000 (19:40 +0000)
https://bugs.webkit.org/show_bug.cgi?id=68404

Reviewed by Darin Adler.

.:

In this patch we just extract the bodies of the virtual visitChildren methods
throughout the JSCell inheritance hierarchy out into static methods, which are
now called from the virtual methods.  This is an intermediate step in trying to
move the virtual-ness of visitChildren into our own custom vtable stored in
ClassInfo.  We need to convert the methods to static methods in order to be
able to more easily store and refer to them in our custom vtable since normal
member methods store some implicit information in their types, making it
impossible to store them generically in ClassInfo.

* Source/autotools/symbols.filter:

Source/JavaScriptCore:

In this patch we just extract the bodies of the virtual visitChildren methods
throughout the JSCell inheritance hierarchy out into static methods, which are
now called from the virtual methods.  This is an intermediate step in trying to
move the virtual-ness of visitChildren into our own custom vtable stored in
ClassInfo.  We need to convert the methods to static methods in order to be
able to more easily store and refer to them in our custom vtable since normal
member methods store some implicit information in their types, making it
impossible to store them generically in ClassInfo.

* API/JSCallbackObject.h:
(JSC::JSCallbackObject::visitChildrenVirtual):
(JSC::JSCallbackObject::visitChildren):
* JavaScriptCore.exp:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
* debugger/DebuggerActivation.cpp:
(JSC::DebuggerActivation::visitChildrenVirtual):
(JSC::DebuggerActivation::visitChildren):
* debugger/DebuggerActivation.h:
* heap/MarkStack.cpp:
(JSC::SlotVisitor::visitChildren):
(JSC::SlotVisitor::drain):
* runtime/Arguments.cpp:
(JSC::Arguments::visitChildrenVirtual):
(JSC::Arguments::visitChildren):
* runtime/Arguments.h:
* runtime/Executable.cpp:
(JSC::EvalExecutable::visitChildrenVirtual):
(JSC::EvalExecutable::visitChildren):
(JSC::ProgramExecutable::visitChildrenVirtual):
(JSC::ProgramExecutable::visitChildren):
(JSC::FunctionExecutable::visitChildrenVirtual):
(JSC::FunctionExecutable::visitChildren):
* runtime/Executable.h:
* runtime/GetterSetter.cpp:
(JSC::GetterSetter::visitChildrenVirtual):
(JSC::GetterSetter::visitChildren):
* runtime/GetterSetter.h:
* runtime/JSActivation.cpp:
(JSC::JSActivation::visitChildrenVirtual):
(JSC::JSActivation::visitChildren):
* runtime/JSActivation.h:
* runtime/JSArray.cpp:
(JSC::JSArray::visitChildrenVirtual):
(JSC::JSArray::visitChildren):
* runtime/JSArray.h:
* runtime/JSBoundFunction.cpp:
(JSC::JSBoundFunction::visitChildrenVirtual):
(JSC::JSBoundFunction::visitChildren):
* runtime/JSBoundFunction.h:
* runtime/JSCell.h:
(JSC::JSCell::visitChildrenVirtual):
(JSC::JSCell::visitChildren):
* runtime/JSFunction.cpp:
(JSC::JSFunction::visitChildrenVirtual):
(JSC::JSFunction::visitChildren):
* runtime/JSFunction.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::visitChildrenVirtual):
(JSC::JSGlobalObject::visitChildren):
* runtime/JSGlobalObject.h:
* runtime/JSObject.cpp:
(JSC::JSObject::visitChildrenVirtual):
(JSC::JSObject::visitChildren):
* runtime/JSObject.h:
(JSC::JSObject::visitChildrenDirect):
* runtime/JSPropertyNameIterator.cpp:
(JSC::JSPropertyNameIterator::visitChildrenVirtual):
(JSC::JSPropertyNameIterator::visitChildren):
* runtime/JSPropertyNameIterator.h:
* runtime/JSStaticScopeObject.cpp:
(JSC::JSStaticScopeObject::visitChildrenVirtual):
(JSC::JSStaticScopeObject::visitChildren):
* runtime/JSStaticScopeObject.h:
* runtime/JSWrapperObject.cpp:
(JSC::JSWrapperObject::visitChildrenVirtual):
(JSC::JSWrapperObject::visitChildren):
* runtime/JSWrapperObject.h:
* runtime/NativeErrorConstructor.cpp:
(JSC::NativeErrorConstructor::visitChildrenVirtual):
(JSC::NativeErrorConstructor::visitChildren):
* runtime/NativeErrorConstructor.h:
* runtime/RegExpObject.cpp:
(JSC::RegExpObject::visitChildrenVirtual):
(JSC::RegExpObject::visitChildren):
* runtime/RegExpObject.h:
* runtime/ScopeChain.cpp:
(JSC::ScopeChainNode::visitChildrenVirtual):
(JSC::ScopeChainNode::visitChildren):
* runtime/ScopeChain.h:
* runtime/Structure.cpp:
(JSC::Structure::visitChildrenVirtual):
(JSC::Structure::visitChildren):
* runtime/Structure.h:
* runtime/StructureChain.cpp:
(JSC::StructureChain::visitChildrenVirtual):
(JSC::StructureChain::visitChildren):
* runtime/StructureChain.h:

Source/JavaScriptGlue:

In this patch we just extract the bodies of the virtual visitChildren methods
throughout the JSCell inheritance hierarchy out into static methods, which are
now called from the virtual methods.  This is an intermediate step in trying to
move the virtual-ness of visitChildren into our own custom vtable stored in
ClassInfo.  We need to convert the methods to static methods in order to be
able to more easily store and refer to them in our custom vtable since normal
member methods store some implicit information in their types, making it
impossible to store them generically in ClassInfo.

* UserObjectImp.cpp:
(UserObjectImp::visitChildrenVirtual):
(UserObjectImp::visitChildren):
* UserObjectImp.h:

Source/WebCore:

No new tests.

In this patch we just extract the bodies of the virtual visitChildren methods
throughout the JSCell inheritance hierarchy out into static methods, which are
now called from the virtual methods.  This is an intermediate step in trying to
move the virtual-ness of visitChildren into our own custom vtable stored in
ClassInfo.  We need to convert the methods to static methods in order to be
able to more easily store and refer to them in our custom vtable since normal
member methods store some implicit information in their types, making it
impossible to store them generically in ClassInfo.

* WebCore.exp.in:
* bindings/js/JSAttrCustom.cpp:
(WebCore::JSAttr::visitChildrenVirtual):
(WebCore::JSAttr::visitChildren):
* bindings/js/JSAudioContextCustom.cpp:
(WebCore::JSAudioContext::visitChildrenVirtual):
(WebCore::JSAudioContext::visitChildren):
* bindings/js/JSCSSRuleCustom.cpp:
(WebCore::JSCSSRule::visitChildrenVirtual):
(WebCore::JSCSSRule::visitChildren):
* bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::JSCSSStyleDeclaration::visitChildrenVirtual):
(WebCore::JSCSSStyleDeclaration::visitChildren):
* bindings/js/JSCanvasRenderingContextCustom.cpp:
(WebCore::JSCanvasRenderingContext::visitChildrenVirtual):
(WebCore::JSCanvasRenderingContext::visitChildren):
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::visitChildrenVirtual):
(WebCore::JSDOMGlobalObject::visitChildren):
* bindings/js/JSDOMGlobalObject.h:
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::visitChildrenVirtual):
(WebCore::JSDOMWindow::visitChildren):
* bindings/js/JSDOMWindowShell.cpp:
(WebCore::JSDOMWindowShell::visitChildrenVirtual):
(WebCore::JSDOMWindowShell::visitChildren):
* bindings/js/JSDOMWindowShell.h:
* bindings/js/JSJavaScriptAudioNodeCustom.cpp:
(WebCore::JSJavaScriptAudioNode::visitChildrenVirtual):
(WebCore::JSJavaScriptAudioNode::visitChildren):
* bindings/js/JSMessageChannelCustom.cpp:
(WebCore::JSMessageChannel::visitChildrenVirtual):
(WebCore::JSMessageChannel::visitChildren):
* bindings/js/JSMessagePortCustom.cpp:
(WebCore::JSMessagePort::visitChildrenVirtual):
(WebCore::JSMessagePort::visitChildren):
* bindings/js/JSNamedNodeMapCustom.cpp:
(WebCore::JSNamedNodeMap::visitChildrenVirtual):
(WebCore::JSNamedNodeMap::visitChildren):
* bindings/js/JSNodeCustom.cpp:
(WebCore::JSNode::visitChildrenVirtual):
(WebCore::JSNode::visitChildren):
* bindings/js/JSNodeFilterCustom.cpp:
(WebCore::JSNodeFilter::visitChildrenVirtual):
(WebCore::JSNodeFilter::visitChildren):
* bindings/js/JSNodeIteratorCustom.cpp:
(WebCore::JSNodeIterator::visitChildrenVirtual):
(WebCore::JSNodeIterator::visitChildren):
* bindings/js/JSSVGElementInstanceCustom.cpp:
(WebCore::JSSVGElementInstance::visitChildrenVirtual):
(WebCore::JSSVGElementInstance::visitChildren):
* bindings/js/JSSharedWorkerCustom.cpp:
(WebCore::JSSharedWorker::visitChildrenVirtual):
(WebCore::JSSharedWorker::visitChildren):
* bindings/js/JSStyleSheetCustom.cpp:
(WebCore::JSStyleSheet::visitChildrenVirtual):
(WebCore::JSStyleSheet::visitChildren):
* bindings/js/JSTreeWalkerCustom.cpp:
(WebCore::JSTreeWalker::visitChildrenVirtual):
(WebCore::JSTreeWalker::visitChildren):
* bindings/js/JSWebGLRenderingContextCustom.cpp:
(WebCore::JSWebGLRenderingContext::visitChildrenVirtual):
(WebCore::JSWebGLRenderingContext::visitChildren):
* bindings/js/JSWorkerContextCustom.cpp:
(WebCore::JSWorkerContext::visitChildrenVirtual):
(WebCore::JSWorkerContext::visitChildren):
* bindings/js/JSXMLHttpRequestCustom.cpp:
(WebCore::JSXMLHttpRequest::visitChildrenVirtual):
(WebCore::JSXMLHttpRequest::visitChildren):
* bindings/js/JSXPathResultCustom.cpp:
(WebCore::JSXPathResult::visitChildrenVirtual):
(WebCore::JSXPathResult::visitChildren):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObj::visitChildrenVirtual):
(WebCore::JSTestObj::visitChildren):
* bindings/scripts/test/JS/JSTestObj.h:
* bridge/qt/qt_instance.cpp:
(JSC::Bindings::QtRuntimeObject::visitChildrenVirtual):
(JSC::Bindings::QtRuntimeObject::visitChildren):
* bridge/qt/qt_runtime.cpp:
(JSC::Bindings::QtRuntimeMetaMethod::visitChildrenVirtual):
(JSC::Bindings::QtRuntimeMetaMethod::visitChildren):
* bridge/qt/qt_runtime.h:
* workers/WorkerContext.h:

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

81 files changed:
ChangeLog
Source/JavaScriptCore/API/JSCallbackObject.h
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/JavaScriptCore.exp
Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
Source/JavaScriptCore/debugger/DebuggerActivation.cpp
Source/JavaScriptCore/debugger/DebuggerActivation.h
Source/JavaScriptCore/heap/MarkStack.cpp
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/JSActivation.cpp
Source/JavaScriptCore/runtime/JSActivation.h
Source/JavaScriptCore/runtime/JSArray.cpp
Source/JavaScriptCore/runtime/JSArray.h
Source/JavaScriptCore/runtime/JSBoundFunction.cpp
Source/JavaScriptCore/runtime/JSBoundFunction.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/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/JSWrapperObject.cpp
Source/JavaScriptCore/runtime/JSWrapperObject.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/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/WebCore.exp.in
Source/WebCore/bindings/js/JSAttrCustom.cpp
Source/WebCore/bindings/js/JSAudioContextCustom.cpp
Source/WebCore/bindings/js/JSCSSRuleCustom.cpp
Source/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp
Source/WebCore/bindings/js/JSCanvasRenderingContextCustom.cpp
Source/WebCore/bindings/js/JSDOMGlobalObject.cpp
Source/WebCore/bindings/js/JSDOMGlobalObject.h
Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
Source/WebCore/bindings/js/JSDOMWindowShell.cpp
Source/WebCore/bindings/js/JSDOMWindowShell.h
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/JSNodeCustom.cpp
Source/WebCore/bindings/js/JSNodeFilterCustom.cpp
Source/WebCore/bindings/js/JSNodeIteratorCustom.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/JSWorkerContextCustom.cpp
Source/WebCore/bindings/js/JSXMLHttpRequestCustom.cpp
Source/WebCore/bindings/js/JSXPathResultCustom.cpp
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestObj.h
Source/WebCore/bridge/qt/qt_instance.cpp
Source/WebCore/bridge/qt/qt_runtime.cpp
Source/WebCore/bridge/qt/qt_runtime.h
Source/WebCore/workers/WorkerContext.h
Source/autotools/symbols.filter

index 368bf49..f798e82 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2011-09-23  Mark Hahnenberg  <mhahnenberg@apple.com>
+
+        Add static version of JSCell::visitChildren
+        https://bugs.webkit.org/show_bug.cgi?id=68404
+
+        Reviewed by Darin Adler.
+
+        In this patch we just extract the bodies of the virtual visitChildren methods
+        throughout the JSCell inheritance hierarchy out into static methods, which are 
+        now called from the virtual methods.  This is an intermediate step in trying to 
+        move the virtual-ness of visitChildren into our own custom vtable stored in 
+        ClassInfo.  We need to convert the methods to static methods in order to be 
+        able to more easily store and refer to them in our custom vtable since normal 
+        member methods store some implicit information in their types, making it 
+        impossible to store them generically in ClassInfo.
+
+        * Source/autotools/symbols.filter:
+
 2011-09-21  Julien Chaffraix  <jchaffraix@webkit.org>
 
         Crash in RenderBox::paintMaskImages when GraphicsContext's painting is disabled
index 4b7a42b..1defb4e 100644 (file)
@@ -196,13 +196,19 @@ private:
     virtual ConstructType getConstructData(ConstructData&);
     virtual CallType getCallData(CallData&);
 
-    virtual void visitChildren(SlotVisitor& visitor)
+    virtual void visitChildrenVirtual(SlotVisitor& visitor)
     {
-        ASSERT_GC_OBJECT_INHERITS((static_cast<Parent*>(this)), &JSCallbackObject<Parent>::s_info);
+        visitChildren(this, visitor);
+    }
+
+    static void visitChildren(JSCell* cell, SlotVisitor& visitor)
+    {
+        JSCallbackObject* thisObject = static_cast<JSCallbackObject*>(cell);
+        ASSERT_GC_OBJECT_INHERITS((static_cast<Parent*>(thisObject)), &JSCallbackObject<Parent>::s_info);
         COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
-        ASSERT(Parent::structure()->typeInfo().overridesVisitChildren());
-        Parent::visitChildren(visitor);
-        m_callbackObjectData->visitChildren(visitor);
+        ASSERT(thisObject->Parent::structure()->typeInfo().overridesVisitChildren());
+        Parent::visitChildren(thisObject, visitor);
+        thisObject->m_callbackObjectData->visitChildren(visitor);
     }
 
     void init(ExecState*);
index 01d7467..d518a7e 100644 (file)
@@ -1,3 +1,108 @@
+2011-09-23  Mark Hahnenberg  <mhahnenberg@apple.com>
+
+        Add static version of JSCell::visitChildren
+        https://bugs.webkit.org/show_bug.cgi?id=68404
+
+        Reviewed by Darin Adler.
+
+        In this patch we just extract the bodies of the virtual visitChildren methods
+        throughout the JSCell inheritance hierarchy out into static methods, which are 
+        now called from the virtual methods.  This is an intermediate step in trying to 
+        move the virtual-ness of visitChildren into our own custom vtable stored in 
+        ClassInfo.  We need to convert the methods to static methods in order to be 
+        able to more easily store and refer to them in our custom vtable since normal 
+        member methods store some implicit information in their types, making it 
+        impossible to store them generically in ClassInfo.
+
+        * API/JSCallbackObject.h:
+        (JSC::JSCallbackObject::visitChildrenVirtual):
+        (JSC::JSCallbackObject::visitChildren):
+        * JavaScriptCore.exp:
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+        * debugger/DebuggerActivation.cpp:
+        (JSC::DebuggerActivation::visitChildrenVirtual):
+        (JSC::DebuggerActivation::visitChildren):
+        * debugger/DebuggerActivation.h:
+        * heap/MarkStack.cpp:
+        (JSC::SlotVisitor::visitChildren):
+        (JSC::SlotVisitor::drain):
+        * runtime/Arguments.cpp:
+        (JSC::Arguments::visitChildrenVirtual):
+        (JSC::Arguments::visitChildren):
+        * runtime/Arguments.h:
+        * runtime/Executable.cpp:
+        (JSC::EvalExecutable::visitChildrenVirtual):
+        (JSC::EvalExecutable::visitChildren):
+        (JSC::ProgramExecutable::visitChildrenVirtual):
+        (JSC::ProgramExecutable::visitChildren):
+        (JSC::FunctionExecutable::visitChildrenVirtual):
+        (JSC::FunctionExecutable::visitChildren):
+        * runtime/Executable.h:
+        * runtime/GetterSetter.cpp:
+        (JSC::GetterSetter::visitChildrenVirtual):
+        (JSC::GetterSetter::visitChildren):
+        * runtime/GetterSetter.h:
+        * runtime/JSActivation.cpp:
+        (JSC::JSActivation::visitChildrenVirtual):
+        (JSC::JSActivation::visitChildren):
+        * runtime/JSActivation.h:
+        * runtime/JSArray.cpp:
+        (JSC::JSArray::visitChildrenVirtual):
+        (JSC::JSArray::visitChildren):
+        * runtime/JSArray.h:
+        * runtime/JSBoundFunction.cpp:
+        (JSC::JSBoundFunction::visitChildrenVirtual):
+        (JSC::JSBoundFunction::visitChildren):
+        * runtime/JSBoundFunction.h:
+        * runtime/JSCell.h:
+        (JSC::JSCell::visitChildrenVirtual):
+        (JSC::JSCell::visitChildren):
+        * runtime/JSFunction.cpp:
+        (JSC::JSFunction::visitChildrenVirtual):
+        (JSC::JSFunction::visitChildren):
+        * runtime/JSFunction.h:
+        * runtime/JSGlobalObject.cpp:
+        (JSC::JSGlobalObject::visitChildrenVirtual):
+        (JSC::JSGlobalObject::visitChildren):
+        * runtime/JSGlobalObject.h:
+        * runtime/JSObject.cpp:
+        (JSC::JSObject::visitChildrenVirtual):
+        (JSC::JSObject::visitChildren):
+        * runtime/JSObject.h:
+        (JSC::JSObject::visitChildrenDirect):
+        * runtime/JSPropertyNameIterator.cpp:
+        (JSC::JSPropertyNameIterator::visitChildrenVirtual):
+        (JSC::JSPropertyNameIterator::visitChildren):
+        * runtime/JSPropertyNameIterator.h:
+        * runtime/JSStaticScopeObject.cpp:
+        (JSC::JSStaticScopeObject::visitChildrenVirtual):
+        (JSC::JSStaticScopeObject::visitChildren):
+        * runtime/JSStaticScopeObject.h:
+        * runtime/JSWrapperObject.cpp:
+        (JSC::JSWrapperObject::visitChildrenVirtual):
+        (JSC::JSWrapperObject::visitChildren):
+        * runtime/JSWrapperObject.h:
+        * runtime/NativeErrorConstructor.cpp:
+        (JSC::NativeErrorConstructor::visitChildrenVirtual):
+        (JSC::NativeErrorConstructor::visitChildren):
+        * runtime/NativeErrorConstructor.h:
+        * runtime/RegExpObject.cpp:
+        (JSC::RegExpObject::visitChildrenVirtual):
+        (JSC::RegExpObject::visitChildren):
+        * runtime/RegExpObject.h:
+        * runtime/ScopeChain.cpp:
+        (JSC::ScopeChainNode::visitChildrenVirtual):
+        (JSC::ScopeChainNode::visitChildren):
+        * runtime/ScopeChain.h:
+        * runtime/Structure.cpp:
+        (JSC::Structure::visitChildrenVirtual):
+        (JSC::Structure::visitChildren):
+        * runtime/Structure.h:
+        * runtime/StructureChain.cpp:
+        (JSC::StructureChain::visitChildrenVirtual):
+        (JSC::StructureChain::visitChildren):
+        * runtime/StructureChain.h:
+
 2011-09-23  Oliver Hunt  <oliver@apple.com>
 
         Node propagation doesn't handle PutScopedVar
index f9ef527..04c53fb 100644 (file)
@@ -162,10 +162,11 @@ __ZN3JSC13StatementNode6setLocEii
 __ZN3JSC14JSGlobalObject10globalExecEv
 __ZN3JSC14JSGlobalObject12defineGetterEPNS_9ExecStateERKNS_10IdentifierEPNS_8JSObjectEj
 __ZN3JSC14JSGlobalObject12defineSetterEPNS_9ExecStateERKNS_10IdentifierEPNS_8JSObjectEj
-__ZN3JSC14JSGlobalObject13visitChildrenERNS_11SlotVisitorE
+__ZN3JSC14JSGlobalObject13visitChildrenEPNS_6JSCellERNS_11SlotVisitorE
 __ZN3JSC14JSGlobalObject16addStaticGlobalsEPNS0_18GlobalPropertyInfoEi
 __ZN3JSC14JSGlobalObject17putWithAttributesEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueEj
 __ZN3JSC14JSGlobalObject18getOwnPropertySlotEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE
+__ZN3JSC14JSGlobalObject20visitChildrenVirtualERNS_11SlotVisitorE
 __ZN3JSC14JSGlobalObject24getOwnPropertyDescriptorEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE
 __ZN3JSC14JSGlobalObject3putEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueERNS_15PutPropertySlotE  
 __ZN3JSC14JSGlobalObject4initEPNS_8JSObjectE
@@ -179,7 +180,6 @@ __ZN3JSC14TimeoutChecker10didTimeOutEPNS_9ExecStateE
 __ZN3JSC14TimeoutChecker5resetEv
 __ZN3JSC14VTableSpectrum5countEPNS_6JSCellE
 __ZN3JSC14throwTypeErrorEPNS_9ExecStateE
-__ZN3JSC15JSWrapperObject13visitChildrenERNS_11SlotVisitorE
 __ZN3JSC15WeakHandleOwner26isReachableFromOpaqueRootsENS_6HandleINS_7UnknownEEEPvRNS_11SlotVisitorE
 __ZN3JSC15WeakHandleOwner8finalizeENS_6HandleINS_7UnknownEEEPv
 __ZN3JSC15WeakHandleOwnerD2Ev
@@ -275,11 +275,11 @@ __ZN3JSC6JSLockC1EPNS_9ExecStateE
 __ZN3JSC6RegExp5matchERNS_12JSGlobalDataERKNS_7UStringEiPN3WTF6VectorIiLm32EEE
 __ZN3JSC6RegExp6createERNS_12JSGlobalDataERKNS_7UStringENS_11RegExpFlagsE
 __ZN3JSC6RegExpD1Ev
-__ZN3JSC7JSArray13visitChildrenERNS_11SlotVisitorE
 __ZN3JSC7JSArray14finishCreationERNS_12JSGlobalDataE
 __ZN3JSC7JSArray14finishCreationERNS_12JSGlobalDataERKNS_7ArgListE
 __ZN3JSC7JSArray15setSubclassDataEPv
 __ZN3JSC7JSArray18getOwnPropertySlotEPNS_9ExecStateEjRNS_12PropertySlotE
+__ZN3JSC7JSArray20visitChildrenVirtualERNS_11SlotVisitorE
 __ZN3JSC7JSArray6s_infoE
 __ZN3JSC7JSArray9setLengthEj
 __ZN3JSC7JSArrayC1ERNS_12JSGlobalDataEPNS_9StructureE
@@ -308,7 +308,7 @@ __ZN3JSC8JSObject12defineGetterEPNS_9ExecStateERKNS_10IdentifierEPS0_j
 __ZN3JSC8JSObject12defineSetterEPNS_9ExecStateERKNS_10IdentifierEPS0_j
 __ZN3JSC8JSObject12lookupGetterEPNS_9ExecStateERKNS_10IdentifierE
 __ZN3JSC8JSObject12lookupSetterEPNS_9ExecStateERKNS_10IdentifierE
-__ZN3JSC8JSObject13visitChildrenERNS_11SlotVisitorE
+__ZN3JSC8JSObject13visitChildrenEPNS_6JSCellERNS_11SlotVisitorE
 __ZN3JSC8JSObject14deletePropertyEPNS_9ExecStateERKNS_10IdentifierE
 __ZN3JSC8JSObject14deletePropertyEPNS_9ExecStateEj
 __ZN3JSC8JSObject15unwrappedObjectEv
@@ -324,6 +324,7 @@ __ZN3JSC8JSObject17putWithAttributesEPNS_9ExecStateEjNS_7JSValueEj
 __ZN3JSC8JSObject18getOwnPropertySlotEPNS_9ExecStateEjRNS_12PropertySlotE
 __ZN3JSC8JSObject18getPrimitiveNumberEPNS_9ExecStateERdRNS_7JSValueE
 __ZN3JSC8JSObject19getOwnPropertyNamesEPNS_9ExecStateERNS_17PropertyNameArrayENS_15EnumerationModeE
+__ZN3JSC8JSObject20visitChildrenVirtualERNS_11SlotVisitorE
 __ZN3JSC8JSObject21getPropertyDescriptorEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE
 __ZN3JSC8JSObject22fillGetterPropertySlotERNS_12PropertySlotEPNS_16WriteBarrierBaseINS_7UnknownEEE
 __ZN3JSC8JSObject23allocatePropertyStorageERNS_12JSGlobalDataEmm
index d51f2b0..b1fe352 100644 (file)
@@ -376,11 +376,12 @@ EXPORTS
     ?unwrappedObject@JSObject@JSC@@UAEPAV12@XZ
     ?utf8@UString@JSC@@QBE?AVCString@WTF@@_N@Z
     ?validateValue@MarkStack@JSC@@KAXVJSValue@2@@Z
-    ?visitChildren@JSGlobalObject@JSC@@UAEXAAVSlotVisitor@2@@Z
-    ?visitChildren@JSObject@JSC@@UAEXAAVSlotVisitor@2@@Z
-    ?visitChildren@JSWrapperObject@JSC@@EAEXAAVSlotVisitor@2@@Z
-    ?visitChildren@ScopeChainNode@JSC@@UAEXAAVSlotVisitor@2@@Z
     ?vtableAnchor@InternalFunction@JSC@@EAEXXZ
+    ?visitChildren@JSGlobalObject@JSC@@SAXPAVJSCell@2@AAVSlotVisitor@2@@Z
+    ?visitChildren@JSObject@JSC@@SAXPAVJSCell@2@AAVSlotVisitor@2@@Z
+    ?visitChildrenVirtual@JSGlobalObject@JSC@@UAEXAAVSlotVisitor@2@@Z
+    ?visitChildrenVirtual@JSObject@JSC@@UAEXAAVSlotVisitor@2@@Z
+    ?visitChildrenVirtual@ScopeChainNode@JSC@@UAEXAAVSlotVisitor@2@@Z
     ?wait@ThreadCondition@WTF@@QAEXAAVMutex@2@@Z
     ?waitForThreadCompletion@WTF@@YAHIPAPAX@Z
     ?writable@PropertyDescriptor@JSC@@QBE_NXZ
index af6a56f..ef97b0f 100644 (file)
@@ -43,15 +43,21 @@ void DebuggerActivation::finishCreation(JSGlobalData& globalData, JSObject* acti
     m_activation.set(globalData, this, static_cast<JSActivation*>(activation));
 }
 
-void DebuggerActivation::visitChildren(SlotVisitor& visitor)
+void DebuggerActivation::visitChildrenVirtual(SlotVisitor& visitor)
 {
-    ASSERT_GC_OBJECT_INHERITS(this, &s_info);
+    visitChildren(this, visitor);
+}
+
+void DebuggerActivation::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    DebuggerActivation* thisObject = static_cast<DebuggerActivation*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
-    ASSERT(structure()->typeInfo().overridesVisitChildren());
-    JSObject::visitChildren(visitor);
+    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
+    JSObject::visitChildren(thisObject, visitor);
 
-    if (m_activation)
-        visitor.append(&m_activation);
+    if (thisObject->m_activation)
+        visitor.append(&thisObject->m_activation);
 }
 
 UString DebuggerActivation::className() const
index ccdbde8..b0c20c2 100644 (file)
@@ -41,7 +41,8 @@ namespace JSC {
             return activation;
         }
 
-        virtual void visitChildren(SlotVisitor&);
+        virtual void visitChildrenVirtual(SlotVisitor&);
+        static void visitChildren(JSCell*, SlotVisitor&);
         virtual UString className() const;
         virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&);
         virtual void put(ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
index fd668bd..c39c57f 100644 (file)
@@ -59,7 +59,7 @@ inline void SlotVisitor::visitChildren(JSCell* cell)
 
     ASSERT(Heap::isMarked(cell));
     if (cell->structure()->typeInfo().type() < CompoundType) {
-        cell->JSCell::visitChildren(*this);
+        JSCell::visitChildren(cell, *this);
         return;
     }
 
@@ -70,7 +70,7 @@ inline void SlotVisitor::visitChildren(JSCell* cell)
 #else
         ASSERT(!m_isCheckingForDefaultMarkViolation);
         m_isCheckingForDefaultMarkViolation = true;
-        cell->visitChildren(*this);
+        cell->visitChildrenVirtual(*this);
         ASSERT(m_isCheckingForDefaultMarkViolation);
         m_isCheckingForDefaultMarkViolation = false;
 #endif
@@ -80,7 +80,7 @@ inline void SlotVisitor::visitChildren(JSCell* cell)
         asArray(cell)->visitChildrenDirect(*this);
         return;
     }
-    cell->visitChildren(*this);
+    cell->visitChildrenVirtual(*this);
 }
 
 void SlotVisitor::drain()
@@ -115,7 +115,7 @@ void SlotVisitor::drain()
 #if ENABLE(SIMPLE_HEAP_PROFILING)
                 m_visitedTypeCounts.count(cell);
 #endif
-                cell->JSCell::visitChildren(*this);
+                JSCell::visitChildren(cell, *this);
                 if (current.m_values == end) {
                     m_markSets.removeLast();
                     continue;
index ec6cc8f..bef30d8 100644 (file)
@@ -43,25 +43,31 @@ Arguments::~Arguments()
         delete [] d->extraArguments;
 }
 
-void Arguments::visitChildren(SlotVisitor& visitor)
+void Arguments::visitChildrenVirtual(SlotVisitor& visitor)
 {
-    ASSERT_GC_OBJECT_INHERITS(this, &s_info);
+    visitChildren(this, visitor);
+}
+
+void Arguments::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    Arguments* thisObject = static_cast<Arguments*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
-    ASSERT(structure()->typeInfo().overridesVisitChildren());
-    JSObject::visitChildren(visitor);
+    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
+    JSObject::visitChildren(thisObject, visitor);
 
-    if (d->registerArray)
-        visitor.appendValues(d->registerArray.get(), d->numParameters);
+    if (thisObject->d->registerArray)
+        visitor.appendValues(thisObject->d->registerArray.get(), thisObject->d->numParameters);
 
-    if (d->extraArguments) {
-        unsigned numExtraArguments = d->numArguments - d->numParameters;
-        visitor.appendValues(d->extraArguments, numExtraArguments);
+    if (thisObject->d->extraArguments) {
+        unsigned numExtraArguments = thisObject->d->numArguments - thisObject->d->numParameters;
+        visitor.appendValues(thisObject->d->extraArguments, numExtraArguments);
     }
 
-    visitor.append(&d->callee);
+    visitor.append(&thisObject->d->callee);
 
-    if (d->activation)
-        visitor.append(&d->activation);
+    if (thisObject->d->activation)
+        visitor.append(&thisObject->d->activation);
 }
 
 void Arguments::copyToRegisters(ExecState* exec, Register* buffer, uint32_t maxSize)
index 56113df..5e23074 100644 (file)
@@ -90,7 +90,8 @@ namespace JSC {
 
         static const ClassInfo s_info;
 
-        virtual void visitChildren(SlotVisitor&);
+        virtual void visitChildrenVirtual(SlotVisitor&);
+        static void visitChildren(JSCell*, SlotVisitor&);
 
         void fillArgList(ExecState*, MarkedArgumentBuffer&);
 
index 7fb6942..2c317c9 100644 (file)
@@ -234,14 +234,20 @@ void EvalExecutable::jettisonOptimizedCode(JSGlobalData& globalData)
 }
 #endif
 
-void EvalExecutable::visitChildren(SlotVisitor& visitor)
+void EvalExecutable::visitChildrenVirtual(SlotVisitor& visitor)
 {
-    ASSERT_GC_OBJECT_INHERITS(this, &s_info);
+    visitChildren(this, visitor);
+}
+
+void EvalExecutable::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    EvalExecutable* thisObject = static_cast<EvalExecutable*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
-    ASSERT(structure()->typeInfo().overridesVisitChildren());
-    ScriptExecutable::visitChildren(visitor);
-    if (m_evalCodeBlock)
-        m_evalCodeBlock->visitAggregate(visitor);
+    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
+    ScriptExecutable::visitChildren(thisObject, visitor);
+    if (thisObject->m_evalCodeBlock)
+        thisObject->m_evalCodeBlock->visitAggregate(visitor);
 }
 
 void EvalExecutable::unlinkCalls()
@@ -372,14 +378,20 @@ void ProgramExecutable::unlinkCalls()
 #endif
 }
 
-void ProgramExecutable::visitChildren(SlotVisitor& visitor)
+void ProgramExecutable::visitChildrenVirtual(SlotVisitor& visitor)
 {
-    ASSERT_GC_OBJECT_INHERITS(this, &s_info);
+    visitChildren(this, visitor);
+}
+
+void ProgramExecutable::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    ProgramExecutable* thisObject = static_cast<ProgramExecutable*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
-    ASSERT(structure()->typeInfo().overridesVisitChildren());
-    ScriptExecutable::visitChildren(visitor);
-    if (m_programCodeBlock)
-        m_programCodeBlock->visitAggregate(visitor);
+    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
+    ScriptExecutable::visitChildren(thisObject, visitor);
+    if (thisObject->m_programCodeBlock)
+        thisObject->m_programCodeBlock->visitAggregate(visitor);
 }
 
 void ProgramExecutable::clearCode()
@@ -584,18 +596,24 @@ void FunctionExecutable::jettisonOptimizedCodeForConstruct(JSGlobalData& globalD
 }
 #endif
 
-void FunctionExecutable::visitChildren(SlotVisitor& visitor)
+void FunctionExecutable::visitChildrenVirtual(SlotVisitor& visitor)
+{
+    visitChildren(this, visitor);
+}
+
+void FunctionExecutable::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    ASSERT_GC_OBJECT_INHERITS(this, &s_info);
+    FunctionExecutable* thisObject = static_cast<FunctionExecutable*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
-    ASSERT(structure()->typeInfo().overridesVisitChildren());
-    ScriptExecutable::visitChildren(visitor);
-    if (m_nameValue)
-        visitor.append(&m_nameValue);
-    if (m_codeBlockForCall)
-        m_codeBlockForCall->visitAggregate(visitor);
-    if (m_codeBlockForConstruct)
-        m_codeBlockForConstruct->visitAggregate(visitor);
+    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
+    ScriptExecutable::visitChildren(thisObject, visitor);
+    if (thisObject->m_nameValue)
+        visitor.append(&thisObject->m_nameValue);
+    if (thisObject->m_codeBlockForCall)
+        thisObject->m_codeBlockForCall->visitAggregate(visitor);
+    if (thisObject->m_codeBlockForConstruct)
+        thisObject->m_codeBlockForConstruct->visitAggregate(visitor);
 }
 
 void FunctionExecutable::discardCode()
index 03f7e02..15308bf 100644 (file)
@@ -356,7 +356,8 @@ namespace JSC {
         EvalExecutable(ExecState*, const SourceCode&, bool);
 
         JSObject* compileInternal(ExecState*, ScopeChainNode*, JITCode::JITType);
-        virtual void visitChildren(SlotVisitor&);
+        virtual void visitChildrenVirtual(SlotVisitor&);
+        static void visitChildren(JSCell*, SlotVisitor&);
         void unlinkCalls();
 
         OwnPtr<EvalCodeBlock> m_evalCodeBlock;
@@ -421,7 +422,8 @@ namespace JSC {
         ProgramExecutable(ExecState*, const SourceCode&);
 
         JSObject* compileInternal(ExecState*, ScopeChainNode*, JITCode::JITType);
-        virtual void visitChildren(SlotVisitor&);
+        virtual void visitChildrenVirtual(SlotVisitor&);
+        static void visitChildren(JSCell*, SlotVisitor&);
         void unlinkCalls();
 
         OwnPtr<ProgramCodeBlock> m_programCodeBlock;
@@ -580,7 +582,8 @@ namespace JSC {
         SharedSymbolTable* symbolTable() const { return m_symbolTable; }
 
         void discardCode();
-        void visitChildren(SlotVisitor&);
+        void visitChildrenVirtual(SlotVisitor&);
+        static void visitChildren(JSCell*, SlotVisitor&);
         static FunctionExecutable* fromGlobalCode(const Identifier&, ExecState*, Debugger*, const SourceCode&, JSObject** exception);
         static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue proto)
         {
index 9902b76..9179534 100644 (file)
@@ -30,16 +30,22 @@ namespace JSC {
 
 const ClassInfo GetterSetter::s_info = { "GetterSetter", 0, 0, 0 };
 
-void GetterSetter::visitChildren(SlotVisitor& visitor)
+void GetterSetter::visitChildrenVirtual(SlotVisitor& visitor)
 {
-    ASSERT_GC_OBJECT_INHERITS(this, &s_info);
-    ASSERT(structure()->typeInfo().overridesVisitChildren());
-    JSCell::visitChildren(visitor);
-
-    if (m_getter)
-        visitor.append(&m_getter);
-    if (m_setter)
-        visitor.append(&m_setter);
+    visitChildren(this, visitor);
+}
+
+void GetterSetter::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    GetterSetter* thisObject = static_cast<GetterSetter*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
+    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
+    JSCell::visitChildren(thisObject, visitor);
+
+    if (thisObject->m_getter)
+        visitor.append(&thisObject->m_getter);
+    if (thisObject->m_setter)
+        visitor.append(&thisObject->m_setter);
 }
 
 } // namespace JSC
index 19cdbdd..a312f73 100644 (file)
@@ -53,7 +53,8 @@ namespace JSC {
             return getterSetter;
         }
 
-        virtual void visitChildren(SlotVisitor&);
+        virtual void visitChildrenVirtual(SlotVisitor&);
+        static void visitChildren(JSCell*, SlotVisitor&);
 
         JSObject* getter() const { return m_getter.get(); }
         void setGetter(JSGlobalData& globalData, JSObject* getter) { m_getter.set(globalData, this, getter); }
index dbc967e..a61d371 100644 (file)
@@ -63,22 +63,28 @@ JSActivation::~JSActivation()
     static_cast<SharedSymbolTable*>(m_symbolTable)->deref();
 }
 
-void JSActivation::visitChildren(SlotVisitor& visitor)
+void JSActivation::visitChildrenVirtual(SlotVisitor& visitor)
 {
-    ASSERT_GC_OBJECT_INHERITS(this, &s_info);
+    visitChildren(this, visitor);
+}
+
+void JSActivation::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    JSActivation* thisObject = static_cast<JSActivation*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
-    ASSERT(structure()->typeInfo().overridesVisitChildren());
-    Base::visitChildren(visitor);
+    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
+    Base::visitChildren(thisObject, visitor);
 
     // No need to mark our registers if they're still in the RegisterFile.
-    WriteBarrier<Unknown>* registerArray = m_registerArray.get();
+    WriteBarrier<Unknown>* registerArray = thisObject->m_registerArray.get();
     if (!registerArray)
         return;
 
-    visitor.appendValues(registerArray, m_numParametersMinusThis);
+    visitor.appendValues(registerArray, thisObject->m_numParametersMinusThis);
 
     // Skip the call frame, which sits between the parameters and vars.
-    visitor.appendValues(registerArray + m_numParametersMinusThis + RegisterFile::CallFrameHeaderSize, m_numCapturedVars);
+    visitor.appendValues(registerArray + thisObject->m_numParametersMinusThis + RegisterFile::CallFrameHeaderSize, thisObject->m_numCapturedVars);
 }
 
 inline bool JSActivation::symbolTableGet(const Identifier& propertyName, PropertySlot& slot)
index d863593..9910976 100644 (file)
@@ -55,7 +55,8 @@ namespace JSC {
 
         virtual ~JSActivation();
 
-        virtual void visitChildren(SlotVisitor&);
+        virtual void visitChildrenVirtual(SlotVisitor&);
+        static void visitChildren(JSCell*, SlotVisitor&);
 
         virtual bool isDynamicScope(bool& requiresDynamicChecks) const;
 
index d7be946..45dbd89 100644 (file)
@@ -871,12 +871,18 @@ void JSArray::unshiftCount(ExecState* exec, int count)
         vector[i].clear();
 }
 
-void JSArray::visitChildren(SlotVisitor& visitor)
+void JSArray::visitChildrenVirtual(SlotVisitor& visitor)
 {
-    ASSERT_GC_OBJECT_INHERITS(this, &s_info);
+    visitChildren(this, visitor);
+}
+
+void JSArray::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    JSArray* thisObject = static_cast<JSArray*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
-    ASSERT(structure()->typeInfo().overridesVisitChildren());
-    visitChildrenDirect(visitor);
+    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
+    thisObject->visitChildrenDirect(visitor);
 }
 
 static int compareNumbersForQSort(const void* a, const void* b)
index 5662225..e8fe789 100644 (file)
@@ -172,7 +172,8 @@ namespace JSC {
         virtual bool deleteProperty(ExecState*, const Identifier& propertyName);
         virtual bool deleteProperty(ExecState*, unsigned propertyName);
         virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties);
-        virtual void visitChildren(SlotVisitor&);
+        virtual void visitChildrenVirtual(SlotVisitor&);
+        static void visitChildren(JSCell*, SlotVisitor&);
 
         void* subclassData() const;
         void setSubclassData(void*);
index ea9b0b3..bbc9bd9 100644 (file)
@@ -140,16 +140,22 @@ void JSBoundFunction::finishCreation(ExecState* exec, NativeExecutable* executab
     ASSERT(inherits(&s_info));
 }
 
-void JSBoundFunction::visitChildren(SlotVisitor& visitor)
+void JSBoundFunction::visitChildrenVirtual(SlotVisitor& visitor)
 {
-    ASSERT_GC_OBJECT_INHERITS(this, &s_info);
+    visitChildren(this, visitor);
+}
+
+void JSBoundFunction::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    JSBoundFunction* thisObject = static_cast<JSBoundFunction*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
-    ASSERT(structure()->typeInfo().overridesVisitChildren());
-    Base::visitChildren(visitor);
+    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
+    Base::visitChildren(thisObject, visitor);
 
-    visitor.append(&m_targetFunction);
-    visitor.append(&m_boundThis);
-    visitor.append(&m_boundArgs);
+    visitor.append(&thisObject->m_targetFunction);
+    visitor.append(&thisObject->m_boundThis);
+    visitor.append(&thisObject->m_boundArgs);
 }
 
 } // namespace JSC
index 028172c..5250e90 100644 (file)
@@ -57,7 +57,8 @@ public:
 protected:
     const static unsigned StructureFlags = OverridesHasInstance | Base::StructureFlags;
 
-    virtual void visitChildren(SlotVisitor&);
+    virtual void visitChildrenVirtual(SlotVisitor&);
+    static void visitChildren(JSCell*, SlotVisitor&);
 
 private:
     JSBoundFunction(ExecState*, JSGlobalObject*, Structure*, JSObject* targetFunction, JSValue boundThis, JSValue boundArgs);
index 6df5b98..9ee522f 100644 (file)
@@ -84,7 +84,8 @@ namespace JSC {
         virtual UString toString(ExecState*) const;
         virtual JSObject* toObject(ExecState*, JSGlobalObject*) const;
 
-        virtual void visitChildren(SlotVisitor&);
+        virtual void visitChildrenVirtual(SlotVisitor&);
+        static void visitChildren(JSCell*, SlotVisitor&);
 
         // Object operations, with the toObject operation included.
         const ClassInfo* classInfo() const;
@@ -176,9 +177,15 @@ namespace JSC {
         return m_structure.get();
     }
 
-    inline void JSCell::visitChildren(SlotVisitor& visitor)
+    inline void JSCell::visitChildrenVirtual(SlotVisitor& visitor)
     {
-        visitor.append(&m_structure);
+        visitChildren(this, visitor);
+    }
+
+    inline void JSCell::visitChildren(JSCell* cell, SlotVisitor& visitor)
+    {
+        JSCell* thisObject = static_cast<JSCell*>(cell);
+        visitor.append(&thisObject->m_structure);
     }
 
     // --- JSValue inlines ----------------------------
index 2e0bd02..37f66c1 100644 (file)
@@ -151,16 +151,22 @@ const UString JSFunction::calculatedDisplayName(ExecState* exec)
     return name(exec);
 }
 
-void JSFunction::visitChildren(SlotVisitor& visitor)
+void JSFunction::visitChildrenVirtual(SlotVisitor& visitor)
 {
-    ASSERT_GC_OBJECT_INHERITS(this, &s_info);
+    visitChildren(this, visitor);
+}
+
+void JSFunction::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    JSFunction* thisObject = static_cast<JSFunction*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
-    ASSERT(structure()->typeInfo().overridesVisitChildren());
-    Base::visitChildren(visitor);
+    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
+    Base::visitChildren(thisObject, visitor);
 
-    visitor.append(&m_scopeChain);
-    if (m_executable)
-        visitor.append(&m_executable);
+    visitor.append(&thisObject->m_scopeChain);
+    if (thisObject->m_executable)
+        visitor.append(&thisObject->m_executable);
 }
 
 CallType JSFunction::getCallData(CallData& callData)
index ef0dd77..a5d03dd 100644 (file)
@@ -134,7 +134,8 @@ namespace JSC {
         virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
         virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode = ExcludeDontEnumProperties);
 
-        virtual void visitChildren(SlotVisitor&);
+        virtual void visitChildrenVirtual(SlotVisitor&);
+        static void visitChildren(JSCell*, SlotVisitor&);
 
     private:
         explicit JSFunction(VPtrStealingHackType);
index 417f5a7..33d7bc9 100644 (file)
@@ -308,66 +308,72 @@ void JSGlobalObject::resetPrototype(JSGlobalData& globalData, JSValue prototype)
         oldLastInPrototypeChain->setPrototype(globalData, objectPrototype);
 }
 
-void JSGlobalObject::visitChildren(SlotVisitor& visitor)
+void JSGlobalObject::visitChildrenVirtual(SlotVisitor& visitor)
 {
-    ASSERT_GC_OBJECT_INHERITS(this, &s_info);
+    visitChildren(this, visitor);
+}
+
+void JSGlobalObject::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{ 
+    JSGlobalObject* thisObject = static_cast<JSGlobalObject*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
-    ASSERT(structure()->typeInfo().overridesVisitChildren());
-    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_nullPrototypeObjectStructure);
-    visitIfNeeded(visitor, &m_errorStructure);
-    visitIfNeeded(visitor, &m_functionStructure);
-    visitIfNeeded(visitor, &m_boundFunctionStructure);
-    visitIfNeeded(visitor, &m_namedFunctionStructure);
-    visitIfNeeded(visitor, &m_numberObjectStructure);
-    visitIfNeeded(visitor, &m_regExpMatchesArrayStructure);
-    visitIfNeeded(visitor, &m_regExpStructure);
-    visitIfNeeded(visitor, &m_stringObjectStructure);
-    visitIfNeeded(visitor, &m_internalFunctionStructure);
-
-    if (m_registerArray) {
+    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
+    JSVariableObject::visitChildren(thisObject, visitor);
+
+    visitIfNeeded(visitor, &thisObject->m_globalScopeChain);
+    visitIfNeeded(visitor, &thisObject->m_methodCallDummy);
+
+    visitIfNeeded(visitor, &thisObject->m_regExpConstructor);
+    visitIfNeeded(visitor, &thisObject->m_errorConstructor);
+    visitIfNeeded(visitor, &thisObject->m_evalErrorConstructor);
+    visitIfNeeded(visitor, &thisObject->m_rangeErrorConstructor);
+    visitIfNeeded(visitor, &thisObject->m_referenceErrorConstructor);
+    visitIfNeeded(visitor, &thisObject->m_syntaxErrorConstructor);
+    visitIfNeeded(visitor, &thisObject->m_typeErrorConstructor);
+    visitIfNeeded(visitor, &thisObject->m_URIErrorConstructor);
+
+    visitIfNeeded(visitor, &thisObject->m_evalFunction);
+    visitIfNeeded(visitor, &thisObject->m_callFunction);
+    visitIfNeeded(visitor, &thisObject->m_applyFunction);
+
+    visitIfNeeded(visitor, &thisObject->m_objectPrototype);
+    visitIfNeeded(visitor, &thisObject->m_functionPrototype);
+    visitIfNeeded(visitor, &thisObject->m_arrayPrototype);
+    visitIfNeeded(visitor, &thisObject->m_booleanPrototype);
+    visitIfNeeded(visitor, &thisObject->m_stringPrototype);
+    visitIfNeeded(visitor, &thisObject->m_numberPrototype);
+    visitIfNeeded(visitor, &thisObject->m_datePrototype);
+    visitIfNeeded(visitor, &thisObject->m_regExpPrototype);
+
+    visitIfNeeded(visitor, &thisObject->m_argumentsStructure);
+    visitIfNeeded(visitor, &thisObject->m_arrayStructure);
+    visitIfNeeded(visitor, &thisObject->m_booleanObjectStructure);
+    visitIfNeeded(visitor, &thisObject->m_callbackConstructorStructure);
+    visitIfNeeded(visitor, &thisObject->m_callbackFunctionStructure);
+    visitIfNeeded(visitor, &thisObject->m_callbackObjectStructure);
+    visitIfNeeded(visitor, &thisObject->m_dateStructure);
+    visitIfNeeded(visitor, &thisObject->m_emptyObjectStructure);
+    visitIfNeeded(visitor, &thisObject->m_nullPrototypeObjectStructure);
+    visitIfNeeded(visitor, &thisObject->m_errorStructure);
+    visitIfNeeded(visitor, &thisObject->m_functionStructure);
+    visitIfNeeded(visitor, &thisObject->m_boundFunctionStructure);
+    visitIfNeeded(visitor, &thisObject->m_namedFunctionStructure);
+    visitIfNeeded(visitor, &thisObject->m_numberObjectStructure);
+    visitIfNeeded(visitor, &thisObject->m_regExpMatchesArrayStructure);
+    visitIfNeeded(visitor, &thisObject->m_regExpStructure);
+    visitIfNeeded(visitor, &thisObject->m_stringObjectStructure);
+    visitIfNeeded(visitor, &thisObject->m_internalFunctionStructure);
+
+    if (thisObject->m_registerArray) {
         // Outside the execution of global code, when our variables are torn off,
         // we can mark the torn-off array.
-        visitor.appendValues(m_registerArray.get(), m_registerArraySize);
-    } else if (m_registers) {
+        visitor.appendValues(thisObject->m_registerArray.get(), thisObject->m_registerArraySize);
+    } else if (thisObject->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.
-        visitor.appendValues(m_registers - symbolTable().size(), symbolTable().size());
+        visitor.appendValues(thisObject->m_registers - thisObject->symbolTable().size(), thisObject->symbolTable().size());
     }
 }
 
index cef3efe..3f0b85d 100644 (file)
@@ -175,7 +175,8 @@ namespace JSC {
     public:
         virtual ~JSGlobalObject();
 
-        virtual void visitChildren(SlotVisitor&);
+        virtual void visitChildrenVirtual(SlotVisitor&);
+        static void visitChildren(JSCell*, SlotVisitor&);
 
         virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
         virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
index 523721c..9c801b6 100644 (file)
@@ -68,15 +68,21 @@ static inline void getClassPropertyNames(ExecState* exec, const ClassInfo* class
     }
 }
 
-void JSObject::visitChildren(SlotVisitor& visitor)
+void JSObject::visitChildrenVirtual(SlotVisitor& visitor)
 {
-    ASSERT_GC_OBJECT_INHERITS(this, &s_info);
+    visitChildren(this, visitor);
+}
+
+void JSObject::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    JSObject* thisObject = static_cast<JSObject*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
 #ifndef NDEBUG
     bool wasCheckingForDefaultMarkViolation = visitor.m_isCheckingForDefaultMarkViolation;
     visitor.m_isCheckingForDefaultMarkViolation = false;
 #endif
 
-    visitChildrenDirect(visitor);
+    thisObject->visitChildrenDirect(visitor);
 
 #ifndef NDEBUG
     visitor.m_isCheckingForDefaultMarkViolation = wasCheckingForDefaultMarkViolation;
index 052b19e..ecbdc68 100644 (file)
@@ -79,8 +79,9 @@ namespace JSC {
     public:
         typedef JSCell Base;
 
-        virtual void visitChildren(SlotVisitor&);
+        virtual void visitChildrenVirtual(SlotVisitor&);
         ALWAYS_INLINE void visitChildrenDirect(SlotVisitor&);
+        static void visitChildren(JSCell*, 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
@@ -816,7 +817,7 @@ inline void JSValue::put(ExecState* exec, unsigned propertyName, JSValue value)
 
 ALWAYS_INLINE void JSObject::visitChildrenDirect(SlotVisitor& visitor)
 {
-    JSCell::visitChildren(visitor);
+    JSCell::visitChildren(this, visitor);
 
     PropertyStorage storage = propertyStorage();
     size_t storageSize = structure()->propertyStorageSize();
index 4c7a6ee..ea42d78 100644 (file)
@@ -92,13 +92,19 @@ JSValue JSPropertyNameIterator::get(ExecState* exec, JSObject* base, size_t i)
     return identifier;
 }
 
-void JSPropertyNameIterator::visitChildren(SlotVisitor& visitor)
+void JSPropertyNameIterator::visitChildrenVirtual(SlotVisitor& visitor)
 {
-    ASSERT_GC_OBJECT_INHERITS(this, &s_info);
-    ASSERT(structure()->typeInfo().overridesVisitChildren());
-    visitor.appendValues(m_jsStrings.get(), m_jsStringsSize);
-    if (m_cachedPrototypeChain)
-        visitor.append(&m_cachedPrototypeChain);
+    visitChildren(this, visitor);
+}
+
+void JSPropertyNameIterator::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    JSPropertyNameIterator* thisObject = static_cast<JSPropertyNameIterator*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
+    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
+    visitor.appendValues(thisObject->m_jsStrings.get(), thisObject->m_jsStringsSize);
+    if (thisObject->m_cachedPrototypeChain)
+        visitor.append(&thisObject->m_cachedPrototypeChain);
 }
 
 } // namespace JSC
index a719de1..c6f6979 100644 (file)
@@ -58,7 +58,8 @@ namespace JSC {
             return Structure::create(globalData, globalObject, prototype, TypeInfo(CompoundType, OverridesVisitChildren), &s_info);
         }
 
-        virtual void visitChildren(SlotVisitor&);
+        virtual void visitChildrenVirtual(SlotVisitor&);
+        static void visitChildren(JSCell*, SlotVisitor&);
 
         bool getOffset(size_t i, int& offset)
         {
index 5206510..31da80a 100644 (file)
 namespace JSC {
 ASSERT_CLASS_FITS_IN_CELL(JSStaticScopeObject);
 
-void JSStaticScopeObject::visitChildren(SlotVisitor& visitor)
+void JSStaticScopeObject::visitChildrenVirtual(SlotVisitor& visitor)
 {
-    ASSERT_GC_OBJECT_INHERITS(this, &s_info);
+    visitChildren(this, visitor);
+}
+
+void JSStaticScopeObject::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    JSStaticScopeObject* thisObject = static_cast<JSStaticScopeObject*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
-    ASSERT(structure()->typeInfo().overridesVisitChildren());
-    JSVariableObject::visitChildren(visitor);
-    visitor.append(&m_registerStore);
+    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
+    JSVariableObject::visitChildren(thisObject, visitor);
+    visitor.append(&thisObject->m_registerStore);
 }
 
 JSObject* JSStaticScopeObject::toThisObject(ExecState* exec) const
index 1f8d8b8..821178a 100644 (file)
@@ -41,7 +41,8 @@ namespace JSC{
             return scopeObject;
         }
 
-        virtual void visitChildren(SlotVisitor&);
+        virtual void visitChildrenVirtual(SlotVisitor&);
+        static void visitChildren(JSCell*, SlotVisitor&);
         bool isDynamicScope(bool& requiresDynamicChecks) const;
         virtual JSObject* toThisObject(ExecState*) const;
         virtual JSValue toStrictThisObject(ExecState*) const;
index 8d6387e..69192fe 100644 (file)
@@ -26,14 +26,20 @@ namespace JSC {
 
 ASSERT_CLASS_FITS_IN_CELL(JSWrapperObject);
 
-void JSWrapperObject::visitChildren(SlotVisitor& visitor) 
+void JSWrapperObject::visitChildrenVirtual(SlotVisitor& visitor) 
 {
-    ASSERT_GC_OBJECT_INHERITS(this, &s_info);
+    visitChildren(this, visitor);
+}
+
+void JSWrapperObject::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    JSWrapperObject* thisObject = static_cast<JSWrapperObject*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
-    ASSERT(structure()->typeInfo().overridesVisitChildren());
-    JSObject::visitChildren(visitor);
-    if (m_internalValue)
-        visitor.append(&m_internalValue);
+    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
+    JSObject::visitChildren(thisObject, visitor);
+    if (thisObject->m_internalValue)
+        visitor.append(&thisObject->m_internalValue);
 }
 
 } // namespace JSC
index cf44e04..9596aa4 100644 (file)
@@ -45,7 +45,8 @@ namespace JSC {
         static const unsigned StructureFlags = OverridesVisitChildren | JSNonFinalObject::StructureFlags;
 
     private:
-        virtual void visitChildren(SlotVisitor&);
+        virtual void visitChildrenVirtual(SlotVisitor&);
+        static void visitChildren(JSCell*, SlotVisitor&);
         
         WriteBarrier<Unknown> m_internalValue;
     };
index a103c37..e581da9 100644 (file)
@@ -37,14 +37,20 @@ NativeErrorConstructor::NativeErrorConstructor(JSGlobalObject* globalObject, Str
 {
 }
 
-void NativeErrorConstructor::visitChildren(SlotVisitor& visitor)
+void NativeErrorConstructor::visitChildrenVirtual(SlotVisitor& visitor)
 {
-    ASSERT_GC_OBJECT_INHERITS(this, &s_info);
+    visitChildren(this, visitor);
+}
+
+void NativeErrorConstructor::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    NativeErrorConstructor* thisObject = static_cast<NativeErrorConstructor*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
-    ASSERT(structure()->typeInfo().overridesVisitChildren());
-    InternalFunction::visitChildren(visitor);
-    if (m_errorStructure)
-        visitor.append(&m_errorStructure);
+    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
+    InternalFunction::visitChildren(thisObject, visitor);
+    if (thisObject->m_errorStructure)
+        visitor.append(&thisObject->m_errorStructure);
 }
 
 static EncodedJSValue JSC_HOST_CALL constructWithNativeErrorConstructor(ExecState* exec)
index cc4635b..8c272ea 100644 (file)
@@ -70,7 +70,8 @@ namespace JSC {
         static const unsigned StructureFlags = OverridesVisitChildren | InternalFunction::StructureFlags;
         virtual ConstructType getConstructData(ConstructData&);
         virtual CallType getCallData(CallData&);
-        virtual void visitChildren(SlotVisitor&);
+        virtual void visitChildrenVirtual(SlotVisitor&);
+        static void visitChildren(JSCell*, SlotVisitor&);
 
         WriteBarrier<Structure> m_errorStructure;
     };
index bae9086..123dd6e 100644 (file)
@@ -78,16 +78,22 @@ RegExpObject::~RegExpObject()
 {
 }
 
-void RegExpObject::visitChildren(SlotVisitor& visitor)
+void RegExpObject::visitChildrenVirtual(SlotVisitor& visitor)
 {
-    ASSERT_GC_OBJECT_INHERITS(this, &s_info);
+    visitChildren(this, visitor);
+}
+
+void RegExpObject::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    RegExpObject* thisObject = static_cast<RegExpObject*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
-    ASSERT(structure()->typeInfo().overridesVisitChildren());
-    Base::visitChildren(visitor);
-    if (d->regExp)
-        visitor.append(&d->regExp);
-    if (UNLIKELY(!d->lastIndex.get().isInt32()))
-        visitor.append(&d->lastIndex);
+    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
+    Base::visitChildren(thisObject, visitor);
+    if (thisObject->d->regExp)
+        visitor.append(&thisObject->d->regExp);
+    if (UNLIKELY(!thisObject->d->lastIndex.get().isInt32()))
+        visitor.append(&thisObject->d->lastIndex);
 }
 
 bool RegExpObject::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
index c9fb00b..11e0195 100644 (file)
@@ -82,7 +82,8 @@ namespace JSC {
         static const unsigned StructureFlags = OverridesVisitChildren | OverridesGetOwnPropertySlot | Base::StructureFlags;
 
     private:
-        virtual void visitChildren(SlotVisitor&);
+        virtual void visitChildrenVirtual(SlotVisitor&);
+        static void visitChildren(JSCell*, SlotVisitor&);
 
         bool match(ExecState*);
 
index df4da41..13b79d9 100644 (file)
@@ -67,16 +67,22 @@ int ScopeChainNode::localDepth()
     return scopeDepth;
 }
 
-void ScopeChainNode::visitChildren(SlotVisitor& visitor)
+void ScopeChainNode::visitChildrenVirtual(SlotVisitor& visitor)
 {
-    ASSERT_GC_OBJECT_INHERITS(this, &s_info);
+    visitChildren(this, visitor);
+}
+
+void ScopeChainNode::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    ScopeChainNode* thisObject = static_cast<ScopeChainNode*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
-    ASSERT(structure()->typeInfo().overridesVisitChildren());
-    if (next)
-        visitor.append(&next);
-    visitor.append(&object);
-    visitor.append(&globalObject);
-    visitor.append(&globalThis);
+    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
+    if (thisObject->next)
+        visitor.append(&thisObject->next);
+    visitor.append(&thisObject->object);
+    visitor.append(&thisObject->globalObject);
+    visitor.append(&thisObject->globalThis);
 }
 
 } // namespace JSC
index dd5004b..ac52c67 100644 (file)
@@ -87,7 +87,8 @@ namespace JSC {
 #endif
         
         static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue proto) { return Structure::create(globalData, globalObject, proto, TypeInfo(CompoundType, StructureFlags), &s_info); }
-        virtual void visitChildren(SlotVisitor&);
+        virtual void visitChildrenVirtual(SlotVisitor&);
+        static void visitChildren(JSCell*, SlotVisitor&);
         static JS_EXPORTDATA const ClassInfo s_info;
 
     private:
index 313a851..4edde9f 100644 (file)
@@ -724,26 +724,32 @@ void Structure::getPropertyNames(JSGlobalData& globalData, PropertyNameArray& pr
     }
 }
 
-void Structure::visitChildren(SlotVisitor& visitor)
-{
-    ASSERT_GC_OBJECT_INHERITS(this, &s_info);
-    ASSERT(structure()->typeInfo().overridesVisitChildren());
-    JSCell::visitChildren(visitor);
-    if (m_globalObject)
-        visitor.append(&m_globalObject);
-    if (m_prototype)
-        visitor.append(&m_prototype);
-    if (m_cachedPrototypeChain)
-        visitor.append(&m_cachedPrototypeChain);
-    if (m_previous)
-        visitor.append(&m_previous);
-    if (m_specificValueInPrevious)
-        visitor.append(&m_specificValueInPrevious);
-    if (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) {
+void Structure::visitChildrenVirtual(SlotVisitor& visitor)
+{
+    visitChildren(this, visitor);
+}
+
+void Structure::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    Structure* thisObject = static_cast<Structure*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
+    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
+    JSCell::visitChildren(thisObject, visitor);
+    if (thisObject->m_globalObject)
+        visitor.append(&thisObject->m_globalObject);
+    if (thisObject->m_prototype)
+        visitor.append(&thisObject->m_prototype);
+    if (thisObject->m_cachedPrototypeChain)
+        visitor.append(&thisObject->m_cachedPrototypeChain);
+    if (thisObject->m_previous)
+        visitor.append(&thisObject->m_previous);
+    if (thisObject->m_specificValueInPrevious)
+        visitor.append(&thisObject->m_specificValueInPrevious);
+    if (thisObject->m_enumerationCache)
+        visitor.append(&thisObject->m_enumerationCache);
+    if (thisObject->m_propertyTable) {
+        PropertyTable::iterator end = thisObject->m_propertyTable->end();
+        for (PropertyTable::iterator ptr = thisObject->m_propertyTable->begin(); ptr != end; ++ptr) {
             if (ptr->specificValue)
                 visitor.append(&ptr->specificValue);
         }
index d60737e..958ad1b 100644 (file)
@@ -130,7 +130,8 @@ namespace JSC {
         JSValue storedPrototype() const { return m_prototype.get(); }
         JSValue prototypeForLookup(ExecState*) const;
         StructureChain* prototypeChain(ExecState*) const;
-        void visitChildren(SlotVisitor&);
+        void visitChildrenVirtual(SlotVisitor&);
+        static void visitChildren(JSCell*, SlotVisitor&);
 
         Structure* previousID() const { ASSERT(structure()->classInfo() == &s_info); return m_previous.get(); }
         bool transitivelyTransitionedFrom(Structure* structureToFind);
index 3e0f028..0fb28de 100644 (file)
@@ -43,13 +43,19 @@ StructureChain::~StructureChain()
 {
 }
 
-void StructureChain::visitChildren(SlotVisitor& visitor)
+void StructureChain::visitChildrenVirtual(SlotVisitor& visitor)
 {
-    ASSERT_GC_OBJECT_INHERITS(this, &s_info);
-    ASSERT(structure()->typeInfo().overridesVisitChildren());
+    visitChildren(this, visitor);
+}
+
+void StructureChain::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    StructureChain* thisObject = static_cast<StructureChain*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
+    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
     size_t i = 0;
-    while (m_vector[i])
-        visitor.append(&m_vector[i++]);
+    while (thisObject->m_vector[i])
+        visitor.append(&thisObject->m_vector[i++]);
 }
 
 } // namespace JSC
index cdd64ef..190c5c2 100644 (file)
@@ -52,7 +52,8 @@ namespace JSC {
             return chain;
         }
         WriteBarrier<Structure>* head() { return m_vector.get(); }
-        void visitChildren(SlotVisitor&);
+        void visitChildrenVirtual(SlotVisitor&);
+        static void visitChildren(JSCell*, SlotVisitor&);
 
         static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype) { return Structure::create(globalData, globalObject, prototype, TypeInfo(CompoundType, OverridesVisitChildren), &s_info); }
         
index a72c5ce..b62a798 100644 (file)
@@ -1,3 +1,24 @@
+2011-09-23  Mark Hahnenberg  <mhahnenberg@apple.com>
+
+        Add static version of JSCell::visitChildren
+        https://bugs.webkit.org/show_bug.cgi?id=68404
+
+        Reviewed by Darin Adler.
+
+        In this patch we just extract the bodies of the virtual visitChildren methods
+        throughout the JSCell inheritance hierarchy out into static methods, which are 
+        now called from the virtual methods.  This is an intermediate step in trying to 
+        move the virtual-ness of visitChildren into our own custom vtable stored in 
+        ClassInfo.  We need to convert the methods to static methods in order to be 
+        able to more easily store and refer to them in our custom vtable since normal 
+        member methods store some implicit information in their types, making it 
+        impossible to store them generically in ClassInfo.
+
+        * UserObjectImp.cpp:
+        (UserObjectImp::visitChildrenVirtual):
+        (UserObjectImp::visitChildren):
+        * UserObjectImp.h:
+
 2011-09-14  Mark Hahnenberg  <mhahnenberg@apple.com>
 
         Unzip initialization lists and constructors in JSCell hierarchy (6/7)
index ad3693b..6c3a7d4 100644 (file)
@@ -404,9 +404,15 @@ UString UserObjectImp::toString(ExecState *exec) const
     return result;
 }
 
-void UserObjectImp::visitChildren(SlotVisitor& visitor)
+void UserObjectImp::visitChildrenVirtual(SlotVisitor& visitor)
 {
-    JSObject::visitChildren(visitor);
-    if (fJSUserObject)
-        fJSUserObject->Mark();
+    visitChildren(this, visitor);
+}
+
+void UserObjectImp::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    UserObjectImp* thisObject = static_cast<UserObjectImp*>(cell);
+    JSObject::visitChildren(thisObject, visitor);
+    if (thisObject->fJSUserObject)
+        thisObject->fJSUserObject->Mark();
 }
index 43ff0da..a86b52c 100644 (file)
@@ -62,7 +62,8 @@ public:
     virtual double toNumber(ExecState *exec) const;
     virtual UString toString(ExecState *exec) const;
 
-    virtual void visitChildren(SlotVisitor&);
+    virtual void visitChildrenVirtual(SlotVisitor&);
+    static void visitChildren(JSCell*, SlotVisitor&);
 
     JSUserObject *GetJSUserObject() const;
 
index 9077140..0dcc028 100644 (file)
@@ -1,3 +1,109 @@
+2011-09-23  Mark Hahnenberg  <mhahnenberg@apple.com>
+
+        Add static version of JSCell::visitChildren
+        https://bugs.webkit.org/show_bug.cgi?id=68404
+
+        Reviewed by Darin Adler.
+
+        No new tests.
+
+        In this patch we just extract the bodies of the virtual visitChildren methods
+        throughout the JSCell inheritance hierarchy out into static methods, which are 
+        now called from the virtual methods.  This is an intermediate step in trying to 
+        move the virtual-ness of visitChildren into our own custom vtable stored in 
+        ClassInfo.  We need to convert the methods to static methods in order to be 
+        able to more easily store and refer to them in our custom vtable since normal 
+        member methods store some implicit information in their types, making it 
+        impossible to store them generically in ClassInfo.
+
+        * WebCore.exp.in:
+        * bindings/js/JSAttrCustom.cpp:
+        (WebCore::JSAttr::visitChildrenVirtual):
+        (WebCore::JSAttr::visitChildren):
+        * bindings/js/JSAudioContextCustom.cpp:
+        (WebCore::JSAudioContext::visitChildrenVirtual):
+        (WebCore::JSAudioContext::visitChildren):
+        * bindings/js/JSCSSRuleCustom.cpp:
+        (WebCore::JSCSSRule::visitChildrenVirtual):
+        (WebCore::JSCSSRule::visitChildren):
+        * bindings/js/JSCSSStyleDeclarationCustom.cpp:
+        (WebCore::JSCSSStyleDeclaration::visitChildrenVirtual):
+        (WebCore::JSCSSStyleDeclaration::visitChildren):
+        * bindings/js/JSCanvasRenderingContextCustom.cpp:
+        (WebCore::JSCanvasRenderingContext::visitChildrenVirtual):
+        (WebCore::JSCanvasRenderingContext::visitChildren):
+        * bindings/js/JSDOMGlobalObject.cpp:
+        (WebCore::JSDOMGlobalObject::visitChildrenVirtual):
+        (WebCore::JSDOMGlobalObject::visitChildren):
+        * bindings/js/JSDOMGlobalObject.h:
+        * bindings/js/JSDOMWindowCustom.cpp:
+        (WebCore::JSDOMWindow::visitChildrenVirtual):
+        (WebCore::JSDOMWindow::visitChildren):
+        * bindings/js/JSDOMWindowShell.cpp:
+        (WebCore::JSDOMWindowShell::visitChildrenVirtual):
+        (WebCore::JSDOMWindowShell::visitChildren):
+        * bindings/js/JSDOMWindowShell.h:
+        * bindings/js/JSJavaScriptAudioNodeCustom.cpp:
+        (WebCore::JSJavaScriptAudioNode::visitChildrenVirtual):
+        (WebCore::JSJavaScriptAudioNode::visitChildren):
+        * bindings/js/JSMessageChannelCustom.cpp:
+        (WebCore::JSMessageChannel::visitChildrenVirtual):
+        (WebCore::JSMessageChannel::visitChildren):
+        * bindings/js/JSMessagePortCustom.cpp:
+        (WebCore::JSMessagePort::visitChildrenVirtual):
+        (WebCore::JSMessagePort::visitChildren):
+        * bindings/js/JSNamedNodeMapCustom.cpp:
+        (WebCore::JSNamedNodeMap::visitChildrenVirtual):
+        (WebCore::JSNamedNodeMap::visitChildren):
+        * bindings/js/JSNodeCustom.cpp:
+        (WebCore::JSNode::visitChildrenVirtual):
+        (WebCore::JSNode::visitChildren):
+        * bindings/js/JSNodeFilterCustom.cpp:
+        (WebCore::JSNodeFilter::visitChildrenVirtual):
+        (WebCore::JSNodeFilter::visitChildren):
+        * bindings/js/JSNodeIteratorCustom.cpp:
+        (WebCore::JSNodeIterator::visitChildrenVirtual):
+        (WebCore::JSNodeIterator::visitChildren):
+        * bindings/js/JSSVGElementInstanceCustom.cpp:
+        (WebCore::JSSVGElementInstance::visitChildrenVirtual):
+        (WebCore::JSSVGElementInstance::visitChildren):
+        * bindings/js/JSSharedWorkerCustom.cpp:
+        (WebCore::JSSharedWorker::visitChildrenVirtual):
+        (WebCore::JSSharedWorker::visitChildren):
+        * bindings/js/JSStyleSheetCustom.cpp:
+        (WebCore::JSStyleSheet::visitChildrenVirtual):
+        (WebCore::JSStyleSheet::visitChildren):
+        * bindings/js/JSTreeWalkerCustom.cpp:
+        (WebCore::JSTreeWalker::visitChildrenVirtual):
+        (WebCore::JSTreeWalker::visitChildren):
+        * bindings/js/JSWebGLRenderingContextCustom.cpp:
+        (WebCore::JSWebGLRenderingContext::visitChildrenVirtual):
+        (WebCore::JSWebGLRenderingContext::visitChildren):
+        * bindings/js/JSWorkerContextCustom.cpp:
+        (WebCore::JSWorkerContext::visitChildrenVirtual):
+        (WebCore::JSWorkerContext::visitChildren):
+        * bindings/js/JSXMLHttpRequestCustom.cpp:
+        (WebCore::JSXMLHttpRequest::visitChildrenVirtual):
+        (WebCore::JSXMLHttpRequest::visitChildren):
+        * bindings/js/JSXPathResultCustom.cpp:
+        (WebCore::JSXPathResult::visitChildrenVirtual):
+        (WebCore::JSXPathResult::visitChildren):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateHeader):
+        (GenerateImplementation):
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        (WebCore::JSTestObj::visitChildrenVirtual):
+        (WebCore::JSTestObj::visitChildren):
+        * bindings/scripts/test/JS/JSTestObj.h:
+        * bridge/qt/qt_instance.cpp:
+        (JSC::Bindings::QtRuntimeObject::visitChildrenVirtual):
+        (JSC::Bindings::QtRuntimeObject::visitChildren):
+        * bridge/qt/qt_runtime.cpp:
+        (JSC::Bindings::QtRuntimeMetaMethod::visitChildrenVirtual):
+        (JSC::Bindings::QtRuntimeMetaMethod::visitChildren):
+        * bridge/qt/qt_runtime.h:
+        * workers/WorkerContext.h:
+
 2011-09-23  Mario Sanchez Prada  <msanchez@igalia.com>
 
         [GTK] Remove extra space at the beginning of the last line.
index 3f3d1e0..12c0b81 100644 (file)
@@ -815,7 +815,7 @@ __ZN7WebCore6Editor6indentEv
 __ZN7WebCore6Editor7CommandC1Ev
 __ZN7WebCore6Editor7commandERKN3WTF6StringE
 __ZN7WebCore6Editor7outdentEv
-__ZN7WebCore6JSNode13visitChildrenERN3JSC11SlotVisitorE
+__ZN7WebCore6JSNode20visitChildrenVirtualERN3JSC11SlotVisitorE
 __ZN7WebCore6JSNode3putEPN3JSC9ExecStateERKNS1_10IdentifierENS1_7JSValueERNS1_15PutPropertySlotE
 __ZN7WebCore6JSNode6s_infoE
 __ZN7WebCore6Region5uniteERKS0_
index 449a5ce..3b1086d 100644 (file)
@@ -39,14 +39,20 @@ namespace WebCore {
 
 using namespace HTMLNames;
 
-void JSAttr::visitChildren(SlotVisitor& visitor)
+void JSAttr::visitChildrenVirtual(SlotVisitor& visitor)
 {
-    ASSERT_GC_OBJECT_INHERITS(this, &s_info);
+    visitChildren(this, visitor);
+}
+
+void JSAttr::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    JSAttr* thisObject = static_cast<JSAttr*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
-    ASSERT(structure()->typeInfo().overridesVisitChildren());
-    Base::visitChildren(visitor);
+    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
+    Base::visitChildren(thisObject, visitor);
 
-    Element* element = impl()->ownerElement();
+    Element* element = thisObject->impl()->ownerElement();
     if (!element)
         return;
     visitor.addOpaqueRoot(root(element));
index c8e1ece..4e6a46d 100644 (file)
@@ -39,13 +39,19 @@ using namespace JSC;
 
 namespace WebCore {
 
-void JSAudioContext::visitChildren(SlotVisitor& visitor)
+void JSAudioContext::visitChildrenVirtual(SlotVisitor& visitor)
 {
-    ASSERT_GC_OBJECT_INHERITS(this, &s_info);
+    visitChildren(this, visitor);
+}
+
+void JSAudioContext::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    JSAudioContext* thisObject = static_cast<JSAudioContext*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
-    ASSERT(structure()->typeInfo().overridesVisitChildren());
-    Base::visitChildren(visitor);
-    m_impl->visitJSEventListeners(visitor);
+    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
+    Base::visitChildren(thisObject, visitor);
+    thisObject->m_impl->visitJSEventListeners(visitor);
 }
 
 EncodedJSValue JSC_HOST_CALL JSAudioContextConstructor::constructJSAudioContext(ExecState* exec)
index 155ba6e..71b06ce 100644 (file)
@@ -48,13 +48,19 @@ using namespace JSC;
 
 namespace WebCore {
 
-void JSCSSRule::visitChildren(SlotVisitor& visitor)
+void JSCSSRule::visitChildrenVirtual(SlotVisitor& visitor)
 {
-    ASSERT_GC_OBJECT_INHERITS(this, &s_info);
+    visitChildren(this, visitor);
+}
+
+void JSCSSRule::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    JSCSSRule* thisObject = static_cast<JSCSSRule*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
-    ASSERT(structure()->typeInfo().overridesVisitChildren());
-    Base::visitChildren(visitor);
-    visitor.addOpaqueRoot(root(impl()));
+    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
+    Base::visitChildren(thisObject, visitor);
+    visitor.addOpaqueRoot(root(thisObject->impl()));
 }
 
 JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, CSSRule* rule)
index 465e783..cd9acee 100644 (file)
@@ -43,13 +43,19 @@ using namespace WTF;
 
 namespace WebCore {
 
-void JSCSSStyleDeclaration::visitChildren(SlotVisitor& visitor)
+void JSCSSStyleDeclaration::visitChildrenVirtual(SlotVisitor& visitor)
 {
-    ASSERT_GC_OBJECT_INHERITS(this, &s_info);
+    visitChildren(this, visitor);
+}
+
+void JSCSSStyleDeclaration::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    JSCSSStyleDeclaration* thisObject = static_cast<JSCSSStyleDeclaration*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
-    ASSERT(structure()->typeInfo().overridesVisitChildren());
-    Base::visitChildren(visitor);
-    visitor.addOpaqueRoot(root(impl()));
+    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
+    Base::visitChildren(thisObject, visitor);
+    visitor.addOpaqueRoot(root(thisObject->impl()));
 }
 
 // Check for a CSS prefix.
index ad646a0..da6028c 100644 (file)
@@ -39,14 +39,20 @@ using namespace JSC;
 
 namespace WebCore {
 
-void JSCanvasRenderingContext::visitChildren(SlotVisitor& visitor)
+void JSCanvasRenderingContext::visitChildrenVirtual(SlotVisitor& visitor)
 {
-    ASSERT_GC_OBJECT_INHERITS(this, &s_info);
+    visitChildren(this, visitor);
+}
+
+void JSCanvasRenderingContext::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    JSCanvasRenderingContext* thisObject = static_cast<JSCanvasRenderingContext*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
-    ASSERT(structure()->typeInfo().overridesVisitChildren());
-    Base::visitChildren(visitor);
+    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
+    Base::visitChildren(thisObject, visitor);
 
-    visitor.addOpaqueRoot(root(impl()->canvas()));
+    visitor.addOpaqueRoot(root(thisObject->impl()->canvas()));
 }
 
 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, CanvasRenderingContext* object)
index 71d98c9..52867d3 100644 (file)
@@ -55,23 +55,29 @@ void JSDOMGlobalObject::finishCreation(JSGlobalData& globalData, JSObject* thisV
     ASSERT(inherits(&s_info));
 }
 
-void JSDOMGlobalObject::visitChildren(SlotVisitor& visitor)
+void JSDOMGlobalObject::visitChildrenVirtual(JSC::SlotVisitor& visitor)
 {
-    ASSERT_GC_OBJECT_INHERITS(this, &s_info);
+    visitChildren(this, visitor);
+}
+
+void JSDOMGlobalObject::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    JSDOMGlobalObject* thisObject = static_cast<JSDOMGlobalObject*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
-    ASSERT(structure()->typeInfo().overridesVisitChildren());
-    Base::visitChildren(visitor);
+    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
+    Base::visitChildren(thisObject, visitor);
 
-    JSDOMStructureMap::iterator end = structures().end();
-    for (JSDOMStructureMap::iterator it = structures().begin(); it != end; ++it)
+    JSDOMStructureMap::iterator end = thisObject->structures().end();
+    for (JSDOMStructureMap::iterator it = thisObject->structures().begin(); it != end; ++it)
         visitor.append(&it->second);
 
-    JSDOMConstructorMap::iterator end2 = constructors().end();
-    for (JSDOMConstructorMap::iterator it2 = constructors().begin(); it2 != end2; ++it2)
+    JSDOMConstructorMap::iterator end2 = thisObject->constructors().end();
+    for (JSDOMConstructorMap::iterator it2 = thisObject->constructors().begin(); it2 != end2; ++it2)
         visitor.append(&it2->second);
 
-    if (m_injectedScript)
-        visitor.append(&m_injectedScript);
+    if (thisObject->m_injectedScript)
+        visitor.append(&thisObject->m_injectedScript);
 }
 
 void JSDOMGlobalObject::setCurrentEvent(Event* currentEvent)
index 9002830..99a631f 100644 (file)
@@ -64,7 +64,8 @@ namespace WebCore {
         void setInjectedScript(JSObject*);
         JSObject* injectedScript() const;
 
-        virtual void visitChildren(JSC::SlotVisitor&);
+        virtual void visitChildrenVirtual(JSC::SlotVisitor&);
+        static void visitChildren(JSC::JSCell*, JSC::SlotVisitor&);
 
         DOMWrapperWorld* world() { return m_world.get(); }
 
index bf44bdb..adb051f 100644 (file)
@@ -77,15 +77,21 @@ using namespace JSC;
 
 namespace WebCore {
 
-void JSDOMWindow::visitChildren(SlotVisitor& visitor)
+void JSDOMWindow::visitChildrenVirtual(SlotVisitor& visitor)
 {
-    ASSERT_GC_OBJECT_INHERITS(this, &s_info);
+    visitChildren(this, visitor);
+}
+
+void JSDOMWindow::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    JSDOMWindow* thisObject = static_cast<JSDOMWindow*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
-    ASSERT(structure()->typeInfo().overridesVisitChildren());
-    Base::visitChildren(visitor);
+    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
+    Base::visitChildren(thisObject, visitor);
 
-    impl()->visitJSEventListeners(visitor);
-    if (Frame* frame = impl()->frame())
+    thisObject->impl()->visitJSEventListeners(visitor);
+    if (Frame* frame = thisObject->impl()->frame())
         visitor.addOpaqueRoot(frame);
 }
 
index 1588d4f..e106688 100644 (file)
@@ -83,14 +83,20 @@ void JSDOMWindowShell::setWindow(PassRefPtr<DOMWindow> domWindow)
 // JSObject methods
 // ----
 
-void JSDOMWindowShell::visitChildren(SlotVisitor& visitor)
+void JSDOMWindowShell::visitChildrenVirtual(JSC::SlotVisitor& visitor)
 {
-    ASSERT_GC_OBJECT_INHERITS(this, &s_info);
+    visitChildren(this, visitor);
+}
+
+void JSDOMWindowShell::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    JSDOMWindowShell* thisObject = static_cast<JSDOMWindowShell*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
-    ASSERT(structure()->typeInfo().overridesVisitChildren());
-    Base::visitChildren(visitor);
-    if (m_window)
-        visitor.append(&m_window);
+    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
+    Base::visitChildren(thisObject, visitor);
+    if (thisObject->m_window)
+        visitor.append(&thisObject->m_window);
 }
 
 UString JSDOMWindowShell::className() const
index fe8a4fd..e9abc15 100644 (file)
@@ -77,7 +77,8 @@ namespace WebCore {
         void* operator new(size_t);
         static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::OverridesVisitChildren | JSC::OverridesGetPropertyNames | Base::StructureFlags;
 
-        virtual void visitChildren(JSC::SlotVisitor&);
+        virtual void visitChildrenVirtual(JSC::SlotVisitor&);
+        static void visitChildren(JSC::JSCell*, 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 ebc23b3..004d8be 100644 (file)
@@ -34,13 +34,19 @@ using namespace JSC;
 
 namespace WebCore {
 
-void JSJavaScriptAudioNode::visitChildren(SlotVisitor& visitor)
+void JSJavaScriptAudioNode::visitChildrenVirtual(SlotVisitor& visitor)
 {
-    ASSERT_GC_OBJECT_INHERITS(this, &s_info);
+    visitChildren(this, visitor);
+}
+
+void JSJavaScriptAudioNode::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    JSJavaScriptAudioNode* thisObject = static_cast<JSJavaScriptAudioNode*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
-    ASSERT(structure()->typeInfo().overridesVisitChildren());
-    Base::visitChildren(visitor);
-    static_cast<JavaScriptAudioNode*>(impl())->visitJSEventListeners(visitor);
+    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
+    Base::visitChildren(thisObject, visitor);
+    static_cast<JavaScriptAudioNode*>(thisObject->impl())->visitJSEventListeners(visitor);
 }
 
 } // namespace WebCore
index 34f5931..fa19c9d 100644 (file)
 using namespace JSC;
 
 namespace WebCore {
-    
-void JSMessageChannel::visitChildren(SlotVisitor& visitor)
+
+void JSMessageChannel::visitChildrenVirtual(SlotVisitor& visitor)
+{
+    visitChildren(this, visitor);
+}
+
+void JSMessageChannel::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    ASSERT_GC_OBJECT_INHERITS(this, &s_info);
+    JSMessageChannel* thisObject = static_cast<JSMessageChannel*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
-    ASSERT(structure()->typeInfo().overridesVisitChildren());
-    Base::visitChildren(visitor);
+    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
+    Base::visitChildren(thisObject, visitor);
 
-    if (MessagePort* port = m_impl->port1())
+    if (MessagePort* port = thisObject->m_impl->port1())
         visitor.addOpaqueRoot(port);
 
-    if (MessagePort* port = m_impl->port2())
+    if (MessagePort* port = thisObject->m_impl->port2())
         visitor.addOpaqueRoot(port);
 }
 
index 8adf4a7..9eed739 100644 (file)
@@ -42,18 +42,24 @@ using namespace JSC;
 
 namespace WebCore {
 
-void JSMessagePort::visitChildren(SlotVisitor& visitor)
+void JSMessagePort::visitChildrenVirtual(SlotVisitor& visitor)
 {
-    ASSERT_GC_OBJECT_INHERITS(this, &s_info);
+    visitChildren(this, visitor);
+}
+
+void JSMessagePort::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    JSMessagePort* thisObject = static_cast<JSMessagePort*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
-    ASSERT(structure()->typeInfo().overridesVisitChildren());
-    Base::visitChildren(visitor);
+    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
+    Base::visitChildren(thisObject, 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* port = m_impl->locallyEntangledPort())
+    if (MessagePort* port = thisObject->m_impl->locallyEntangledPort())
         visitor.addOpaqueRoot(port);
 
-    m_impl->visitJSEventListeners(visitor);
+    thisObject->m_impl->visitJSEventListeners(visitor);
 }
 
 JSC::JSValue JSMessagePort::postMessage(JSC::ExecState* exec)
index 47f56a2..a10d52a 100644 (file)
@@ -35,6 +35,11 @@ using namespace JSC;
 
 namespace WebCore {
 
+void JSNamedNodeMap::visitChildrenVirtual(SlotVisitor& visitor)
+{
+    visitChildren(this, visitor);
+}
+
 bool JSNamedNodeMap::canGetItemsForName(ExecState*, NamedNodeMap* impl, const Identifier& propertyName)
 {
     return impl->getNamedItem(identifierToString(propertyName));
@@ -46,18 +51,19 @@ JSValue JSNamedNodeMap::nameGetter(ExecState* exec, JSValue slotBase, const Iden
     return toJS(exec, thisObj->globalObject(), thisObj->impl()->getNamedItem(identifierToString(propertyName)));
 }
 
-void JSNamedNodeMap::visitChildren(SlotVisitor& visitor)
+void JSNamedNodeMap::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    ASSERT_GC_OBJECT_INHERITS(this, &s_info);
+    JSNamedNodeMap* thisObject = static_cast<JSNamedNodeMap*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
-    ASSERT(structure()->typeInfo().overridesVisitChildren());
-    Base::visitChildren(visitor);
+    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
+    Base::visitChildren(thisObject, 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
     // don't know how to keep it alive correctly.
     // FIXME: Fix this lifetime issue in the DOM, and remove this.
-    Element* element = impl()->element();
+    Element* element = thisObject->impl()->element();
     if (!element)
         return;
     visitor.addOpaqueRoot(root(element));
index 51e3bb8..9715266 100644 (file)
@@ -192,14 +192,20 @@ ScopeChainNode* JSNode::pushEventHandlerScope(ExecState*, ScopeChainNode* node)
     return node;
 }
 
-void JSNode::visitChildren(SlotVisitor& visitor)
+void JSNode::visitChildrenVirtual(SlotVisitor& visitor)
 {
-    ASSERT_GC_OBJECT_INHERITS(this, &s_info);
+    visitChildren(this, visitor);
+}
+
+void JSNode::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    JSNode* thisObject = static_cast<JSNode*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
-    ASSERT(structure()->typeInfo().overridesVisitChildren());
-    Base::visitChildren(visitor);
+    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
+    Base::visitChildren(thisObject, visitor);
 
-    Node* node = m_impl.get();
+    Node* node = thisObject->m_impl.get();
     node->visitJSEventListeners(visitor);
 
     visitor.addOpaqueRoot(root(node));
index c151c54..56081ec 100644 (file)
@@ -36,13 +36,19 @@ using namespace JSC;
 
 namespace WebCore {
 
-void JSNodeFilter::visitChildren(SlotVisitor& visitor)
+void JSNodeFilter::visitChildrenVirtual(SlotVisitor& visitor)
 {
-    ASSERT_GC_OBJECT_INHERITS(this, &s_info);
+    visitChildren(this, visitor);
+}
+
+void JSNodeFilter::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    JSNodeFilter* thisObject = static_cast<JSNodeFilter*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
-    ASSERT(structure()->typeInfo().overridesVisitChildren());
-    Base::visitChildren(visitor);
-    visitor.addOpaqueRoot(impl());
+    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
+    Base::visitChildren(thisObject, visitor);
+    visitor.addOpaqueRoot(thisObject->impl());
 }
 
 PassRefPtr<NodeFilter> toNodeFilter(JSGlobalData& globalData, JSValue value)
index 02d108d..7055946 100644 (file)
@@ -29,14 +29,20 @@ using namespace JSC;
 
 namespace WebCore {
 
-void JSNodeIterator::visitChildren(SlotVisitor& visitor)
+void JSNodeIterator::visitChildrenVirtual(SlotVisitor& visitor)
 {
-    ASSERT_GC_OBJECT_INHERITS(this, &s_info);
+    visitChildren(this, visitor);
+}
+
+void JSNodeIterator::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    JSNodeIterator* thisObject = static_cast<JSNodeIterator*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
-    ASSERT(structure()->typeInfo().overridesVisitChildren());
-    Base::visitChildren(visitor);
+    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
+    Base::visitChildren(thisObject, visitor);
 
-    if (NodeFilter* filter = m_impl->filter())
+    if (NodeFilter* filter = thisObject->m_impl->filter())
         visitor.addOpaqueRoot(filter);
 }
 
index dd20fba..87e6bf6 100644 (file)
 
 namespace WebCore {
 
-void JSSVGElementInstance::visitChildren(JSC::SlotVisitor& visitor)
+void JSSVGElementInstance::visitChildrenVirtual(JSC::SlotVisitor& visitor)
 {
-    ASSERT_GC_OBJECT_INHERITS(this, &s_info);
+    visitChildren(this, visitor);
+}
+
+void JSSVGElementInstance::visitChildren(JSC::JSCell* cell, JSC::SlotVisitor& visitor)
+{
+    JSSVGElementInstance* thisObject = static_cast<JSSVGElementInstance*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & JSC::OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
-    ASSERT(structure()->typeInfo().overridesVisitChildren());
-    Base::visitChildren(visitor);
-    visitor.addOpaqueRoot(root(impl()->correspondingElement()));
+    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
+    Base::visitChildren(thisObject, visitor);
+    visitor.addOpaqueRoot(root(thisObject->impl()->correspondingElement()));
 }
 
 } // namespace WebCore
index 3e37969..9f39a14 100644 (file)
@@ -43,14 +43,20 @@ using namespace JSC;
 
 namespace WebCore {
 
-void JSSharedWorker::visitChildren(SlotVisitor& visitor)
+void JSSharedWorker::visitChildrenVirtual(SlotVisitor& visitor)
 {
-    ASSERT_GC_OBJECT_INHERITS(this, &s_info);
+    visitChildren(this, visitor);
+}
+
+void JSSharedWorker::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    JSSharedWorker* thisObject = static_cast<JSSharedWorker*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
-    ASSERT(structure()->typeInfo().overridesVisitChildren());
-    Base::visitChildren(visitor);
+    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
+    Base::visitChildren(thisObject, visitor);
 
-    if (MessagePort* port = impl()->port())
+    if (MessagePort* port = thisObject->impl()->port())
         visitor.addOpaqueRoot(port);
 }
 
index 21e00b1..2d726ab 100644 (file)
@@ -35,13 +35,19 @@ using namespace JSC;
 
 namespace WebCore {
 
-void JSStyleSheet::visitChildren(SlotVisitor& visitor)
+void JSStyleSheet::visitChildrenVirtual(SlotVisitor& visitor)
 {
-    ASSERT_GC_OBJECT_INHERITS(this, &s_info);
+    visitChildren(this, visitor);
+}
+
+void JSStyleSheet::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    JSStyleSheet* thisObject = static_cast<JSStyleSheet*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
-    ASSERT(structure()->typeInfo().overridesVisitChildren());
-    Base::visitChildren(visitor);
-    visitor.addOpaqueRoot(root(impl()));
+    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
+    Base::visitChildren(thisObject, visitor);
+    visitor.addOpaqueRoot(root(thisObject->impl()));
 }
 
 JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, StyleSheet* styleSheet)
index dff3469..95edc05 100644 (file)
 using namespace JSC;
 
 namespace WebCore {
-    
-void JSTreeWalker::visitChildren(SlotVisitor& visitor)
+
+void JSTreeWalker::visitChildrenVirtual(SlotVisitor& visitor)
+{
+    visitChildren(this, visitor);
+}
+
+void JSTreeWalker::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    ASSERT_GC_OBJECT_INHERITS(this, &s_info);
+    JSTreeWalker* thisObject = static_cast<JSTreeWalker*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
-    ASSERT(structure()->typeInfo().overridesVisitChildren());
-    Base::visitChildren(visitor);
+    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
+    Base::visitChildren(thisObject, visitor);
 
-    if (NodeFilter* filter = m_impl->filter())
+    if (NodeFilter* filter = thisObject->m_impl->filter())
         visitor.addOpaqueRoot(filter);
 }
 
index cd55284..0e47f53 100644 (file)
@@ -192,13 +192,19 @@ static JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, WebGLExten
     return jsNull();
 }
 
-void JSWebGLRenderingContext::visitChildren(SlotVisitor& visitor)
+void JSWebGLRenderingContext::visitChildrenVirtual(SlotVisitor& visitor)
 {
-    ASSERT_GC_OBJECT_INHERITS(this, &s_info);
+    visitChildren(this, visitor);
+}
+
+void JSWebGLRenderingContext::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    JSWebGLRenderingContext* thisObject = static_cast<JSWebGLRenderingContext*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
-    ASSERT(structure()->typeInfo().overridesVisitChildren());
-    Base::visitChildren(visitor);
-    visitor.addOpaqueRoot(impl());
+    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
+    Base::visitChildren(thisObject, visitor);
+    visitor.addOpaqueRoot(thisObject->impl());
 }
 
 JSValue JSWebGLRenderingContext::getAttachedShaders(ExecState* exec)
index 887a3bc..f900496 100644 (file)
@@ -53,19 +53,25 @@ using namespace JSC;
 
 namespace WebCore {
 
-void JSWorkerContext::visitChildren(SlotVisitor& visitor)
+void JSWorkerContext::visitChildrenVirtual(SlotVisitor& visitor)
 {
-    ASSERT_GC_OBJECT_INHERITS(this, &s_info);
+    visitChildren(this, visitor);
+}
+
+void JSWorkerContext::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    JSWorkerContext* thisObject = static_cast<JSWorkerContext*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
-    ASSERT(structure()->typeInfo().overridesVisitChildren());
-    Base::visitChildren(visitor);
+    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
+    Base::visitChildren(thisObject, visitor);
 
-    if (WorkerLocation* location = impl()->optionalLocation())
+    if (WorkerLocation* location = thisObject->impl()->optionalLocation())
         visitor.addOpaqueRoot(location);
-    if (WorkerNavigator* navigator = impl()->optionalNavigator())
+    if (WorkerNavigator* navigator = thisObject->impl()->optionalNavigator())
         visitor.addOpaqueRoot(navigator);
 
-    impl()->visitJSEventListeners(visitor);
+    thisObject->impl()->visitJSEventListeners(visitor);
 }
 
 bool JSWorkerContext::getOwnPropertySlotDelegate(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
index 2575756..6091383 100644 (file)
@@ -54,28 +54,34 @@ using namespace JSC;
 
 namespace WebCore {
 
-void JSXMLHttpRequest::visitChildren(SlotVisitor& visitor)
+void JSXMLHttpRequest::visitChildrenVirtual(SlotVisitor& visitor)
 {
-    ASSERT_GC_OBJECT_INHERITS(this, &s_info);
+    visitChildren(this, visitor);
+}
+
+void JSXMLHttpRequest::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    JSXMLHttpRequest* thisObject = static_cast<JSXMLHttpRequest*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
-    ASSERT(structure()->typeInfo().overridesVisitChildren());
-    Base::visitChildren(visitor);
+    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
+    Base::visitChildren(thisObject, visitor);
 
-    if (XMLHttpRequestUpload* upload = m_impl->optionalUpload())
+    if (XMLHttpRequestUpload* upload = thisObject->m_impl->optionalUpload())
         visitor.addOpaqueRoot(upload);
 
-    if (Document* responseDocument = m_impl->optionalResponseXML())
+    if (Document* responseDocument = thisObject->m_impl->optionalResponseXML())
         visitor.addOpaqueRoot(responseDocument);
 
-    if (ArrayBuffer* responseArrayBuffer = m_impl->optionalResponseArrayBuffer())
+    if (ArrayBuffer* responseArrayBuffer = thisObject->m_impl->optionalResponseArrayBuffer())
         visitor.addOpaqueRoot(responseArrayBuffer);
 
 #if ENABLE(XHR_RESPONSE_BLOB)
-    if (Blob* responseBlob = m_impl->optionalResponseBlob())
+    if (Blob* responseBlob = thisObject->m_impl->optionalResponseBlob())
         visitor.addOpaqueRoot(responseBlob);
 #endif
 
-    m_impl->visitJSEventListeners(visitor);
+    thisObject->m_impl->visitJSEventListeners(visitor);
 }
 
 // Custom functions
index 35489dc..09942f5 100644 (file)
@@ -37,14 +37,20 @@ using namespace JSC;
 
 namespace WebCore {
 
-void JSXPathResult::visitChildren(SlotVisitor& visitor)
+void JSXPathResult::visitChildrenVirtual(SlotVisitor& visitor)
 {
-    ASSERT_GC_OBJECT_INHERITS(this, &s_info);
+    visitChildren(this, visitor);
+}
+
+void JSXPathResult::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    JSXPathResult* thisObject = static_cast<JSXPathResult*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
-    ASSERT(structure()->typeInfo().overridesVisitChildren());
-    Base::visitChildren(visitor);
+    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
+    Base::visitChildren(thisObject, visitor);
 
-    const XPath::Value& xpathValue = impl()->value();
+    const XPath::Value& xpathValue = thisObject->impl()->value();
     if (xpathValue.isNodeSet()) {
         const XPath::NodeSet& nodesToMark = xpathValue.toNodeSet();
         for (size_t i = 0; i < nodesToMark.size(); ++i) {
index 09528d5..5203fdf 100644 (file)
@@ -877,7 +877,8 @@ sub GenerateHeader
 
     # visit function
     if ($needsMarkChildren) {
-        push(@headerContent, "    virtual void visitChildren(JSC::SlotVisitor&);\n\n");
+        push(@headerContent, "    virtual void visitChildrenVirtual(JSC::SlotVisitor&);\n");
+        push(@headerContent, "    static void visitChildren(JSCell*, JSC::SlotVisitor&);\n\n");
         $structureFlags{"JSC::OverridesVisitChildren"} = 1;
     }
 
@@ -2200,21 +2201,27 @@ sub GenerateImplementation
         }
         
         if ($needsMarkChildren && !$dataNode->extendedAttributes->{"CustomMarkFunction"}) {
-            push(@implContent, "void ${className}::visitChildren(SlotVisitor& visitor)\n");
+            push(@implContent, "void ${className}::visitChildrenVirtual(SlotVisitor& visitor)\n");
             push(@implContent, "{\n");
-            push(@implContent, "    ASSERT_GC_OBJECT_INHERITS(this, &s_info);\n");
+            push(@implContent, "    visitChildren(this, visitor);\n");
+            push(@implContent, "}\n\n");
+
+            push(@implContent, "void ${className}::visitChildren(JSCell* cell, SlotVisitor& visitor)\n");
+            push(@implContent, "{\n");
+            push(@implContent, "    ${className}* thisObject = static_cast<${className}*>(cell);\n");
+            push(@implContent, "    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);\n");
             push(@implContent, "    COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);\n");
-            push(@implContent, "    ASSERT(structure()->typeInfo().overridesVisitChildren());\n");
-            push(@implContent, "    Base::visitChildren(visitor);\n");
+            push(@implContent, "    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());\n");
+            push(@implContent, "    Base::visitChildren(thisObject, visitor);\n");
             if ($dataNode->extendedAttributes->{"EventTarget"}) {
-                push(@implContent, "    impl()->visitJSEventListeners(visitor);\n");
+                push(@implContent, "    thisObject->impl()->visitJSEventListeners(visitor);\n");
             }
             if ($numCachedAttributes > 0) {
                 foreach (@{$dataNode->attributes}) {
                     my $attribute = $_;
                     if ($attribute->signature->extendedAttributes->{"CachedAttribute"}) {
-                        push(@implContent, "    if (m_" . $attribute->signature->name . ")\n");
-                        push(@implContent, "        visitor.append(&m_" . $attribute->signature->name . ");\n");
+                        push(@implContent, "    if (thisObject->m_" . $attribute->signature->name . ")\n");
+                        push(@implContent, "        visitor.append(&thisObject->m_" . $attribute->signature->name . ");\n");
                     }
                 }
             }
index fc683a5..119b49e 100644 (file)
@@ -1870,16 +1870,22 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionClassMethodWithOptional(E
     return JSValue::encode(result);
 }
 
-void JSTestObj::visitChildren(SlotVisitor& visitor)
+void JSTestObj::visitChildrenVirtual(SlotVisitor& visitor)
 {
-    ASSERT_GC_OBJECT_INHERITS(this, &s_info);
+    visitChildren(this, visitor);
+}
+
+void JSTestObj::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    JSTestObj* thisObject = static_cast<JSTestObj*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
-    ASSERT(structure()->typeInfo().overridesVisitChildren());
-    Base::visitChildren(visitor);
-    if (m_cachedAttribute1)
-        visitor.append(&m_cachedAttribute1);
-    if (m_cachedAttribute2)
-        visitor.append(&m_cachedAttribute2);
+    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
+    Base::visitChildren(thisObject, visitor);
+    if (thisObject->m_cachedAttribute1)
+        visitor.append(&thisObject->m_cachedAttribute1);
+    if (thisObject->m_cachedAttribute2)
+        visitor.append(&thisObject->m_cachedAttribute2);
 }
 
 // Constant getters
index 8d53412..f29dc8d 100644 (file)
@@ -53,7 +53,8 @@ public:
     static JSC::JSValue getConstructor(JSC::ExecState*, JSC::JSGlobalObject*);
     JSC::WriteBarrier<JSC::Unknown> m_cachedAttribute1;
     JSC::WriteBarrier<JSC::Unknown> m_cachedAttribute2;
-    virtual void visitChildren(JSC::SlotVisitor&);
+    virtual void visitChildrenVirtual(JSC::SlotVisitor&);
+    static void visitChildren(JSCell*, JSC::SlotVisitor&);
 
 
     // Custom attributes
index 4bbe65e..27bf1c1 100644 (file)
@@ -62,10 +62,16 @@ public:
     
     static const ClassInfo s_info;
 
-    virtual void visitChildren(SlotVisitor& visitor)
+    virtual void visitChildrenVirtual(SlotVisitor& visitor)
     {
-        RuntimeObject::visitChildren(visitor);
-        QtInstance* instance = static_cast<QtInstance*>(getInternalInstance());
+        visitChildren(this, visitor);
+    }
+
+    static void visitChildren(JSCell* cell, SlotVisitor& visitor)
+    {
+        QtRuntimeObject* thisObject = static_cast<QtRuntimeObject*>(cell);
+        RuntimeObject::visitChildren(thisObject, visitor);
+        QtInstance* instance = static_cast<QtInstance*>(thisObject->getInternalInstance());
         if (instance)
             instance->visitAggregate(visitor);
     }
index 73dd2bf..95ea8d9 100644 (file)
@@ -1439,10 +1439,16 @@ void QtRuntimeMetaMethod::finishCreation(ExecState* exec, const Identifier& iden
     d->m_allowPrivate = allowPrivate;
 }
 
-void QtRuntimeMetaMethod::visitChildren(SlotVisitor& visitor)
+void QtRuntimeMetaMethod::visitChildrenVirtual(SlotVisitor& visitor)
 {
-    QtRuntimeMethod::visitChildren(visitor);
-    QW_D(QtRuntimeMetaMethod);
+    visitChildren(this, visitor);
+}
+
+void QtRuntimeMetaMethod::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    QtRuntimeMetaMethod* thisObject = static_cast<QtRuntimeMetaMethod*>(cell);
+    QtRuntimeMethod::visitChildren(thisObject, visitor);
+    QtRuntimeMetaMethodData* d = thisObject->d_func();
     if (d->m_connect)
         visitor.append(&d->m_connect);
     if (d->m_disconnect)
index 906d108..de213c2 100644 (file)
@@ -168,7 +168,8 @@ public:
     virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
     virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties);
 
-    virtual void visitChildren(SlotVisitor&);
+    virtual void visitChildrenVirtual(SlotVisitor&);
+    static void visitChildren(JSCell*, SlotVisitor&);
 
 protected:
     QtRuntimeMetaMethodData* d_func() const {return reinterpret_cast<QtRuntimeMetaMethodData*>(d_ptr);}
index ff7b6d7..8ac0ef7 100644 (file)
@@ -144,7 +144,7 @@ namespace WebCore {
 #if ENABLE(INSPECTOR)
         WorkerInspectorController* workerInspectorController() { return m_workerInspectorController.get(); }
 #endif
-        // These methods are used for GC marking. See JSWorkerContext::visitChildren(SlotVisitor&) in
+        // These methods are used for GC marking. See JSWorkerContext::visitChildrenVirtual(SlotVisitor&) in
         // JSWorkerContextCustom.cpp.
         WorkerNavigator* optionalNavigator() const { return m_navigator.get(); }
         WorkerLocation* optionalLocation() const { return m_location.get(); }
index 53db0fb..afc7bce 100644 (file)
@@ -56,7 +56,7 @@ _ZN7WebCore20ShadowContentElement6createEPNS_8DocumentE;
 _ZN7WebCore21getCachedDOMStructureEPNS_17JSDOMGlobalObjectEPKN3JSC9ClassInfoE;
 _ZN7WebCore22externalRepresentationEPNS_7ElementEj;
 _ZN7WebCore24DocumentMarkerController10markersForEPNS_4NodeE;
-_ZN7WebCore6JSNode13visitChildrenERN3JSC11SlotVisitorE;
+_ZN7WebCore6JSNode20visitChildrenVirtualERN3JSC11SlotVisitorE;
 _ZN7WebCore6JSNode3putEPN3JSC9ExecStateERKNS1_10IdentifierENS1_7JSValueERNS1_15PutPropertySlotE;
 _ZN7WebCore6JSNode6s_infoE;
 _ZN7WebCore6toNodeEN3JSC7JSValueE;