Skip to content
  • mhahnenberg@apple.com's avatar
    De-virtualize JSCell::visitChildrenVirtual and remove all other visitChildrenVirtual methods · 8687da90
    mhahnenberg@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=68839
    
    Reviewed by Geoffrey Garen.
    
    Source/JavaScriptCore:
    
    Removed the remaining visitChildrenVirtual methods.  This patch completes the process of
    de-virtualizing visitChildren.
    
    * API/JSCallbackObject.h:
    * JavaScriptCore.exp:
    * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
    * debugger/DebuggerActivation.cpp:
    * debugger/DebuggerActivation.h:
    * runtime/Arguments.cpp:
    * runtime/Arguments.h:
    * runtime/Executable.cpp:
    * runtime/Executable.h:
    * runtime/GetterSetter.cpp:
    * runtime/GetterSetter.h:
    * runtime/JSActivation.cpp:
    * runtime/JSActivation.h:
    * runtime/JSArray.cpp:
    * runtime/JSArray.h:
    * runtime/JSFunction.cpp:
    * runtime/JSFunction.h:
    * runtime/JSGlobalObject.cpp:
    * runtime/JSGlobalObject.h:
    * runtime/JSObject.cpp:
    * runtime/JSPropertyNameIterator.cpp:
    * runtime/JSPropertyNameIterator.h:
    * runtime/JSStaticScopeObject.cpp:
    * runtime/JSStaticScopeObject.h:
    * runtime/JSValue.h:
    * runtime/NativeErrorConstructor.cpp:
    * runtime/NativeErrorConstructor.h:
    * runtime/RegExpObject.cpp:
    * runtime/RegExpObject.h:
    * runtime/Structure.cpp:
    * runtime/Structure.h:
    * runtime/StructureChain.cpp:
    * runtime/StructureChain.h:
    
    Inlined the method table access and call to the visitChildren function (the only call sites
    to visitChildren are here).
    * heap/MarkStack.cpp:
    (JSC::SlotVisitor::visitChildren):
    
    Changed the field name for the visitChildren function pointer to visitChildren (from
    visitChildrenFunctionPtr) to make call sites less verbose.
    * runtime/ClassInfo.h:
    
    Discovered JSBoundFunction doesn't have its own ClassInfo (it used JSFunction's ClassInfo) but
    overrides visitChildren, so it needs to have its own ClassInfo.
    * runtime/JSBoundFunction.cpp:
    * runtime/JSBoundFunction.h:
    
    Had to move className up to make sure that the virtual destructor in JSObject wasn't
    the first non-inline virtual method in JSObject (as per the comment in the file).
    Also moved JSCell::visitChildrenVirtual into JSObject.h in order for it be inline-able
    to mitigate the cost of an extra method call.
    
    Also added a convenience accessor function methodTable() to JSCell to return the MethodTable to make
    call sites more concise.  Implementation is inline in JSObject.h.
    * runtime/JSObject.h:
    (JSC::JSCell::methodTable):
    * runtime/JSCell.h:
    
    Added an out of line virtual destructor to JSWrapperObject and ScopeChainNode to
    appease the vtable gods.  It refused to compile if there were no virtual methods in
    both of these classes due to the presence of a weak vtable pointer.
    * runtime/JSWrapperObject.cpp:
    (JSC::JSWrapperObject::~JSWrapperObject):
    * runtime/JSWrapperObject.h:
    * runtime/ScopeChain.cpp:
    (JSC::ScopeChainNode::~ScopeChainNode):
    * runtime/ScopeChain.h:
    
    Source/JavaScriptGlue:
    
    Removed the remaining visitChildrenVirtual methods.  This patch completes the process of
    de-virtualizing visitChildren.
    
    * UserObjectImp.cpp:
    * UserObjectImp.h:
    
    Source/WebCore:
    
    No new tests.
    
    Removed the remaining visitChildrenVirtual methods.  This patch completes the process of
    de-virtualizing visitChildren.
    
    * WebCore.exp.in:
    * bindings/js/JSAttrCustom.cpp:
    * bindings/js/JSAudioContextCustom.cpp:
    * bindings/js/JSCSSRuleCustom.cpp:
    * bindings/js/JSCSSStyleDeclarationCustom.cpp:
    * bindings/js/JSCanvasRenderingContextCustom.cpp:
    * bindings/js/JSDOMGlobalObject.cpp:
    (WebCore::JSDOMGlobalObject::~JSDOMGlobalObject):
    (WebCore::JSDOMGlobalObject::finishCreation):
    * bindings/js/JSDOMGlobalObject.h:
    * bindings/js/JSDOMWindowCustom.cpp:
    * bindings/js/JSDOMWindowShell.cpp:
    * bindings/js/JSDOMWindowShell.h:
    * bindings/js/JSJavaScriptAudioNodeCustom.cpp:
    * bindings/js/JSMessageChannelCustom.cpp:
    * bindings/js/JSMessagePortCustom.cpp:
    * bindings/js/JSNamedNodeMapCustom.cpp:
    * bindings/js/JSNodeCustom.cpp:
    * bindings/js/JSNodeFilterCustom.cpp:
    * bindings/js/JSNodeIteratorCustom.cpp:
    * bindings/js/JSSVGElementInstanceCustom.cpp:
    * bindings/js/JSSharedWorkerCustom.cpp:
    * bindings/js/JSStyleSheetCustom.cpp:
    * bindings/js/JSTreeWalkerCustom.cpp:
    * bindings/js/JSWebGLRenderingContextCustom.cpp:
    * bindings/js/JSWorkerContextCustom.cpp:
    * bindings/js/JSXMLHttpRequestCustom.cpp:
    * bindings/js/JSXPathResultCustom.cpp:
    * bindings/scripts/CodeGeneratorJS.pm:
    (GenerateHeader):
    (GenerateImplementation):
    * bridge/qt/qt_instance.cpp:
    * bridge/qt/qt_runtime.cpp:
    * bridge/qt/qt_runtime.h:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96346 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    8687da90