Backed out changeset 8756a6262190 (bug 1357075)
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Wed, 10 May 2017 13:01:25 +0200
changeset 357486 fee1367bc91ba936df64265fadb795cef6bd67e4
parent 357485 dc3008e45ba6cf5130eec89598fd51d1e6bbbc27
child 357487 11f3f002c7f4b8bc55678ddf9a902d8d36e1015b
push id31792
push usercbook@mozilla.com
push dateWed, 10 May 2017 13:07:59 +0000
treeherdermozilla-central@ebbcdaa5b580 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1357075
milestone55.0a1
backs out8756a6262190bdd3945a873f80c6aadd41da3aad
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
Backed out changeset 8756a6262190 (bug 1357075)
js/src/frontend/BytecodeEmitter.cpp
js/src/jit-test/tests/parser/bug-1357075.js
js/src/vm/Interpreter.cpp
js/src/vm/Opcodes.h
--- a/js/src/frontend/BytecodeEmitter.cpp
+++ b/js/src/frontend/BytecodeEmitter.cpp
@@ -5465,24 +5465,16 @@ BytecodeEmitter::emitIteratorClose(Itera
 }
 
 template <typename InnerEmitter>
 bool
 BytecodeEmitter::wrapWithDestructuringIteratorCloseTryNote(int32_t iterDepth, InnerEmitter emitter)
 {
     MOZ_ASSERT(this->stackDepth >= iterDepth);
 
-    // Pad a nop at the beginning of the bytecode covered by the trynote so
-    // that when unwinding environments, we may unwind to the scope
-    // corresponding to the pc *before* the start, in case the first bytecode
-    // emitted by |emitter| is the start of an inner scope. See comment above
-    // UnwindEnvironmentToTryPc.
-    if (!emit1(JSOP_TRY_DESTRUCTURING_ITERCLOSE))
-        return false;
-
     ptrdiff_t start = offset();
     if (!emitter(this))
         return false;
     ptrdiff_t end = offset();
     if (start != end)
         return tryNoteList.append(JSTRY_DESTRUCTURING_ITERCLOSE, iterDepth, start, end);
     return true;
 }
deleted file mode 100644
--- a/js/src/jit-test/tests/parser/bug-1357075.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// |jit-test| error: TypeError
-
-var iterable = {};
-var iterator = {
-  return: 1
-};
-iterable[Symbol.iterator] = function() {
-  return iterator;
-};
-for ([ class get {} ().iterator ] of [iterable]) {}
--- a/js/src/vm/Interpreter.cpp
+++ b/js/src/vm/Interpreter.cpp
@@ -1093,19 +1093,16 @@ js::UnwindAllEnvironmentsInFrame(JSConte
 // let block scope.
 jsbytecode*
 js::UnwindEnvironmentToTryPc(JSScript* script, JSTryNote* tn)
 {
     jsbytecode* pc = script->main() + tn->start;
     if (tn->kind == JSTRY_CATCH || tn->kind == JSTRY_FINALLY) {
         pc -= JSOP_TRY_LENGTH;
         MOZ_ASSERT(*pc == JSOP_TRY);
-    } else if (tn->kind == JSTRY_DESTRUCTURING_ITERCLOSE) {
-        pc -= JSOP_TRY_DESTRUCTURING_ITERCLOSE_LENGTH;
-        MOZ_ASSERT(*pc == JSOP_TRY_DESTRUCTURING_ITERCLOSE);
     }
     return pc;
 }
 
 static bool
 ForcedReturn(JSContext* cx, EnvironmentIter& ei, InterpreterRegs& regs, bool frameOk = true)
 {
     bool ok = Debugger::onLeaveFrame(cx, regs.fp(), regs.pc, frameOk);
@@ -1936,17 +1933,17 @@ CASE(EnableInterruptsPseudoOpcode)
     /* Commence executing the actual opcode. */
     SANITY_CHECKS();
     DISPATCH_TO(op);
 }
 
 /* Various 1-byte no-ops. */
 CASE(JSOP_NOP)
 CASE(JSOP_NOP_DESTRUCTURING)
-CASE(JSOP_TRY_DESTRUCTURING_ITERCLOSE)
+CASE(JSOP_UNUSED220)
 CASE(JSOP_UNUSED221)
 CASE(JSOP_UNUSED222)
 CASE(JSOP_UNUSED223)
 CASE(JSOP_CONDSWITCH)
 {
     MOZ_ASSERT(CodeSpec[*REGS.pc].length == 1);
     ADVANCE_AND_DISPATCH(1);
 }
--- a/js/src/vm/Opcodes.h
+++ b/js/src/vm/Opcodes.h
@@ -2246,26 +2246,17 @@ 1234567890123456789012345678901234567890
      * TypeError if not. The operand 'kind' is used only to generate an
      * appropriate error message.
      *   Category: Statements
      *   Type: Function
      *   Operands: uint8_t kind
      *   Stack: obj => obj
      */ \
     macro(JSOP_CHECKISCALLABLE, 219, "checkiscallable", NULL, 2, 1, 1, JOF_UINT8) \
-    \
-    /*
-     * No-op used by the exception unwinder to determine the correct
-     * environment to unwind to when performing IteratorClose due to
-     * destructuring.
-     *   Category: Other
-     *   Operands:
-     *   Stack: =>
-     */ \
-    macro(JSOP_TRY_DESTRUCTURING_ITERCLOSE, 220, "try-destructuring-iterclose", NULL, 1, 0, 0, JOF_BYTE) \
+    macro(JSOP_UNUSED220,     220,"unused220",     NULL,  1,  0,  0,  JOF_BYTE) \
     macro(JSOP_UNUSED221,     221,"unused221",     NULL,  1,  0,  0,  JOF_BYTE) \
     macro(JSOP_UNUSED222,     222,"unused222",     NULL,  1,  0,  0,  JOF_BYTE) \
     macro(JSOP_UNUSED223,     223,"unused223",     NULL,  1,  0,  0,  JOF_BYTE) \
     \
     /*
      * Creates rest parameter array for current function call, and pushes it
      * onto the stack.
      *   Category: Variables and Scopes