Bug 678239: implement JSOP_SETARG, r=dvander
authorHannes Verschore <hverschore@mozilla.com>
Fri, 12 Aug 2011 14:10:15 -0700
changeset 108719 f82e7d7508f8d11b8fbaecfe769a965f48a25053
parent 108718 e8ce2d102fdaacf14c0418bac846494f846807d0
child 108720 f7076b6bc9c91496facb3174e29de9263f7b6589
push id2248
push userakeybl@mozilla.com
push dateMon, 08 Oct 2012 19:23:44 +0000
treeherdermozilla-aurora@118a3b748323 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdvander
bugs678239
milestone8.0a1
Bug 678239: implement JSOP_SETARG, r=dvander
js/src/ion/IonBuilder.cpp
js/src/jit-test/tests/ion/bug678239-1.js
js/src/jit-test/tests/ion/bug678239-2.js
--- a/js/src/ion/IonBuilder.cpp
+++ b/js/src/ion/IonBuilder.cpp
@@ -412,16 +412,20 @@ IonBuilder::inspectOpcode(JSOp op)
 
       case JSOP_TRUE:
         return pushConstant(BooleanValue(true));
 
       case JSOP_GETARG:
         current->pushArg(GET_SLOTNO(pc));
         return true;
 
+      case JSOP_SETARG:
+        current->setArg(GET_SLOTNO(pc));
+        return true;
+
       case JSOP_GETLOCAL:
         current->pushLocal(GET_SLOTNO(pc));
         return true;
 
       case JSOP_SETLOCAL:
         return current->setLocal(GET_SLOTNO(pc));
 
       case JSOP_POP:
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/ion/bug678239-1.js
@@ -0,0 +1,5 @@
+function f(x) {
+    x = x + 1;
+    return x;
+}
+assertEq(f(3), 4)
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/ion/bug678239-2.js
@@ -0,0 +1,7 @@
+function f(x, y, z) {
+    if (1)
+        x = z;
+    return x + y;
+}
+
+assertEq(f(0, 2, {}), "[object Object]2")