2010-01-16 Maciej Stachowiak <mjs@apple.com>
authormjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 17 Jan 2010 07:18:38 +0000 (07:18 +0000)
committermjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 17 Jan 2010 07:18:38 +0000 (07:18 +0000)
commitf7e0c7d6811105fcccc33db7efd212f3fa22e6bc
tree6134f48a0bdba8d926d2570312ea8c662991e7b2
parenta6dcfd55236524d1fc10b75020d886e9283ef523
2010-01-16  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Oliver Hunt.

        Cache JS string values made from DOM strings (Dromaeo speedup)
        https://bugs.webkit.org/show_bug.cgi?id=33768
        <rdar://problem/7353576>

        * runtime/JSString.h:
        (JSC::jsStringWithFinalizer): Added new mechanism for a string to have an optional
        finalizer callback, for the benefit of weak-referencing caches.
        (JSC::):
        (JSC::Fiber::JSString):
        (JSC::Fiber::~JSString):
        * runtime/JSString.cpp:
        (JSC::JSString::resolveRope): Clear fibers so this doesn't look like a string with a finalizer.
        * runtime/WeakGCMap.h: Include "Collector.h" to make this header includable by itself.
2010-01-16  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Oliver Hunt.

        Cache JS string values made from DOM strings (Dromaeo speedup)
        https://bugs.webkit.org/show_bug.cgi?id=33768
        <rdar://problem/7353576>

        * Plugins/Hosted/ProxyInstance.mm:
        (WebKit::ProxyInstance::stringValue): Explicitly make a String, since char*
        is now ambiguous.
2010-01-16  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Oliver Hunt.

        Cache JS string values made from DOM strings (Dromaeo speedup)
        https://bugs.webkit.org/show_bug.cgi?id=33768
        <rdar://problem/7353576>

        Added a new cache for JSString values that are created from Strings or AtomicStrings
        in the DOM. It's common for the same string to be retrieved from the DOM repeatedly,
        and it is wasteful to make a new JS-level string value every time.

        The string cache is per-world, and thus thread-safe and not a
        vector for accidental information exchange.

        ~30% speedup on Dromaeo Attributes test, also substantially helps other Dromaeo DOM tests.

        * bindings/js/JSDOMBinding.cpp:
        (WebCore::jsStringCache): Helper function to get the string cache for the current world.
        (WebCore::jsString): Some new overloads including the caching version.
        (WebCore::stringWrapperDestroyed): Finalizer callback - remove from relevant caches.
        * bindings/js/JSDOMBinding.h:
        (WebCore::jsString): Prototype new overloads (and define a few inline).
        * bindings/js/JSJavaScriptCallFrameCustom.cpp:
        (WebCore::JSJavaScriptCallFrame::type): Explicitly make a UString.
        * bindings/js/ScriptFunctionCall.cpp:
        (WebCore::ScriptFunctionCall::appendArgument): Ditto.
        * WebCore.base.exp: Add new JSString overloads that WebCore gets to see.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53371 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
JavaScriptCore/ChangeLog
JavaScriptCore/runtime/JSString.cpp
JavaScriptCore/runtime/JSString.h
JavaScriptCore/runtime/WeakGCMap.h
WebCore/ChangeLog
WebCore/WebCore.base.exp
WebCore/bindings/js/JSDOMBinding.cpp
WebCore/bindings/js/JSDOMBinding.h
WebCore/bindings/js/JSJavaScriptCallFrameCustom.cpp
WebCore/bindings/js/ScriptFunctionCall.cpp
WebKit/mac/ChangeLog
WebKit/mac/Plugins/Hosted/ProxyInstance.mm