Title: [90533] trunk/Source/_javascript_Core
Revision
90533
Author
[email protected]
Date
2011-07-06 21:04:29 -0700 (Wed, 06 Jul 2011)

Log Message

2011-07-06  Filip Pizlo  <[email protected]>

        DFG JIT implementation of op_call results in regressions on sunspider
        controlflow-recursive.
        https://bugs.webkit.org/show_bug.cgi?id=64039

        Reviewed by Gavin Barraclough.

        * dfg/DFGByteCodeParser.cpp:
        (JSC::DFG::ByteCodeParser::isSmallInt32Constant):
        (JSC::DFG::ByteCodeParser::parseBlock):
        * dfg/DFGSpeculativeJIT.h:
        (JSC::DFG::SpeculativeJIT::isInteger):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (90532 => 90533)


--- trunk/Source/_javascript_Core/ChangeLog	2011-07-07 03:55:20 UTC (rev 90532)
+++ trunk/Source/_javascript_Core/ChangeLog	2011-07-07 04:04:29 UTC (rev 90533)
@@ -1,5 +1,19 @@
 2011-07-06  Filip Pizlo  <[email protected]>
 
+        DFG JIT implementation of op_call results in regressions on sunspider
+        controlflow-recursive.
+        https://bugs.webkit.org/show_bug.cgi?id=64039
+
+        Reviewed by Gavin Barraclough.
+
+        * dfg/DFGByteCodeParser.cpp:
+        (JSC::DFG::ByteCodeParser::isSmallInt32Constant):
+        (JSC::DFG::ByteCodeParser::parseBlock):
+        * dfg/DFGSpeculativeJIT.h:
+        (JSC::DFG::SpeculativeJIT::isInteger):
+
+2011-07-06  Filip Pizlo  <[email protected]>
+
         DFG JIT does not support method_check
         https://bugs.webkit.org/show_bug.cgi?id=63972
 

Modified: trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp (90532 => 90533)


--- trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp	2011-07-07 03:55:20 UTC (rev 90532)
+++ trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp	2011-07-07 04:04:29 UTC (rev 90533)
@@ -254,6 +254,16 @@
     {
         return isJSConstant(nodeIndex) && valueOfJSConstant(nodeIndex).isInt32();
     }
+    bool isSmallInt32Constant(NodeIndex nodeIndex)
+    {
+        if (!isJSConstant(nodeIndex))
+            return false;
+        JSValue value = valueOfJSConstant(nodeIndex);
+        if (!value.isInt32())
+            return false;
+        int32_t intValue = value.asInt32();
+        return intValue >= -5 && intValue <= 5;
+    }
     bool isDoubleConstant(NodeIndex nodeIndex)
     {
         return isJSConstant(nodeIndex) && valueOfJSConstant(nodeIndex).isNumber();
@@ -675,9 +685,13 @@
             NodeIndex op2 = get(currentInstruction[3].u.operand);
             // If both operands can statically be determined to the numbers, then this is an arithmetic add.
             // Otherwise, we must assume this may be performing a concatenation to a string.
-            if (m_graph[op1].hasNumericResult() && m_graph[op2].hasNumericResult())
+            if (m_graph[op1].hasNumericResult() && m_graph[op2].hasNumericResult()) {
+                if (isSmallInt32Constant(op1) || isSmallInt32Constant(op2)) {
+                    predictInt32(op1);
+                    predictInt32(op2);
+                }
                 set(currentInstruction[1].u.operand, addToGraph(ArithAdd, toNumber(op1), toNumber(op2)));
-            else
+            } else
                 set(currentInstruction[1].u.operand, addToGraph(ValueAdd, op1, op2));
             NEXT_OPCODE(op_add);
         }
@@ -686,6 +700,10 @@
             ARITHMETIC_OP();
             NodeIndex op1 = getToNumber(currentInstruction[2].u.operand);
             NodeIndex op2 = getToNumber(currentInstruction[3].u.operand);
+            if (isSmallInt32Constant(op1) || isSmallInt32Constant(op2)) {
+                predictInt32(op1);
+                predictInt32(op2);
+            }
             set(currentInstruction[1].u.operand, addToGraph(ArithSub, op1, op2));
             NEXT_OPCODE(op_sub);
         }

Modified: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.h (90532 => 90533)


--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.h	2011-07-07 03:55:20 UTC (rev 90532)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.h	2011-07-07 04:04:29 UTC (rev 90533)
@@ -166,8 +166,9 @@
 
         VirtualRegister virtualRegister = node.virtualRegister();
         GenerationInfo& info = m_generationInfo[virtualRegister];
-
-        return (info.registerFormat() | DataFormatJS) == DataFormatJSInteger;
+        
+        return (info.registerFormat() | DataFormatJS) == DataFormatJSInteger
+            || (info.spillFormat() | DataFormatJS) == DataFormatJSInteger;
     }
 
     bool isDataFormatDouble(NodeIndex nodeIndex)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to