[INFER] Have DUP/DUP2 propagate correct SSA values. r=bhackett
authorShu-yu Guo <shu@rfrn.org>
Wed, 10 Aug 2011 12:30:34 -0700
changeset 76113 3cf701fb5962e3734bdc435d42222b8782517e04
parent 76112 165394ec34afc3e32093990d85807638ebeefd4d
child 76114 b99f3928f69cf0b177ca08d86122f34a2f1a7ece
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersbhackett
milestone8.0a1
[INFER] Have DUP/DUP2 propagate correct SSA values. r=bhackett
js/src/jsanalyze.cpp
--- a/js/src/jsanalyze.cpp
+++ b/js/src/jsanalyze.cpp
@@ -1592,16 +1592,25 @@ ScriptAnalysis::analyzeSSA(JSContext *cx
           case JSOP_INITMETHOD:
             stack[stackDepth - 1] = code->poppedValues[1];
             break;
 
           case JSOP_INITELEM:
             stack[stackDepth - 1] = code->poppedValues[2];
             break;
 
+          case JSOP_DUP:
+            stack[stackDepth - 1] = stack[stackDepth - 2] = code->poppedValues[0];
+            break;
+
+          case JSOP_DUP2:
+            stack[stackDepth - 1] = stack[stackDepth - 3] = code->poppedValues[0];
+            stack[stackDepth - 2] = stack[stackDepth - 4] = code->poppedValues[1];
+            break;
+
           case JSOP_SWAP:
             /* Swap is like pick 1. */
           case JSOP_PICK: {
             unsigned pickedDepth = (op == JSOP_SWAP ? 1 : pc[1]);
             stack[stackDepth - 1] = code->poppedValues[pickedDepth];
             for (unsigned i = 0; i < pickedDepth; i++)
                 stack[stackDepth - 2 - i] = code->poppedValues[i];
             break;