[WTF] Drop SymbolRegistry::keyForSymbol
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 1 Jul 2017 05:09:40 +0000 (05:09 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 1 Jul 2017 05:09:40 +0000 (05:09 +0000)
https://bugs.webkit.org/show_bug.cgi?id=174052

Reviewed by Sam Weinig.

Source/JavaScriptCore:

* runtime/SymbolConstructor.cpp:
(JSC::symbolConstructorKeyFor):

Source/WTF:

Since we can know whether a given symbol is registered by checking RegisteredSymbolImpl,
we do not need to query key string for a given symbol by using SymbolRegistry::keyForSymbol.

* wtf/text/SymbolImpl.h:
(WTF::SymbolImpl::extractFoldedString): Deleted.
* wtf/text/SymbolRegistry.cpp:
(WTF::SymbolRegistry::keyForSymbol): Deleted.
* wtf/text/SymbolRegistry.h:

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

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/SymbolConstructor.cpp
Source/WTF/ChangeLog
Source/WTF/wtf/text/SymbolImpl.h
Source/WTF/wtf/text/SymbolRegistry.cpp
Source/WTF/wtf/text/SymbolRegistry.h

index bfb8a62..6dd0fc9 100644 (file)
@@ -1,3 +1,13 @@
+2017-06-30  Yusuke Suzuki  <utatane.tea@gmail.com>
+
+        [WTF] Drop SymbolRegistry::keyForSymbol
+        https://bugs.webkit.org/show_bug.cgi?id=174052
+
+        Reviewed by Sam Weinig.
+
+        * runtime/SymbolConstructor.cpp:
+        (JSC::symbolConstructorKeyFor):
+
 2017-06-30  Saam Barati  <sbarati@apple.com>
 
         B3ReduceStrength should reduce EqualOrUnordered over const float input
index 18dd0ab..cdfc55d 100644 (file)
@@ -123,7 +123,7 @@ EncodedJSValue JSC_HOST_CALL symbolConstructorKeyFor(ExecState* exec)
         return JSValue::encode(jsUndefined());
 
     ASSERT(uid.symbolRegistry() == &vm.symbolRegistry());
-    return JSValue::encode(jsString(exec, vm.symbolRegistry().keyForSymbol(*uid.asRegisteredSymbolImpl())));
+    return JSValue::encode(jsString(exec, &uid));
 }
 
 } // namespace JSC
index 7b2bbd8..8dc0783 100644 (file)
@@ -1,3 +1,19 @@
+2017-06-30  Yusuke Suzuki  <utatane.tea@gmail.com>
+
+        [WTF] Drop SymbolRegistry::keyForSymbol
+        https://bugs.webkit.org/show_bug.cgi?id=174052
+
+        Reviewed by Sam Weinig.
+
+        Since we can know whether a given symbol is registered by checking RegisteredSymbolImpl,
+        we do not need to query key string for a given symbol by using SymbolRegistry::keyForSymbol.
+
+        * wtf/text/SymbolImpl.h:
+        (WTF::SymbolImpl::extractFoldedString): Deleted.
+        * wtf/text/SymbolRegistry.cpp:
+        (WTF::SymbolRegistry::keyForSymbol): Deleted.
+        * wtf/text/SymbolRegistry.h:
+
 2017-06-29  Jer Noble  <jer.noble@apple.com>
 
         Make Legacy EME API controlled by RuntimeEnabled setting.
index f6d6144..42f0121 100644 (file)
@@ -51,14 +51,6 @@ public:
     WTF_EXPORT_STRING_API static Ref<SymbolImpl> createNullSymbol();
     WTF_EXPORT_STRING_API static Ref<SymbolImpl> create(StringImpl& rep);
 
-    Ref<StringImpl> extractFoldedString()
-    {
-        ASSERT(substringBuffer());
-        ASSERT(substringBuffer() == m_owner);
-        ASSERT(!substringBuffer()->isSymbol());
-        return createSubstringSharingImpl(*this, 0, length());
-    }
-
 protected:
     WTF_EXPORT_PRIVATE static unsigned nextHashForSymbol();
 
index 6856cc3..67d9c59 100644 (file)
@@ -49,12 +49,6 @@ Ref<RegisteredSymbolImpl> SymbolRegistry::symbolForKey(const String& rep)
     return symbol;
 }
 
-String SymbolRegistry::keyForSymbol(RegisteredSymbolImpl& uid)
-{
-    ASSERT(uid.symbolRegistry() == this);
-    return uid.extractFoldedString();
-}
-
 void SymbolRegistry::remove(RegisteredSymbolImpl& uid)
 {
     ASSERT(uid.symbolRegistry() == this);
index 3d4f432..98d22c9 100644 (file)
@@ -83,7 +83,6 @@ public:
     WTF_EXPORT_PRIVATE ~SymbolRegistry();
 
     WTF_EXPORT_PRIVATE Ref<RegisteredSymbolImpl> symbolForKey(const String&);
-    WTF_EXPORT_PRIVATE String keyForSymbol(RegisteredSymbolImpl&);
 
     void remove(RegisteredSymbolImpl&);