[JSC] Clean up FTL Capabilities for CompareEq
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 Aug 2016 01:48:10 +0000 (01:48 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 Aug 2016 01:48:10 +0000 (01:48 +0000)
https://bugs.webkit.org/show_bug.cgi?id=161353

Patch by Benjamin Poulain <bpoulain@apple.com> on 2016-08-29
Reviewed by Geoffrey Garen.

It looks like we already have code for every case.
This patch removes the tests from FTLCapabilities
and move the generic case last as usual.

* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileCompareEq):

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

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/ftl/FTLCapabilities.cpp
Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp

index 1308f80..bbf5ca2 100644 (file)
@@ -1,3 +1,19 @@
+2016-08-29  Benjamin Poulain  <bpoulain@apple.com>
+
+        [JSC] Clean up FTL Capabilities for CompareEq
+        https://bugs.webkit.org/show_bug.cgi?id=161353
+
+        Reviewed by Geoffrey Garen.
+
+        It looks like we already have code for every case.
+        This patch removes the tests from FTLCapabilities
+        and move the generic case last as usual.
+
+        * ftl/FTLCapabilities.cpp:
+        (JSC::FTL::canCompile):
+        * ftl/FTLLowerDFGToB3.cpp:
+        (JSC::FTL::DFG::LowerDFGToB3::compileCompareEq):
+
 2016-08-29  Keith Miller  <keith_miller@apple.com>
 
         Fix toStringName for Proxies and add support for normal instances
index 2167af1..4e7015b 100644 (file)
@@ -245,6 +245,7 @@ inline CapabilityLevel canCompile(Node* node)
     case ResolveScope:
     case GetDynamicVar:
     case PutDynamicVar:
+    case CompareEq:
     case CompareEqPtr:
     case CompareStrictEq:
         // These are OK.
@@ -363,32 +364,6 @@ inline CapabilityLevel canCompile(Node* node)
             return CannotCompile;
         }
         break;
-    case CompareEq:
-        if (node->isBinaryUseKind(Int32Use))
-            break;
-        if (node->isBinaryUseKind(Int52RepUse))
-            break;
-        if (node->isBinaryUseKind(DoubleRepUse))
-            break;
-        if (node->isBinaryUseKind(StringIdentUse))
-            break;
-        if (node->isBinaryUseKind(StringUse))
-            break;
-        if (node->isBinaryUseKind(SymbolUse))
-            break;
-        if (node->isBinaryUseKind(ObjectUse))
-            break;
-        if (node->isBinaryUseKind(UntypedUse))
-            break;
-        if (node->isBinaryUseKind(BooleanUse))
-            break;
-        if (node->isBinaryUseKind(ObjectUse, ObjectOrOtherUse))
-            break;
-        if (node->isBinaryUseKind(ObjectOrOtherUse, ObjectUse))
-            break;
-        if (node->child1().useKind() == OtherUse || node->child2().useKind() == OtherUse)
-            break;
-        return CannotCompile;
     case CompareLess:
     case CompareLessEq:
     case CompareGreater:
index a7e2681..9c817e2 100644 (file)
@@ -4998,15 +4998,6 @@ private:
             compareEqObjectOrOtherToObject(m_node->child1(), m_node->child2());
             return;
         }
-        
-        if (m_node->isBinaryUseKind(UntypedUse)) {
-            nonSpeculativeCompare(
-                [&] (LValue left, LValue right) {
-                    return m_out.equal(left, right);
-                },
-                operationCompareEq);
-            return;
-        }
 
         if (m_node->child1().useKind() == OtherUse) {
             ASSERT(!m_interpreter.needsTypeCheck(m_node->child1(), SpecOther));
@@ -5020,7 +5011,12 @@ private:
             return;
         }
 
-        DFG_CRASH(m_graph, m_node, "Bad use kinds");
+        DFG_ASSERT(m_graph, m_node, m_node->isBinaryUseKind(UntypedUse));
+        nonSpeculativeCompare(
+            [&] (LValue left, LValue right) {
+                return m_out.equal(left, right);
+            },
+            operationCompareEq);
     }
     
     void compileCompareStrictEq()