Fast path for jsStringWithCache() when asked for the same string repeatedly.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 5 Jul 2014 03:36:36 +0000 (03:36 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 5 Jul 2014 03:36:36 +0000 (03:36 +0000)
commitac9be0b448266348351446b4426c29505a81d9c2
tree67e44223a40c8d288e3c2c14c95ccc11ad9bc027
parent85daf11fee366e5b3d323e377d4d9c26123566f4
Fast path for jsStringWithCache() when asked for the same string repeatedly.
<https://webkit.org/b/134635>

Source/JavaScriptCore:
Also moved the whole thing from WebCore to JavaScriptCore since it
makes more sense here, and inline the lightweight checks, leaving only
the hashmap stuff out of line.

Reviewed by Darin Adler.

* runtime/JSString.cpp:
(JSC::jsStringWithCacheSlowCase):
* runtime/JSString.h:
(JSC::jsStringWithCache):
* runtime/VM.h:

Source/WebCore:
Reviewed by Darin Adler.

* WebCore.exp.in:
* bindings/js/JSDOMBinding.cpp:
(WebCore::jsStringWithCache): Deleted.
* bindings/js/JSDOMBinding.h:
(WebCore::JSValueTraits<String>::arrayJSValue):
(WebCore::jsStringWithCache): Deleted.
* bridge/c/c_utility.cpp:
(JSC::Bindings::convertNPVariantToValue):
* loader/cache/CachedResourceHandle.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@170818 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/JSString.cpp
Source/JavaScriptCore/runtime/JSString.h
Source/JavaScriptCore/runtime/VM.h
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/bindings/js/JSDOMBinding.cpp
Source/WebCore/bindings/js/JSDOMBinding.h
Source/WebCore/bridge/c/c_utility.cpp
Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in