VM::lastCachedString should be a Strong, not a Weak.
<https://webkit.org/b/134746>
Using Weak<JSString> for this regressed some of our bindings perf tests
due to Weak having to allocate a new WeakImpl every time the last cached
string changed. Make it a Strong instead should make that problem go away.
Reviewed by Geoffrey Garen.
* runtime/JSString.cpp:
(JSC::jsStringWithCacheSlowCase):
* runtime/VM.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170898 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/JavaScriptCore/runtime/JSString.cpp b/Source/JavaScriptCore/runtime/JSString.cpp
index cdc34d6..10a16d9 100644
--- a/Source/JavaScriptCore/runtime/JSString.cpp
+++ b/Source/JavaScriptCore/runtime/JSString.cpp
@@ -29,6 +29,7 @@
#include "JSCInlines.h"
#include "StringObject.h"
#include "StringPrototype.h"
+#include "StrongInlines.h"
namespace JSC {
@@ -379,7 +380,7 @@
auto addResult = vm.stringCache.add(&stringImpl, nullptr);
if (addResult.isNewEntry)
addResult.iterator->value = jsString(&vm, String(stringImpl));
- vm.lastCachedString = addResult.iterator->value.get();
+ vm.lastCachedString.set(vm, addResult.iterator->value.get());
return addResult.iterator->value.get();
}