Bug 942804 - Ion-compile scripts with unaliased let bindings. r=jandem
authorAndy Wingo <wingo@igalia.com>
Wed, 18 Dec 2013 14:45:09 +0100
changeset 161063 eb804b2f1e96143679429718abb989bbcd824b8f
parent 161062 3735493e9aa896d01237d2f53532a8be3f107309
child 161064 44ba76de09549fb137c09ec10e28baaea377df13
push id25866
push userryanvm@gmail.com
push dateThu, 19 Dec 2013 02:15:01 +0000
treeherdermozilla-central@940c52e93281 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs942804
milestone29.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 942804 - Ion-compile scripts with unaliased let bindings. r=jandem
js/src/jit-test/tests/basic/expression-autopsy.js
js/src/jit/IonBuilder.cpp
--- a/js/src/jit-test/tests/basic/expression-autopsy.js
+++ b/js/src/jit-test/tests/basic/expression-autopsy.js
@@ -41,25 +41,39 @@ function check(expr, expected=expr) {
             // Let block
             Function("let (o, undef) { " + statement + " }"),
             // Let block with some other variables
             Function("var v1, v2; let (o, undef) { " + statement + " }"),
             // Shadowed let block
             Function("o", "undef", "let (o, undef) { " + statement + " }"),
             // Let in a switch
             Function("var x = 4; switch (x) { case 4: let o, undef;" + statement + "\ncase 6: break;}"),
-            // Let in for-in
-            Function("var undef, o; for (let z in [1, 2]) { " + statement + " }"),
             // The more lets the merrier
             Function("let (x=4, y=5) { x + y; }\nlet (a, b, c) { a + b - c; }\nlet (o, undef) {" + statement + " }"),
             // Let destructuring
             Function("o", "undef", "let ([] = 4) {} let (o, undef) { " + statement + " }"),
             // Try-catch blocks
             Function("o", "undef", "try { let q = 4; try { let p = 4; } catch (e) {} } catch (e) {} let (o, undef) { " + statement + " }")
         ];
+
+        try {
+            // Let in for-in
+            check_one(expected,
+                      Function("var undef, o; for (let z in [1, 2]) { " + statement + " }"),
+                      err);
+        } catch (ex) {
+            // Bug 831120.  See bug 942804 comment 5.
+            if (expected == 'undef' && err == ' is undefined')
+                check_one(expected + end,
+                          Function("var undef, o; for (let z in [1, 2]) { " + statement + " }"),
+                          err);
+            else
+                throw ex;
+        }
+
         for (var f of cases) {
             check_one(expected, f, err);
         }
     }
 }
 
 check("undef");
 check("o.b");
--- a/js/src/jit/IonBuilder.cpp
+++ b/js/src/jit/IonBuilder.cpp
@@ -1763,16 +1763,19 @@ IonBuilder::inspectOpcode(JSOp op)
       case JSOP_SETRVAL:
         JS_ASSERT(!script()->noScriptRval());
         current->setSlot(info().returnValueSlot(), current->pop());
         return true;
 
       case JSOP_INSTANCEOF:
         return jsop_instanceof();
 
+      case JSOP_DEBUGLEAVEBLOCK:
+        return true;
+
       default:
 #ifdef DEBUG
         return abort("Unsupported opcode: %s (line %d)", js_CodeName[op], info().lineno(pc));
 #else
         return abort("Unsupported opcode: %d (line %d)", op, info().lineno(pc));
 #endif
     }
 }