Title: [112013] trunk/Source/_javascript_Core
Revision
112013
Author
[email protected]
Date
2012-03-24 13:15:57 -0700 (Sat, 24 Mar 2012)

Log Message

DFG::Node::shouldNotSpeculateInteger() should be eliminated
https://bugs.webkit.org/show_bug.cgi?id=82123

Reviewed by Geoff Garen.

* dfg/DFGAbstractState.cpp:
(JSC::DFG::AbstractState::execute):
* dfg/DFGNode.h:
(Node):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compilePutByValForByteArray):
(JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (112012 => 112013)


--- trunk/Source/_javascript_Core/ChangeLog	2012-03-24 20:03:28 UTC (rev 112012)
+++ trunk/Source/_javascript_Core/ChangeLog	2012-03-24 20:15:57 UTC (rev 112013)
@@ -1,3 +1,18 @@
+2012-03-24  Filip Pizlo  <[email protected]>
+
+        DFG::Node::shouldNotSpeculateInteger() should be eliminated
+        https://bugs.webkit.org/show_bug.cgi?id=82123
+
+        Reviewed by Geoff Garen.
+
+        * dfg/DFGAbstractState.cpp:
+        (JSC::DFG::AbstractState::execute):
+        * dfg/DFGNode.h:
+        (Node):
+        * dfg/DFGSpeculativeJIT.cpp:
+        (JSC::DFG::SpeculativeJIT::compilePutByValForByteArray):
+        (JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray):
+
 2012-03-24  Yong Li  <[email protected]>
 
         Increase getByIdSlowCase ConstantSpace/InstructionSpace for CPU(ARM_TRADITIONAL)

Modified: trunk/Source/_javascript_Core/dfg/DFGAbstractState.cpp (112012 => 112013)


--- trunk/Source/_javascript_Core/dfg/DFGAbstractState.cpp	2012-03-24 20:03:28 UTC (rev 112012)
+++ trunk/Source/_javascript_Core/dfg/DFGAbstractState.cpp	2012-03-24 20:15:57 UTC (rev 112013)
@@ -352,7 +352,8 @@
     case ArithMul:
     case ArithDiv:
     case ArithMin:
-    case ArithMax: {
+    case ArithMax:
+    case ArithMod: {
         if (Node::shouldSpeculateInteger(m_graph[node.child1()], m_graph[node.child2()]) && node.canSpeculateInteger()) {
             forNode(node.child1()).filter(PredictInt32);
             forNode(node.child2()).filter(PredictInt32);
@@ -365,19 +366,6 @@
         break;
     }
             
-    case ArithMod: {
-        if (m_graph[node.child1()].shouldNotSpeculateInteger() || m_graph[node.child2()].shouldNotSpeculateInteger() || !node.canSpeculateInteger()) {
-            forNode(node.child1()).filter(PredictNumber);
-            forNode(node.child2()).filter(PredictNumber);
-            forNode(nodeIndex).set(PredictDouble);
-            break;
-        }
-        forNode(node.child1()).filter(PredictInt32);
-        forNode(node.child2()).filter(PredictInt32);
-        forNode(nodeIndex).set(PredictInt32);
-        break;
-    }
-            
     case ArithAbs:
         if (m_graph[node.child1()].shouldSpeculateInteger() && node.canSpeculateInteger()) {
             forNode(node.child1()).filter(PredictInt32);
@@ -555,50 +543,74 @@
         if (m_graph[node.child1()].shouldSpeculateByteArray()) {
             forNode(node.child1()).filter(PredictByteArray);
             forNode(node.child2()).filter(PredictInt32);
-            forNode(node.child3()).filter(PredictNumber);
+            if (m_graph[node.child3()].shouldSpeculateInteger())
+                forNode(node.child3()).filter(PredictInt32);
+            else
+                forNode(node.child3()).filter(PredictNumber);
             break;
         }
         
         if (m_graph[node.child1()].shouldSpeculateInt8Array()) {
             forNode(node.child1()).filter(PredictInt8Array);
             forNode(node.child2()).filter(PredictInt32);
-            forNode(node.child3()).filter(PredictNumber);
+            if (m_graph[node.child3()].shouldSpeculateInteger())
+                forNode(node.child3()).filter(PredictInt32);
+            else
+                forNode(node.child3()).filter(PredictNumber);
             break;
         }
         if (m_graph[node.child1()].shouldSpeculateInt16Array()) {
             forNode(node.child1()).filter(PredictInt16Array);
             forNode(node.child2()).filter(PredictInt32);
-            forNode(node.child3()).filter(PredictNumber);
+            if (m_graph[node.child3()].shouldSpeculateInteger())
+                forNode(node.child3()).filter(PredictInt32);
+            else
+                forNode(node.child3()).filter(PredictNumber);
             break;
         }
         if (m_graph[node.child1()].shouldSpeculateInt32Array()) {
             forNode(node.child1()).filter(PredictInt32Array);
             forNode(node.child2()).filter(PredictInt32);
-            forNode(node.child3()).filter(PredictNumber);
+            if (m_graph[node.child3()].shouldSpeculateInteger())
+                forNode(node.child3()).filter(PredictInt32);
+            else
+                forNode(node.child3()).filter(PredictNumber);
             break;
         }
         if (m_graph[node.child1()].shouldSpeculateUint8Array()) {
             forNode(node.child1()).filter(PredictUint8Array);
             forNode(node.child2()).filter(PredictInt32);
-            forNode(node.child3()).filter(PredictNumber);
+            if (m_graph[node.child3()].shouldSpeculateInteger())
+                forNode(node.child3()).filter(PredictInt32);
+            else
+                forNode(node.child3()).filter(PredictNumber);
             break;
         }
         if (m_graph[node.child1()].shouldSpeculateUint8ClampedArray()) {
             forNode(node.child1()).filter(PredictUint8ClampedArray);
             forNode(node.child2()).filter(PredictInt32);
-            forNode(node.child3()).filter(PredictNumber);
+            if (m_graph[node.child3()].shouldSpeculateInteger())
+                forNode(node.child3()).filter(PredictInt32);
+            else
+                forNode(node.child3()).filter(PredictNumber);
             break;
         }
         if (m_graph[node.child1()].shouldSpeculateUint16Array()) {
             forNode(node.child1()).filter(PredictUint16Array);
             forNode(node.child2()).filter(PredictInt32);
-            forNode(node.child3()).filter(PredictNumber);
+            if (m_graph[node.child3()].shouldSpeculateInteger())
+                forNode(node.child3()).filter(PredictInt32);
+            else
+                forNode(node.child3()).filter(PredictNumber);
             break;
         }
         if (m_graph[node.child1()].shouldSpeculateUint32Array()) {
             forNode(node.child1()).filter(PredictUint32Array);
             forNode(node.child2()).filter(PredictInt32);
-            forNode(node.child3()).filter(PredictNumber);
+            if (m_graph[node.child3()].shouldSpeculateInteger())
+                forNode(node.child3()).filter(PredictInt32);
+            else
+                forNode(node.child3()).filter(PredictNumber);
             break;
         }
         if (m_graph[node.child1()].shouldSpeculateFloat32Array()) {

Modified: trunk/Source/_javascript_Core/dfg/DFGNode.h (112012 => 112013)


--- trunk/Source/_javascript_Core/dfg/DFGNode.h	2012-03-24 20:03:28 UTC (rev 112012)
+++ trunk/Source/_javascript_Core/dfg/DFGNode.h	2012-03-24 20:15:57 UTC (rev 112013)
@@ -679,11 +679,6 @@
         return isNumberPrediction(prediction());
     }
     
-    bool shouldNotSpeculateInteger()
-    {
-        return !!(prediction() & PredictDouble);
-    }
-    
     bool shouldSpeculateBoolean()
     {
         return isBooleanPrediction(prediction());

Modified: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp (112012 => 112013)


--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp	2012-03-24 20:03:28 UTC (rev 112012)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp	2012-03-24 20:15:57 UTC (rev 112013)
@@ -1749,7 +1749,7 @@
         m_jit.move(Imm32(clampedValue), scratchReg);
         value.adopt(scratch);
         valueGPR = scratchReg;
-    } else if (!at(valueUse).shouldNotSpeculateInteger()) {
+    } else if (at(valueUse).shouldSpeculateInteger()) {
         SpeculateIntegerOperand valueOp(this, valueUse);
         GPRTemporary scratch(this);
         GPRReg scratchReg = scratch.gpr();
@@ -1912,7 +1912,7 @@
         m_jit.move(Imm32(static_cast<int>(d)), scratchReg);
         value.adopt(scratch);
         valueGPR = scratchReg;
-    } else if (!at(valueUse).shouldNotSpeculateInteger()) {
+    } else if (at(valueUse).shouldSpeculateInteger()) {
         SpeculateIntegerOperand valueOp(this, valueUse);
         GPRTemporary scratch(this);
         GPRReg scratchReg = scratch.gpr();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to