Fast path for jsStringWithCache() when asked for the same string repeatedly.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 7 Jul 2014 21:06:15 +0000 (21:06 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 7 Jul 2014 21:06:15 +0000 (21:06 +0000)
<https://webkit.org/b/134635>

Reviewed by Darin Adler.

Follow-up to r170818 addressing a review comment by Geoff Garen.

* runtime/JSString.cpp:
(JSC::jsStringWithCacheSlowCase):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@170857 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/JSString.cpp

index 205c895..92ba0ef 100644 (file)
@@ -1,3 +1,15 @@
+2014-07-07  Andreas Kling  <akling@apple.com>
+
+        Fast path for jsStringWithCache() when asked for the same string repeatedly.
+        <https://webkit.org/b/134635>
+
+        Reviewed by Darin Adler.
+
+        Follow-up to r170818 addressing a review comment by Geoff Garen.
+
+        * runtime/JSString.cpp:
+        (JSC::jsStringWithCacheSlowCase):
+
 2014-07-07  Tibor Meszaros  <tmeszaros.u-szeged@partner.samsung.com>
 
         Add missing ENABLE(FTL_JIT) guards
index 641d8b6..cdc34d6 100644 (file)
@@ -380,7 +380,7 @@ JSString* jsStringWithCacheSlowCase(VM& vm, StringImpl& stringImpl)
     if (addResult.isNewEntry)
         addResult.iterator->value = jsString(&vm, String(stringImpl));
     vm.lastCachedString = addResult.iterator->value.get();
-    return vm.lastCachedString.get();
+    return addResult.iterator->value.get();
 }
 
 } // namespace JSC