2010-02-21 Maciej Stachowiak <mjs@apple.com>
authormjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Feb 2010 09:28:30 +0000 (09:28 +0000)
committermjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Feb 2010 09:28:30 +0000 (09:28 +0000)
commit3bd4f51fae689f64b07c823e4f8ef8c0cd8f6649
treef8da815994a84119c51fe3813c61bf00f98c3c84
parenta0e9ec5ff8c9e8ef40e7db3a959e4c3edcd5a535
2010-02-21  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin Adler.

        Cache JavaScript wrappers inline in DOM nodes
        https://bugs.webkit.org/show_bug.cgi?id=35226
        <rdar://problem/7664202>

        8.8% speedup on Dromaeo DOM Core tests.
        3.3% speedup on Hixie DOM Core tests.

        * bindings/js/JSDOMBinding.cpp:
        (WebCore::forgetDOMNode): Clear wrapper pointer.
        (WebCore::cacheDOMNodeWrapper): Cache inline too if caching for normal world.
        * bindings/js/JSDOMBinding.h:
        (WebCore::DOMObjectWrapperMapFor):
        * bindings/js/JSDocumentCustom.cpp:
        (WebCore::toJS): Remove unneeded argument from getCachedDOMNodeWrapper.
        * bindings/js/JSNodeCustom.cpp:
        (WebCore::createWrapperInline): Renamed version of original createWrapper.
        (WebCore::createWrapper): Call createWrapperInline. Out-of-line version.
        (WebCore::toJSNewlyCreated): Call createWrapperInline instead of createWrapper.
        * bindings/js/JSNodeCustom.h: Added.
        (WebCore::getCachedDOMNodeWrapper): Moved here so it can be inlined.
        (WebCore::toJS): Moved here so it can be inlined.
        * bindings/js/ScriptWrappable.h:
        (WebCore::ScriptWrappable::ScriptWrappable): Implement this in the obvious
        way for JavaScriptCore.
        (WebCore::ScriptWrappable::wrapper):
        (WebCore::ScriptWrappable::setWrapper):
        (WebCore::ScriptWrappable::clearWrapper):
        * bindings/scripts/CodeGeneratorJS.pm: Include CustomHeader heaaders
        in the header, not just the impl file, so they can add inlining.
        * dom/Node.idl: Add CustomHeader directive.

        Add new files to build.

        * GNUmakefile.am:
        * WebCore.gypi:
        * WebCore.pro:
        * WebCore.vcproj/WebCore.vcproj:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55074 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
WebCore/ChangeLog
WebCore/GNUmakefile.am
WebCore/WebCore.gypi
WebCore/WebCore.pro
WebCore/WebCore.vcproj/WebCore.vcproj
WebCore/bindings/js/JSDOMBinding.cpp
WebCore/bindings/js/JSDOMBinding.h
WebCore/bindings/js/JSDocumentCustom.cpp
WebCore/bindings/js/JSNodeCustom.cpp
WebCore/bindings/js/JSNodeCustom.h [new file with mode: 0644]
WebCore/bindings/js/ScriptWrappable.h
WebCore/bindings/scripts/CodeGeneratorJS.pm
WebCore/dom/Node.idl