Title: [150658] branches/dfgFourthTier/Source/_javascript_Core
Revision
150658
Author
[email protected]
Date
2013-05-24 14:45:44 -0700 (Fri, 24 May 2013)

Log Message

fourthTier: FTL should support LogicalNot and Branch on Int32 and Number
https://bugs.webkit.org/show_bug.cgi?id=116739

Reviewed by Gavin Barraclough.

* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compileLogicalNot):
(JSC::FTL::LowerDFGToLLVM::compileBranch):
(JSC::FTL::LowerDFGToLLVM::boolify):
(LowerDFGToLLVM):
* ftl/FTLOutput.h:
(JSC::FTL::Output::isZero32):
(JSC::FTL::Output::notZero32):

Modified Paths

Diff

Modified: branches/dfgFourthTier/Source/_javascript_Core/ChangeLog (150657 => 150658)


--- branches/dfgFourthTier/Source/_javascript_Core/ChangeLog	2013-05-24 21:06:07 UTC (rev 150657)
+++ branches/dfgFourthTier/Source/_javascript_Core/ChangeLog	2013-05-24 21:45:44 UTC (rev 150658)
@@ -1,3 +1,21 @@
+2013-05-24  Filip Pizlo  <[email protected]>
+
+        fourthTier: FTL should support LogicalNot and Branch on Int32 and Number
+        https://bugs.webkit.org/show_bug.cgi?id=116739
+
+        Reviewed by Gavin Barraclough.
+
+        * ftl/FTLCapabilities.cpp:
+        (JSC::FTL::canCompile):
+        * ftl/FTLLowerDFGToLLVM.cpp:
+        (JSC::FTL::LowerDFGToLLVM::compileLogicalNot):
+        (JSC::FTL::LowerDFGToLLVM::compileBranch):
+        (JSC::FTL::LowerDFGToLLVM::boolify):
+        (LowerDFGToLLVM):
+        * ftl/FTLOutput.h:
+        (JSC::FTL::Output::isZero32):
+        (JSC::FTL::Output::notZero32):
+
 2013-05-23  Filip Pizlo  <[email protected]>
 
         fourthTier: add heuristics to reduce the likelihood of a trivially inlineable function being independently compiled by the concurrent JIT

Modified: branches/dfgFourthTier/Source/_javascript_Core/ftl/FTLCapabilities.cpp (150657 => 150658)


--- branches/dfgFourthTier/Source/_javascript_Core/ftl/FTLCapabilities.cpp	2013-05-24 21:06:07 UTC (rev 150657)
+++ branches/dfgFourthTier/Source/_javascript_Core/ftl/FTLCapabilities.cpp	2013-05-24 21:45:44 UTC (rev 150658)
@@ -124,9 +124,15 @@
         return false;
     case Branch:
     case LogicalNot:
-        if (node->child1().useKind() == BooleanUse)
+        switch (node->child1().useKind()) {
+        case BooleanUse:
+        case Int32Use:
+        case NumberUse:
             break;
-        return false;
+        default:
+            return false;
+        }
+        break;
     default:
         // Don't know how to handle anything else.
         return false;
@@ -163,12 +169,21 @@
                     break;
                 default:
                     // Don't know how to handle anything else.
+                    if (verboseCompilationEnabled()) {
+                        dataLog("FTL rejecting node because of bad use kind: ", edge.useKind(), " in node:\n");
+                        graph.dump(WTF::dataFile(), "    ", node);
+                    }
                     return false;
                 }
             }
             
-            if (!canCompile(node))
+            if (!canCompile(node)) {
+                if (verboseCompilationEnabled()) {
+                    dataLog("FTL rejecting node:\n");
+                    graph.dump(WTF::dataFile(), "    ", node);
+                }
                 return false;
+            }
         }
     }
     

Modified: branches/dfgFourthTier/Source/_javascript_Core/ftl/FTLLowerDFGToLLVM.cpp (150657 => 150658)


--- branches/dfgFourthTier/Source/_javascript_Core/ftl/FTLLowerDFGToLLVM.cpp	2013-05-24 21:06:07 UTC (rev 150657)
+++ branches/dfgFourthTier/Source/_javascript_Core/ftl/FTLLowerDFGToLLVM.cpp	2013-05-24 21:45:44 UTC (rev 150658)
@@ -1126,16 +1126,7 @@
     
     void compileLogicalNot()
     {
-        switch (m_node->child1().useKind()) {
-        case BooleanUse: {
-            m_booleanValues.add(m_node, m_out.bitNot(lowBoolean(m_node->child1())));
-            break;
-        }
-            
-        default:
-            RELEASE_ASSERT_NOT_REACHED();
-            break;
-        }
+        m_booleanValues.add(m_node, m_out.bitNot(boolify(m_node->child1())));
     }
     
     void compileJump()
@@ -1145,19 +1136,10 @@
     
     void compileBranch()
     {
-        switch (m_node->child1().useKind()) {
-        case BooleanUse: {
-            m_out.branch(
-                lowBoolean(m_node->child1()),
-                m_blocks.get(m_graph.m_blocks[m_node->takenBlockIndex()].get()),
-                m_blocks.get(m_graph.m_blocks[m_node->notTakenBlockIndex()].get()));
-            break;
-        }
-            
-        default:
-            RELEASE_ASSERT_NOT_REACHED();
-            break;
-        }
+        m_out.branch(
+            boolify(m_node->child1()),
+            m_blocks.get(m_graph.m_blocks[m_node->takenBlockIndex()].get()),
+            m_blocks.get(m_graph.m_blocks[m_node->notTakenBlockIndex()].get()));
     }
     
     void compileReturn()
@@ -1172,6 +1154,21 @@
         terminate(InadequateCoverage);
     }
     
+    LValue boolify(Edge edge)
+    {
+        switch (edge.useKind()) {
+        case BooleanUse:
+            return lowBoolean(m_node->child1());
+        case Int32Use:
+            return m_out.notZero32(lowInt32(m_node->child1()));
+        case NumberUse:
+            return m_out.doubleNotEqual(lowDouble(edge), m_out.doubleZero);
+        default:
+            RELEASE_ASSERT_NOT_REACHED();
+            return 0;
+        }
+    }
+    
     enum EqualNullOrUndefinedMode { EqualNull, EqualUndefined, EqualNullOrUndefined };
     void equalNullOrUndefined(Edge edge, EqualNullOrUndefinedMode mode)
     {

Modified: branches/dfgFourthTier/Source/_javascript_Core/ftl/FTLOutput.h (150657 => 150658)


--- branches/dfgFourthTier/Source/_javascript_Core/ftl/FTLOutput.h	2013-05-24 21:06:07 UTC (rev 150657)
+++ branches/dfgFourthTier/Source/_javascript_Core/ftl/FTLOutput.h	2013-05-24 21:45:44 UTC (rev 150658)
@@ -290,6 +290,8 @@
     
     LValue isZero8(LValue value) { return equal(value, int8Zero); }
     LValue notZero8(LValue value) { return notEqual(value, int8Zero); }
+    LValue isZero32(LValue value) { return equal(value, int32Zero); }
+    LValue notZero32(LValue value) { return notEqual(value, int32Zero); }
     LValue isZero64(LValue value) { return equal(value, int64Zero); }
     LValue notZero64(LValue value) { return notEqual(value, int64Zero); }
     
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to