Fast path for jsStringWithCache() when asked for the same string repeatedly.
[WebKit-https.git] / Source / WebCore / bindings / js / JSDOMBinding.cpp
index d9c47e3..0567ecc 100644 (file)
@@ -63,25 +63,6 @@ const JSC::HashTable& getHashTableForGlobalData(VM& vm, const JSC::HashTable& st
     return DOMObjectHashTableMap::mapFor(vm).get(staticTable);
 }
 
-JSC::JSValue jsStringWithCache(JSC::ExecState* exec, const String& s)
-{
-    JSC::VM& vm = exec->vm();
-    StringImpl* stringImpl = s.impl();
-    if (!stringImpl || !stringImpl->length())
-        return jsEmptyString(&vm);
-
-    if (stringImpl->length() == 1) {
-        UChar singleCharacter = (*stringImpl)[0u];
-        if (singleCharacter <= JSC::maxSingleCharacterString)
-            return vm.smallStrings.singleCharacterString(static_cast<unsigned char>(singleCharacter));
-    }
-
-    auto addResult = vm.stringCache.add(stringImpl, nullptr);
-    if (addResult.isNewEntry)
-        addResult.iterator->value = JSC::jsString(&vm, String(stringImpl));
-    return JSC::JSValue(addResult.iterator->value.get());
-}
-
 JSValue jsStringOrNull(ExecState* exec, const String& s)
 {
     if (s.isNull())