Ignore:
Timestamp:
Sep 29, 2011, 12:37:09 PM (14 years ago)
Author:
[email protected]
Message:

De-virtualize JSCell::visitChildrenVirtual and remove all other visitChildrenVirtual methods
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:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/JavaScriptCore.exp

    r96164 r96346  
    167167__ZN3JSC14JSGlobalObject17putWithAttributesEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueEj
    168168__ZN3JSC14JSGlobalObject18getOwnPropertySlotEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE
    169 __ZN3JSC14JSGlobalObject20visitChildrenVirtualERNS_11SlotVisitorE
    170169__ZN3JSC14JSGlobalObject24getOwnPropertyDescriptorEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE
    171170__ZN3JSC14JSGlobalObject3putEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueERNS_15PutPropertySlotE 
     
    278277__ZN3JSC7JSArray15setSubclassDataEPv
    279278__ZN3JSC7JSArray18getOwnPropertySlotEPNS_9ExecStateEjRNS_12PropertySlotE
    280 __ZN3JSC7JSArray20visitChildrenVirtualERNS_11SlotVisitorE
    281279__ZN3JSC7JSArray6s_infoE
    282280__ZN3JSC7JSArray9setLengthEj
     
    322320__ZN3JSC8JSObject18getOwnPropertySlotEPNS_9ExecStateEjRNS_12PropertySlotE
    323321__ZN3JSC8JSObject19getOwnPropertyNamesEPNS_9ExecStateERNS_17PropertyNameArrayENS_15EnumerationModeE
    324 __ZN3JSC8JSObject20visitChildrenVirtualERNS_11SlotVisitorE
    325322__ZN3JSC8JSObject21getPropertyDescriptorEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE
    326323__ZN3JSC8JSObject22fillGetterPropertySlotERNS_12PropertySlotEPNS_16WriteBarrierBaseINS_7UnknownEEE
Note: See TracChangeset for help on using the changeset viewer.