Bug 1143704 part 4 - Turn Emit1 into a BytecodeEmitter method. r=bhackett
authorJan de Mooij <jdemooij@mozilla.com>
Sat, 21 Mar 2015 12:54:09 +0100
changeset 263763 bf65c34bb34fab7771aefd9a0e656eef4d6952a4
parent 263762 a5b865279726ba669d0056280880ab8014807a3e
child 263764 19f500bbb3dc611595c0ad289b36eb285800f6c6
push id4718
push userraliiev@mozilla.com
push dateMon, 11 May 2015 18:39:53 +0000
treeherdermozilla-beta@c20c4ef55f08 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbhackett
bugs1143704
milestone39.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 1143704 part 4 - Turn Emit1 into a BytecodeEmitter method. r=bhackett
js/src/frontend/BytecodeCompiler.cpp
js/src/frontend/BytecodeEmitter.cpp
js/src/frontend/BytecodeEmitter.h
--- a/js/src/frontend/BytecodeCompiler.cpp
+++ b/js/src/frontend/BytecodeCompiler.cpp
@@ -425,17 +425,17 @@ frontend::CompileScript(ExclusiveContext
         if (!ss->setSourceMapURL(cx, options.sourceMapURL()))
             return nullptr;
     }
 
     /*
      * Nowadays the threaded interpreter needs a last return instruction, so we
      * do have to emit that here.
      */
-    if (!Emit1(cx, &bce, JSOP_RETRVAL))
+    if (!bce.emit1(JSOP_RETRVAL))
         return nullptr;
 
     // Global/eval script bindings are always empty (all names are added to the
     // scope dynamically via JSOP_DEFFUN/VAR).  They may have block-scoped
     // locals, however, which are allocated to the fixed part of the stack
     // frame.
     InternalHandle<Bindings*> bindings(script, &script->bindings);
     if (!Bindings::initWithTemporaryStorage(cx, bindings, 0, 0, 0,
--- a/js/src/frontend/BytecodeEmitter.cpp
+++ b/js/src/frontend/BytecodeEmitter.cpp
@@ -251,26 +251,26 @@ CheckStrictOrSloppy(BytecodeEmitter *bce
         return false;
     if (IsCheckSloppyOp(op) && bce->sc->strict())
         return false;
     return true;
 }
 #endif
 
 bool
-frontend::Emit1(ExclusiveContext *cx, BytecodeEmitter *bce, JSOp op)
-{
-    MOZ_ASSERT(CheckStrictOrSloppy(bce, op));
-    ptrdiff_t offset = EmitCheck(cx, bce, 1);
+BytecodeEmitter::emit1(JSOp op)
+{
+    MOZ_ASSERT(CheckStrictOrSloppy(this, op));
+    ptrdiff_t offset = EmitCheck(sc->context, this, 1);
     if (offset < 0)
         return false;
 
-    jsbytecode *code = bce->code(offset);
+    jsbytecode *code = this->code(offset);
     code[0] = jsbytecode(op);
-    UpdateDepth(cx, bce, offset);
+    UpdateDepth(sc->context, this, offset);
     return true;
 }
 
 bool
 frontend::Emit2(ExclusiveContext *cx, BytecodeEmitter *bce, JSOp op, jsbytecode op1)
 {
     MOZ_ASSERT(CheckStrictOrSloppy(bce, op));
     ptrdiff_t offset = EmitCheck(cx, bce, 2);
@@ -511,17 +511,17 @@ EmitLoopHead(ExclusiveContext *cx, Bytec
          */
         MOZ_ASSERT_IF(nextpn->isKind(PNK_STATEMENTLIST), nextpn->isArity(PN_LIST));
         if (nextpn->isKind(PNK_STATEMENTLIST) && nextpn->pn_head)
             nextpn = nextpn->pn_head;
         if (!UpdateSourceCoordNotes(cx, bce, nextpn->pn_pos.begin))
             return false;
     }
 
-    return Emit1(cx, bce, JSOP_LOOPHEAD);
+    return bce->emit1(JSOP_LOOPHEAD);
 }
 
 static bool
 EmitLoopEntry(ExclusiveContext *cx, BytecodeEmitter *bce, ParseNode *nextpn)
 {
     if (nextpn) {
         /* Update the line number, as for LOOPHEAD. */
         MOZ_ASSERT_IF(nextpn->isKind(PNK_STATEMENTLIST), nextpn->isArity(PN_LIST));
@@ -572,17 +572,17 @@ FlushPops(ExclusiveContext *cx, Bytecode
     EMIT_UINT16_IMM_OP(JSOP_POPN, *npops);
     *npops = 0;
     return true;
 }
 
 static bool
 PopIterator(ExclusiveContext *cx, BytecodeEmitter *bce)
 {
-    return Emit1(cx, bce, JSOP_ENDITER);
+    return bce->emit1(JSOP_ENDITER);
 }
 
 namespace {
 
 class NonLocalExitScope {
     ExclusiveContext *cx;
     BytecodeEmitter *bce;
     const uint32_t savedScopeIndex;
@@ -644,17 +644,17 @@ NonLocalExitScope::prepareForNonLocalJum
         switch (stmt->type) {
           case STMT_FINALLY:
             FLUSH_POPS();
             if (!EmitBackPatchOp(cx, bce, &stmt->gosubs()))
                 return false;
             break;
 
           case STMT_WITH:
-            if (!Emit1(cx, bce, JSOP_LEAVEWITH))
+            if (!bce->emit1(JSOP_LEAVEWITH))
                 return false;
             MOZ_ASSERT(stmt->isNestedScope);
             if (!popScopeForNonLocalExit(stmt->blockScopeIndex))
                 return false;
             break;
 
           case STMT_FOR_OF_LOOP:
             npops += 2;
@@ -681,22 +681,22 @@ NonLocalExitScope::prepareForNonLocalJum
             break;
 
           default:;
         }
 
         if (stmt->isBlockScope) {
             MOZ_ASSERT(stmt->isNestedScope);
             StaticBlockObject &blockObj = stmt->staticBlock();
-            if (!Emit1(cx, bce, JSOP_DEBUGLEAVEBLOCK))
+            if (!bce->emit1(JSOP_DEBUGLEAVEBLOCK))
                 return false;
             if (!popScopeForNonLocalExit(stmt->blockScopeIndex))
                 return false;
             if (blockObj.needsClone()) {
-                if (!Emit1(cx, bce, JSOP_POPBLOCKSCOPE))
+                if (!bce->emit1(JSOP_POPBLOCKSCOPE))
                     return false;
             }
         }
     }
 
     FLUSH_POPS();
     return true;
 
@@ -1021,23 +1021,23 @@ LeaveNestedScope(ExclusiveContext *cx, B
     MOZ_ASSERT(stmt->staticScope == staticScope);
     MOZ_ASSERT(staticScope == bce->staticScope);
     MOZ_ASSERT_IF(!stmt->isBlockScope, staticScope->is<StaticWithObject>());
 #endif
 
     if (!PopStatementBCE(cx, bce))
         return false;
 
-    if (!Emit1(cx, bce, stmt->isBlockScope ? JSOP_DEBUGLEAVEBLOCK : JSOP_LEAVEWITH))
+    if (!bce->emit1(stmt->isBlockScope ? JSOP_DEBUGLEAVEBLOCK : JSOP_LEAVEWITH))
         return false;
 
     bce->blockScopeList.recordEnd(blockScopeIndex, bce->offset());
 
     if (stmt->isBlockScope && stmt->staticScope->as<StaticBlockObject>().needsClone()) {
-        if (!Emit1(cx, bce, JSOP_POPBLOCKSCOPE))
+        if (!bce->emit1(JSOP_POPBLOCKSCOPE))
             return false;
     }
 
     return true;
 }
 
 static bool
 EmitIndex32(ExclusiveContext *cx, JSOp op, uint32_t index, BytecodeEmitter *bce)
@@ -1449,27 +1449,27 @@ EmitVarIncDec(ExclusiveContext *cx, Pars
         setOp = JSOP_SETARG;
     } else {
         getOp = JSOP_GETALIASEDVAR;
         setOp = JSOP_SETALIASEDVAR;
     }
 
     if (!EmitVarOp(cx, pn->pn_kid, getOp, bce))              // V
         return false;
-    if (!Emit1(cx, bce, JSOP_POS))                           // N
-        return false;
-    if (post && !Emit1(cx, bce, JSOP_DUP))                   // N? N
-        return false;
-    if (!Emit1(cx, bce, JSOP_ONE))                           // N? N 1
-        return false;
-    if (!Emit1(cx, bce, binop))                              // N? N+1
+    if (!bce->emit1(JSOP_POS))                               // N
+        return false;
+    if (post && !bce->emit1(JSOP_DUP))                       // N? N
+        return false;
+    if (!bce->emit1(JSOP_ONE))                               // N? N 1
+        return false;
+    if (!bce->emit1(binop))                                  // N? N+1
         return false;
     if (!EmitVarOp(cx, pn->pn_kid, setOp, bce))              // N? N+1
         return false;
-    if (post && !Emit1(cx, bce, JSOP_POP))                   // RESULT
+    if (post && !bce->emit1(JSOP_POP))                       // RESULT
         return false;
 
     return true;
 }
 
 bool
 BytecodeEmitter::isAliasedName(ParseNode *pn)
 {
@@ -2297,33 +2297,33 @@ EmitFinishIteratorResult(ExclusiveContex
     if (!bce->makeAtomIndex(cx->names().value, &value_id))
         return false;
     jsatomid done_id;
     if (!bce->makeAtomIndex(cx->names().done, &done_id))
         return false;
 
     if (!EmitIndex32(cx, JSOP_INITPROP, value_id, bce))
         return false;
-    if (!Emit1(cx, bce, done ? JSOP_TRUE : JSOP_FALSE))
+    if (!bce->emit1(done ? JSOP_TRUE : JSOP_FALSE))
         return false;
     if (!EmitIndex32(cx, JSOP_INITPROP, done_id, bce))
         return false;
     return true;
 }
 
 static bool
 EmitNameOp(ExclusiveContext *cx, BytecodeEmitter *bce, ParseNode *pn, bool callContext)
 {
     if (!BindNameToSlot(cx, bce, pn))
         return false;
 
     JSOp op = pn->getOp();
 
     if (op == JSOP_CALLEE) {
-        if (!Emit1(cx, bce, op))
+        if (!bce->emit1(op))
             return false;
     } else {
         if (!pn->pn_cookie.isFree()) {
             MOZ_ASSERT(JOF_OPTYPE(op) != JOF_ATOM);
             if (!EmitVarOp(cx, pn, op, bce))
                 return false;
         } else {
             if (!EmitAtomOp(cx, pn, op, bce))
@@ -2334,17 +2334,17 @@ EmitNameOp(ExclusiveContext *cx, Bytecod
     /* Need to provide |this| value for call */
     if (callContext) {
         if (op == JSOP_GETNAME) {
             JSOp thisOp =
                 bce->needsImplicitThis() ? JSOP_IMPLICITTHIS : JSOP_GIMPLICITTHIS;
             if (!EmitAtomOp(cx, pn, thisOp, bce))
                 return false;
         } else {
-            if (!Emit1(cx, bce, JSOP_UNDEFINED))
+            if (!bce->emit1(JSOP_UNDEFINED))
                 return false;
         }
     }
 
     return true;
 }
 
 static bool
@@ -2398,63 +2398,63 @@ EmitPropLHS(ExclusiveContext *cx, ParseN
 static bool
 EmitPropOp(ExclusiveContext *cx, ParseNode *pn, JSOp op, BytecodeEmitter *bce)
 {
     MOZ_ASSERT(pn->isArity(PN_NAME));
 
     if (!EmitPropLHS(cx, pn, op, bce))
         return false;
 
-    if (op == JSOP_CALLPROP && !Emit1(cx, bce, JSOP_DUP))
+    if (op == JSOP_CALLPROP && !bce->emit1(JSOP_DUP))
         return false;
 
     if (!EmitAtomOp(cx, pn, op, bce))
         return false;
 
-    if (op == JSOP_CALLPROP && !Emit1(cx, bce, JSOP_SWAP))
+    if (op == JSOP_CALLPROP && !bce->emit1(JSOP_SWAP))
         return false;
 
     return true;
 }
 
 static bool
 EmitPropIncDec(ExclusiveContext *cx, ParseNode *pn, BytecodeEmitter *bce)
 {
     MOZ_ASSERT(pn->pn_kid->getKind() == PNK_DOT);
 
     bool post;
     JSOp binop = GetIncDecInfo(pn->getKind(), &post);
 
     JSOp get = JSOP_GETPROP;
     if (!EmitPropLHS(cx, pn->pn_kid, get, bce))     // OBJ
         return false;
-    if (!Emit1(cx, bce, JSOP_DUP))                  // OBJ OBJ
+    if (!bce->emit1(JSOP_DUP))                      // OBJ OBJ
         return false;
     if (!EmitAtomOp(cx, pn->pn_kid, JSOP_GETPROP, bce)) // OBJ V
         return false;
-    if (!Emit1(cx, bce, JSOP_POS))                  // OBJ N
-        return false;
-    if (post && !Emit1(cx, bce, JSOP_DUP))          // OBJ N? N
-        return false;
-    if (!Emit1(cx, bce, JSOP_ONE))                  // OBJ N? N 1
-        return false;
-    if (!Emit1(cx, bce, binop))                     // OBJ N? N+1
+    if (!bce->emit1(JSOP_POS))                      // OBJ N
+        return false;
+    if (post && !bce->emit1(JSOP_DUP))              // OBJ N? N
+        return false;
+    if (!bce->emit1(JSOP_ONE))                      // OBJ N? N 1
+        return false;
+    if (!bce->emit1(binop))                         // OBJ N? N+1
         return false;
 
     if (post) {
         if (!Emit2(cx, bce, JSOP_PICK, (jsbytecode)2))      // N? N+1 OBJ
             return false;
-        if (!Emit1(cx, bce, JSOP_SWAP))                     // N? OBJ N+1
+        if (!bce->emit1(JSOP_SWAP))                 // N? OBJ N+1
             return false;
     }
 
     JSOp setOp = bce->sc->strict() ? JSOP_STRICTSETPROP : JSOP_SETPROP;
     if (!EmitAtomOp(cx, pn->pn_kid, setOp, bce))     // N? N+1
         return false;
-    if (post && !Emit1(cx, bce, JSOP_POP))           // RESULT
+    if (post && !bce->emit1(JSOP_POP))               // RESULT
         return false;
 
     return true;
 }
 
 static bool
 EmitNameIncDec(ExclusiveContext *cx, ParseNode *pn, BytecodeEmitter *bce)
 {
@@ -2463,66 +2463,66 @@ EmitNameIncDec(ExclusiveContext *cx, Par
     bool global = (cs->format & JOF_GNAME);
     bool post;
     JSOp binop = GetIncDecInfo(pn->getKind(), &post);
 
     if (!EmitAtomOp(cx, pn->pn_kid, global ? JSOP_BINDGNAME : JSOP_BINDNAME, bce))  // OBJ
         return false;
     if (!EmitAtomOp(cx, pn->pn_kid, global ? JSOP_GETGNAME : JSOP_GETNAME, bce))    // OBJ V
         return false;
-    if (!Emit1(cx, bce, JSOP_POS))                  // OBJ N
-        return false;
-    if (post && !Emit1(cx, bce, JSOP_DUP))          // OBJ N? N
-        return false;
-    if (!Emit1(cx, bce, JSOP_ONE))                  // OBJ N? N 1
-        return false;
-    if (!Emit1(cx, bce, binop))                     // OBJ N? N+1
+    if (!bce->emit1(JSOP_POS))                      // OBJ N
+        return false;
+    if (post && !bce->emit1(JSOP_DUP))              // OBJ N? N
+        return false;
+    if (!bce->emit1(JSOP_ONE))                      // OBJ N? N 1
+        return false;
+    if (!bce->emit1(binop))                         // OBJ N? N+1
         return false;
 
     if (post) {
         if (!Emit2(cx, bce, JSOP_PICK, (jsbytecode)2))      // N? N+1 OBJ
             return false;
-        if (!Emit1(cx, bce, JSOP_SWAP))                     // N? OBJ N+1
+        if (!bce->emit1(JSOP_SWAP))                         // N? OBJ N+1
             return false;
     }
 
     JSOp setOp = StrictifySetNameOp(global ? JSOP_SETGNAME : JSOP_SETNAME, bce);
     if (!EmitAtomOp(cx, pn->pn_kid, setOp, bce))    // N? N+1
         return false;
-    if (post && !Emit1(cx, bce, JSOP_POP))          // RESULT
+    if (post && !bce->emit1(JSOP_POP))              // RESULT
         return false;
 
     return true;
 }
 
 /*
  * Emit bytecode to put operands for a JSOP_GETELEM/CALLELEM/SETELEM/DELELEM
  * opcode onto the stack in the right order. In the case of SETELEM, the
  * value to be assigned must already be pushed.
  */
 static bool
 EmitElemOperands(ExclusiveContext *cx, ParseNode *pn, JSOp op, BytecodeEmitter *bce)
 {
     MOZ_ASSERT(pn->isArity(PN_BINARY));
     if (!EmitTree(cx, bce, pn->pn_left))
         return false;
-    if (op == JSOP_CALLELEM && !Emit1(cx, bce, JSOP_DUP))
+    if (op == JSOP_CALLELEM && !bce->emit1(JSOP_DUP))
         return false;
     if (!EmitTree(cx, bce, pn->pn_right))
         return false;
     bool isSetElem = op == JSOP_SETELEM || op == JSOP_STRICTSETELEM;
     if (isSetElem && !Emit2(cx, bce, JSOP_PICK, (jsbytecode)2))
         return false;
     return true;
 }
 
 static inline bool
 EmitElemOpBase(ExclusiveContext *cx, BytecodeEmitter *bce, JSOp op)
 {
-    if (!Emit1(cx, bce, op))
+    if (!bce->emit1(op))
         return false;
     CheckTypeSet(cx, bce, op);
     return true;
 }
 
 static bool
 EmitElemOp(ExclusiveContext *cx, ParseNode *pn, JSOp op, BytecodeEmitter *bce)
 {
@@ -2540,62 +2540,62 @@ EmitElemIncDec(ExclusiveContext *cx, Par
     bool post;
     JSOp binop = GetIncDecInfo(pn->getKind(), &post);
 
     /*
      * We need to convert the key to an object id first, so that we do not do
      * it inside both the GETELEM and the SETELEM.
      */
                                                     // OBJ KEY*
-    if (!Emit1(cx, bce, JSOP_TOID))                 // OBJ KEY
-        return false;
-    if (!Emit1(cx, bce, JSOP_DUP2))                 // OBJ KEY OBJ KEY
+    if (!bce->emit1(JSOP_TOID))                     // OBJ KEY
+        return false;
+    if (!bce->emit1(JSOP_DUP2))                     // OBJ KEY OBJ KEY
         return false;
     if (!EmitElemOpBase(cx, bce, JSOP_GETELEM))     // OBJ KEY V
         return false;
-    if (!Emit1(cx, bce, JSOP_POS))                  // OBJ KEY N
-        return false;
-    if (post && !Emit1(cx, bce, JSOP_DUP))          // OBJ KEY N? N
-        return false;
-    if (!Emit1(cx, bce, JSOP_ONE))                  // OBJ KEY N? N 1
-        return false;
-    if (!Emit1(cx, bce, binop))                     // OBJ KEY N? N+1
+    if (!bce->emit1(JSOP_POS))                      // OBJ KEY N
+        return false;
+    if (post && !bce->emit1(JSOP_DUP))              // OBJ KEY N? N
+        return false;
+    if (!bce->emit1(JSOP_ONE))                      // OBJ KEY N? N 1
+        return false;
+    if (!bce->emit1(binop))                         // OBJ KEY N? N+1
         return false;
 
     if (post) {
         if (!Emit2(cx, bce, JSOP_PICK, (jsbytecode)3))   // KEY N N+1 OBJ
             return false;
         if (!Emit2(cx, bce, JSOP_PICK, (jsbytecode)3))   // N N+1 OBJ KEY
             return false;
         if (!Emit2(cx, bce, JSOP_PICK, (jsbytecode)2))   // N OBJ KEY N+1
             return false;
     }
 
     JSOp setOp = bce->sc->strict() ? JSOP_STRICTSETELEM : JSOP_SETELEM;
     if (!EmitElemOpBase(cx, bce, setOp))     // N? N+1
         return false;
-    if (post && !Emit1(cx, bce, JSOP_POP))   // RESULT
+    if (post && !bce->emit1(JSOP_POP))       // RESULT
         return false;
 
     return true;
 }
 
 static bool
 EmitNumberOp(ExclusiveContext *cx, double dval, BytecodeEmitter *bce)
 {
     int32_t ival;
     uint32_t u;
     ptrdiff_t off;
     jsbytecode *pc;
 
     if (NumberIsInt32(dval, &ival)) {
         if (ival == 0)
-            return Emit1(cx, bce, JSOP_ZERO);
+            return bce->emit1(JSOP_ZERO);
         if (ival == 1)
-            return Emit1(cx, bce, JSOP_ONE);
+            return bce->emit1(JSOP_ONE);
         if ((int)(int8_t)ival == ival)
             return Emit2(cx, bce, JSOP_INT8, (jsbytecode)(int8_t)ival);
 
         u = (uint32_t)ival;
         if (u < JS_BIT(16)) {
             EMIT_UINT16_IMM_OP(JSOP_UINT16, u);
         } else if (u < JS_BIT(24)) {
             off = EmitN(cx, bce, JSOP_UINT24, 3);
@@ -2625,17 +2625,17 @@ SetJumpOffsetAt(BytecodeEmitter *bce, pt
     SET_JUMP_OFFSET(bce->code(off), bce->offset() - off);
 }
 
 static bool
 PushInitialConstants(ExclusiveContext *cx, BytecodeEmitter *bce, JSOp op, unsigned n)
 {
     MOZ_ASSERT(op == JSOP_UNDEFINED || op == JSOP_UNINITIALIZED);
     for (unsigned i = 0; i < n; ++i) {
-        if (!Emit1(cx, bce, op))
+        if (!bce->emit1(op))
             return false;
     }
     return true;
 }
 
 static bool
 InitializeBlockScopedLocalsFromStack(ExclusiveContext *cx, BytecodeEmitter *bce,
                                      Handle<StaticBlockObject *> blockObj)
@@ -2652,17 +2652,17 @@ InitializeBlockScopedLocalsFromStack(Exc
             // locals stored in the frame. EmitUnaliasedVarOp expects the slot index
             // to include both unaliased and aliased locals, so we have to add the
             // number of aliased locals.
             uint32_t numAliased = bce->script->bindings.numAliasedBodyLevelLocals();
             unsigned local = blockObj->blockIndexToLocalIndex(i - 1) + numAliased;
             if (!EmitUnaliasedVarOp(cx, JSOP_INITLEXICAL, local, DontCheckLexical, bce))
                 return false;
         }
-        if (!Emit1(cx, bce, JSOP_POP))
+        if (!bce->emit1(JSOP_POP))
             return false;
     }
     return true;
 }
 
 static bool
 EnterBlockScope(ExclusiveContext *cx, BytecodeEmitter *bce, StmtInfoBCE *stmtInfo,
                 ObjectBox *objbox, JSOp initialValueOp, unsigned alreadyPushed = 0)
@@ -3029,17 +3029,17 @@ BytecodeEmitter::isRunOnceLambda()
            !funbox->isGenerator() &&
            !funbox->function()->name();
 }
 
 static bool
 EmitYieldOp(ExclusiveContext *cx, BytecodeEmitter *bce, JSOp op)
 {
     if (op == JSOP_FINALYIELDRVAL)
-        return Emit1(cx, bce, JSOP_FINALYIELDRVAL);
+        return bce->emit1(JSOP_FINALYIELDRVAL);
 
     MOZ_ASSERT(op == JSOP_INITIALYIELD || op == JSOP_YIELD);
 
     ptrdiff_t off = EmitN(cx, bce, op, 3);
     if (off < 0)
         return false;
 
     uint32_t yieldIndex = bce->yieldOffsetList.length();
@@ -3048,17 +3048,17 @@ EmitYieldOp(ExclusiveContext *cx, Byteco
         return false;
     }
 
     SET_UINT24(bce->code(off), yieldIndex);
 
     if (!bce->yieldOffsetList.append(bce->offset()))
         return false;
 
-    return Emit1(cx, bce, JSOP_DEBUGAFTERYIELD);
+    return bce->emit1(JSOP_DEBUGAFTERYIELD);
 }
 
 bool
 frontend::EmitFunctionScript(ExclusiveContext *cx, BytecodeEmitter *bce, ParseNode *body)
 {
     if (!bce->updateLocalsToFrameSlots())
         return false;
 
@@ -3068,68 +3068,68 @@ frontend::EmitFunctionScript(ExclusiveCo
      * following ops into the range [script->code, script->main). Note:
      * execution starts from script->code, so this has no semantic effect.
      */
 
     FunctionBox *funbox = bce->sc->asFunctionBox();
     if (funbox->argumentsHasLocalBinding()) {
         MOZ_ASSERT(bce->offset() == 0);  /* See JSScript::argumentsBytecode. */
         bce->switchToProlog();
-        if (!Emit1(cx, bce, JSOP_ARGUMENTS))
+        if (!bce->emit1(JSOP_ARGUMENTS))
             return false;
         InternalBindingsHandle bindings(bce->script, &bce->script->bindings);
         BindingIter bi = Bindings::argumentsBinding(cx, bindings);
         if (bce->script->bindingIsAliased(bi)) {
             ScopeCoordinate sc;
             sc.setHops(0);
             sc.setSlot(0);  // initialize to silence GCC warning
             JS_ALWAYS_TRUE(LookupAliasedNameSlot(bce, bce->script, cx->names().arguments, &sc));
             if (!EmitAliasedVarOp(cx, JSOP_SETALIASEDVAR, sc, DontCheckLexical, bce))
                 return false;
         } else {
             if (!EmitUnaliasedVarOp(cx, JSOP_SETLOCAL, bi.localIndex(), DontCheckLexical, bce))
                 return false;
         }
-        if (!Emit1(cx, bce, JSOP_POP))
+        if (!bce->emit1(JSOP_POP))
             return false;
         bce->switchToMain();
     }
 
     /*
      * Emit a prologue for run-once scripts which will deoptimize JIT code if
      * the script ends up running multiple times via foo.caller related
      * shenanigans.
      */
     bool runOnce = bce->isRunOnceLambda();
     if (runOnce) {
         bce->switchToProlog();
-        if (!Emit1(cx, bce, JSOP_RUNONCE))
+        if (!bce->emit1(JSOP_RUNONCE))
             return false;
         bce->switchToMain();
     }
 
     if (!EmitTree(cx, bce, body))
         return false;
 
     if (bce->sc->isFunctionBox()) {
         if (bce->sc->asFunctionBox()->isGenerator()) {
             // If we fall off the end of a generator, do a final yield.
             if (bce->sc->asFunctionBox()->isStarGenerator() && !EmitPrepareIteratorResult(cx, bce))
                 return false;
 
-            if (!Emit1(cx, bce, JSOP_UNDEFINED))
+            if (!bce->emit1(JSOP_UNDEFINED))
                 return false;
 
             if (bce->sc->asFunctionBox()->isStarGenerator() &&
                 !EmitFinishIteratorResult(cx, bce, true))
             {
                 return false;
             }
 
-            if (!Emit1(cx, bce, JSOP_SETRVAL))
+            if (!bce->emit1(JSOP_SETRVAL))
                 return false;
 
             ScopeCoordinate sc;
             // We know that .generator is on the top scope chain node, as we are
             // at the function end.
             sc.setHops(0);
             MOZ_ALWAYS_TRUE(LookupAliasedNameSlot(bce, bce->script, cx->names().dotGenerator, &sc));
             if (!EmitAliasedVarOp(cx, JSOP_GETALIASEDVAR, sc, DontCheckLexical, bce))
@@ -3139,27 +3139,27 @@ frontend::EmitFunctionScript(ExclusiveCo
             if (!EmitYieldOp(cx, bce, JSOP_FINALYIELDRVAL))
                 return false;
         } else {
             // Non-generator functions just return |undefined|. The JSOP_RETRVAL
             // emitted below will do that, except if the script has a finally
             // block: there can be a non-undefined value in the return value
             // slot. We just emit an explicit return in this case.
             if (bce->hasTryFinally) {
-                if (!Emit1(cx, bce, JSOP_UNDEFINED))
+                if (!bce->emit1(JSOP_UNDEFINED))
                     return false;
-                if (!Emit1(cx, bce, JSOP_RETURN))
+                if (!bce->emit1(JSOP_RETURN))
                     return false;
             }
         }
     }
 
     // Always end the script with a JSOP_RETRVAL. Some other parts of the codebase
     // depend on this opcode, e.g. InterpreterRegs::setToEndOfScript.
-    if (!Emit1(cx, bce, JSOP_RETRVAL))
+    if (!bce->emit1(JSOP_RETRVAL))
         return false;
 
     // If all locals are aliased, the frame's block slots won't be used, so we
     // can set numBlockScoped = 0. This is nice for generators as it ensures
     // nfixed == 0, so we don't have to initialize any local slots when resuming
     // a generator.
     if (bce->sc->allLocalsAliased())
         bce->script->bindings.setAllLocalsAliased();
@@ -3352,17 +3352,17 @@ EmitDestructuringLHS(ExclusiveContext *c
     else if (target->isKind(PNK_ASSIGN))
         target = target->pn_left;
     if (target->isKind(PNK_ARRAY) || target->isKind(PNK_OBJECT)) {
         if (!EmitDestructuringOpsHelper(cx, bce, target, emitOption))
             return false;
         if (emitOption == InitializeVars) {
             // Per its post-condition, EmitDestructuringOpsHelper has left the
             // to-be-destructured value on top of the stack.
-            if (!Emit1(cx, bce, JSOP_POP))
+            if (!bce->emit1(JSOP_POP))
                 return false;
         }
     } else if (emitOption == PushInitialValues) {
         // The lhs is a simple name so the to-be-destructured value is
         // its initial value and there is nothing to do.
         MOZ_ASSERT(target->getOp() == JSOP_SETLOCAL || target->getOp() == JSOP_INITLEXICAL);
         MOZ_ASSERT(target->pn_dflags & PND_BOUND);
     } else {
@@ -3391,17 +3391,17 @@ EmitDestructuringLHS(ExclusiveContext *c
                 if (!bce->makeAtomIndex(target->pn_atom, &atomIndex))
                     return false;
 
                 if (!target->isOp(JSOP_SETCONST)) {
                     bool global = target->isOp(JSOP_SETGNAME) || target->isOp(JSOP_STRICTSETGNAME);
                     JSOp bindOp = global ? JSOP_BINDGNAME : JSOP_BINDNAME;
                     if (!EmitIndex32(cx, bindOp, atomIndex, bce))
                         return false;
-                    if (!Emit1(cx, bce, JSOP_SWAP))
+                    if (!bce->emit1(JSOP_SWAP))
                         return false;
                 }
 
                 if (!EmitIndexOp(cx, target->getOp(), atomIndex, bce))
                     return false;
                 break;
               }
 
@@ -3424,17 +3424,17 @@ EmitDestructuringLHS(ExclusiveContext *c
             // In `a.x = b`, `a` is evaluated first, then `b`, then a
             // JSOP_SETPROP instruction.
             //
             // In `[a.x] = [b]`, per spec, `b` is evaluated before `a`. Then we
             // need a property set -- but the operands are on the stack in the
             // wrong order for JSOP_SETPROP, so we have to add a JSOP_SWAP.
             if (!EmitTree(cx, bce, target->pn_expr))
                 return false;
-            if (!Emit1(cx, bce, JSOP_SWAP))
+            if (!bce->emit1(JSOP_SWAP))
                 return false;
             JSOp setOp = bce->sc->strict() ? JSOP_STRICTSETPROP : JSOP_SETPROP;
             if (!EmitAtomOp(cx, target, setOp, bce))
                 return false;
             break;
           }
 
           case PNK_ELEM:
@@ -3453,26 +3453,26 @@ EmitDestructuringLHS(ExclusiveContext *c
             if (!EmitTree(cx, bce, target))
                 return false;
 
             // Pop the call return value. Below, we pop the RHS too, balancing
             // the stack --- presumably for the benefit of bytecode
             // analysis. (The interpreter will never reach these instructions
             // since we just emitted JSOP_SETCALL, which always throws. It's
             // possible no analyses actually depend on this either.)
-            if (!Emit1(cx, bce, JSOP_POP))
+            if (!bce->emit1(JSOP_POP))
                 return false;
             break;
 
           default:
             MOZ_CRASH("EmitDestructuringLHS: bad lhs kind");
         }
 
         // Pop the assigned value.
-        if (!Emit1(cx, bce, JSOP_POP))
+        if (!bce->emit1(JSOP_POP))
             return false;
     }
 
     return true;
 }
 
 static bool EmitSpread(ExclusiveContext *cx, BytecodeEmitter *bce);
 static bool EmitIterator(ExclusiveContext *cx, BytecodeEmitter *bce);
@@ -3483,48 +3483,48 @@ static bool EmitIterator(ExclusiveContex
  */
 static bool
 EmitIteratorNext(ExclusiveContext *cx, BytecodeEmitter *bce, ParseNode *pn=nullptr)
 {
     MOZ_ASSERT(bce->emitterMode != BytecodeEmitter::SelfHosting,
                ".next() iteration is prohibited in self-hosted code because it "
                "can run user-modifiable iteration code");
 
-    if (!Emit1(cx, bce, JSOP_DUP))                             // ... ITER ITER
+    if (!bce->emit1(JSOP_DUP))                                 // ... ITER ITER
         return false;
     if (!EmitAtomOp(cx, cx->names().next, JSOP_CALLPROP, bce)) // ... ITER NEXT
         return false;
-    if (!Emit1(cx, bce, JSOP_SWAP))                            // ... NEXT ITER
+    if (!bce->emit1(JSOP_SWAP))                                // ... NEXT ITER
         return false;
     if (!EmitCall(cx, bce, JSOP_CALL, 0, pn))                  // ... RESULT
         return false;
     CheckTypeSet(cx, bce, JSOP_CALL);
     return true;
 }
 
 /**
  * EmitDefault will check if the value on top of the stack is "undefined".
  * If so, it will replace that value on the stack with the value defined by |defaultExpr|.
  */
 static bool
 EmitDefault(ExclusiveContext *cx, BytecodeEmitter *bce, ParseNode *defaultExpr)
 {
-    if (!Emit1(cx, bce, JSOP_DUP))                             // VALUE VALUE
-        return false;
-    if (!Emit1(cx, bce, JSOP_UNDEFINED))                       // VALUE VALUE UNDEFINED
-        return false;
-    if (!Emit1(cx, bce, JSOP_STRICTEQ))                        // VALUE EQL?
+    if (!bce->emit1(JSOP_DUP))                                 // VALUE VALUE
+        return false;
+    if (!bce->emit1(JSOP_UNDEFINED))                           // VALUE VALUE UNDEFINED
+        return false;
+    if (!bce->emit1(JSOP_STRICTEQ))                            // VALUE EQL?
         return false;
     // Emit source note to enable ion compilation.
     if (NewSrcNote(cx, bce, SRC_IF) < 0)
         return false;
     ptrdiff_t jump = EmitJump(cx, bce, JSOP_IFEQ, 0);          // VALUE
     if (jump < 0)
         return false;
-    if (!Emit1(cx, bce, JSOP_POP))                             // .
+    if (!bce->emit1(JSOP_POP))                                 // .
         return false;
     if (!EmitTree(cx, bce, defaultExpr))                       // DEFAULTVALUE
         return false;
     SetJumpOffsetAt(bce, jump);
     return true;
 }
 
 static bool
@@ -3535,17 +3535,17 @@ EmitDestructuringOpsArrayHelper(Exclusiv
     MOZ_ASSERT(pattern->isArity(PN_LIST));
     MOZ_ASSERT(bce->stackDepth != 0);
 
     /*
      * Use an iterator to destructure the RHS, instead of index lookup.
      * InitializeVars expects us to leave the *original* value on the stack.
      */
     if (emitOption == InitializeVars) {
-        if (!Emit1(cx, bce, JSOP_DUP))                                 // ... OBJ OBJ
+        if (!bce->emit1(JSOP_DUP))                                     // ... OBJ OBJ
             return false;
     }
     if (!EmitIterator(cx, bce))                                        // ... OBJ? ITER
         return false;
     bool needToPopIterator = true;
 
     for (ParseNode *member = pattern->pn_head; member; member = member->pn_next) {
         /*
@@ -3568,42 +3568,42 @@ EmitDestructuringOpsArrayHelper(Exclusiv
             CheckTypeSet(cx, bce, JSOP_NEWARRAY);
             jsbytecode *pc = bce->code(off);
             SET_UINT24(pc, 0);
 
             if (!EmitNumberOp(cx, 0, bce))                             // ... OBJ? ITER ARRAY INDEX
                 return false;
             if (!EmitSpread(cx, bce))                                  // ... OBJ? ARRAY INDEX
                 return false;
-            if (!Emit1(cx, bce, JSOP_POP))                             // ... OBJ? ARRAY
+            if (!bce->emit1(JSOP_POP))                                 // ... OBJ? ARRAY
                 return false;
             needToPopIterator = false;
         } else {
-            if (!Emit1(cx, bce, JSOP_DUP))                             // ... OBJ? ITER ITER
+            if (!bce->emit1(JSOP_DUP))                                 // ... OBJ? ITER ITER
                 return false;
             if (!EmitIteratorNext(cx, bce, pattern))                   // ... OBJ? ITER RESULT
                 return false;
-            if (!Emit1(cx, bce, JSOP_DUP))                             // ... OBJ? ITER RESULT RESULT
+            if (!bce->emit1(JSOP_DUP))                                 // ... OBJ? ITER RESULT RESULT
                 return false;
             if (!EmitAtomOp(cx, cx->names().done, JSOP_GETPROP, bce))  // ... OBJ? ITER RESULT DONE?
                 return false;
 
             // Emit (result.done ? undefined : result.value)
             // This is mostly copied from EmitConditionalExpression, except that this code
             // does not push new values onto the stack.
             ptrdiff_t noteIndex = NewSrcNote(cx, bce, SRC_COND);
             if (noteIndex < 0)
                 return false;
             ptrdiff_t beq = EmitJump(cx, bce, JSOP_IFEQ, 0);
             if (beq < 0)
                 return false;
 
-            if (!Emit1(cx, bce, JSOP_POP))                             // ... OBJ? ITER
-                return false;
-            if (!Emit1(cx, bce, JSOP_UNDEFINED))                       // ... OBJ? ITER UNDEFINED
+            if (!bce->emit1(JSOP_POP))                                 // ... OBJ? ITER
+                return false;
+            if (!bce->emit1(JSOP_UNDEFINED))                           // ... OBJ? ITER UNDEFINED
                 return false;
 
             /* Jump around else, fixup the branch, emit else, fixup jump. */
             ptrdiff_t jmp = EmitJump(cx, bce, JSOP_GOTO, 0);
             if (jmp < 0)
                 return false;
             SetJumpOffsetAt(bce, beq);
 
@@ -3617,17 +3617,17 @@ EmitDestructuringOpsArrayHelper(Exclusiv
 
         if (pndefault && !EmitDefault(cx, bce, pndefault))
             return false;
 
         // Destructure into the pattern the element contains.
         ParseNode *subpattern = elem;
         if (subpattern->isKind(PNK_ELISION)) {
             // The value destructuring into an elision just gets ignored.
-            if (!Emit1(cx, bce, JSOP_POP))                             // ... OBJ? ITER
+            if (!bce->emit1(JSOP_POP))                             // ... OBJ? ITER
                 return false;
             continue;
         }
 
         int32_t depthBefore = bce->stackDepth;
         if (!EmitDestructuringLHS(cx, bce, subpattern, emitOption))
             return false;
 
@@ -3650,34 +3650,34 @@ EmitDestructuringOpsArrayHelper(Exclusiv
                     return false;
                 }
                 if (!Emit2(cx, bce, JSOP_PICK, (jsbytecode)pickDistance))
                     return false;
             }
         }
     }
 
-    if (needToPopIterator && !Emit1(cx, bce, JSOP_POP))
+    if (needToPopIterator && !bce->emit1(JSOP_POP))
         return false;
 
     return true;
 }
 
 static bool
 EmitDestructuringOpsObjectHelper(ExclusiveContext *cx, BytecodeEmitter *bce, ParseNode *pattern,
                                  VarEmitOption emitOption)
 {
     MOZ_ASSERT(pattern->isKind(PNK_OBJECT));
     MOZ_ASSERT(pattern->isArity(PN_LIST));
 
     MOZ_ASSERT(bce->stackDepth != 0);                                  // ... OBJ
 
     for (ParseNode *member = pattern->pn_head; member; member = member->pn_next) {
         // Duplicate the value being destructured to use as a reference base.
-        if (!Emit1(cx, bce, JSOP_DUP))                                 // ... OBJ OBJ
+        if (!bce->emit1(JSOP_DUP))                                     // ... OBJ OBJ
             return false;
 
         // Now push the property name currently being matched, which is the
         // current property name "label" on the left of a colon in the object
         // initialiser.
         bool needsGetElem = true;
 
         ParseNode *subpattern;
@@ -3775,17 +3775,17 @@ EmitDestructuringOpsObjectHelper(Exclusi
                 return false;
         }
     }
 
     if (emitOption == PushInitialValues) {
         // Per the above loop invariant, the value being destructured into this
         // object pattern is atop the stack.  Pop it to achieve the
         // post-condition.
-        if (!Emit1(cx, bce, JSOP_POP))                                 // ... <pattern's target name values, seriatim>
+        if (!bce->emit1(JSOP_POP))                                 // ... <pattern's target name values, seriatim>
             return false;
     }
 
     return true;
 }
 
 /*
  * Recursive helper for EmitDestructuringOps.
@@ -3834,23 +3834,23 @@ EmitTemplateString(ExclusiveContext *cx,
             if (!UpdateSourceCoordNotes(cx, bce, pn2->pn_pos.begin))
                 return false;
         }
         if (!EmitTree(cx, bce, pn2))
             return false;
 
         if (pn2->getKind() != PNK_STRING && pn2->getKind() != PNK_TEMPLATE_STRING) {
             // We need to convert the expression to a string
-            if (!Emit1(cx, bce, JSOP_TOSTRING))
+            if (!bce->emit1(JSOP_TOSTRING))
                 return false;
         }
 
         if (pn2 != pn->pn_head) {
             // We've pushed two strings onto the stack. Add them together, leaving just one.
-            if (!Emit1(cx, bce, JSOP_ADD))
+            if (!bce->emit1(JSOP_ADD))
                 return false;
         }
 
     }
     return true;
 }
 
 static bool
@@ -3888,17 +3888,17 @@ EmitVariables(ExclusiveContext *cx, Byte
                 if (emitOption == DefineVars) {
                     if (!EmitDestructuringDecls(cx, bce, pn->getOp(), pn2))
                         return false;
                 } else {
                     // Lexical bindings cannot be used before they are
                     // initialized. Similar to the JSOP_INITLEXICAL case below.
                     MOZ_ASSERT(emitOption != DefineVars);
                     MOZ_ASSERT_IF(emitOption == InitializeVars, pn->pn_xflags & PNX_POPVAR);
-                    if (!Emit1(cx, bce, JSOP_UNDEFINED))
+                    if (!bce->emit1(JSOP_UNDEFINED))
                         return false;
                     if (!EmitInitializeDestructuringDecls(cx, bce, pn->getOp(), pn2))
                         return false;
                 }
                 break;
             }
 
             /*
@@ -3988,17 +3988,17 @@ EmitVariables(ExclusiveContext *cx, Byte
             if (!EmitTree(cx, bce, pn3))
                 return false;
             bce->emittingForInit = oldEmittingForInit;
         } else if (op == JSOP_INITLEXICAL || isLetExpr) {
             // 'let' bindings cannot be used before they are
             // initialized. JSOP_INITLEXICAL distinguishes the binding site.
             MOZ_ASSERT(emitOption != DefineVars);
             MOZ_ASSERT_IF(emitOption == InitializeVars, pn->pn_xflags & PNX_POPVAR);
-            if (!Emit1(cx, bce, JSOP_UNDEFINED))
+            if (!bce->emit1(JSOP_UNDEFINED))
                 return false;
         }
 
         // If we are not initializing, nothing to pop. If we are initializing
         // lets, we must emit the pops.
         if (emitOption != InitializeVars) {
             if (next)
                 continue;
@@ -4012,22 +4012,22 @@ EmitVariables(ExclusiveContext *cx, Byte
         } else {
             if (!EmitIndexOp(cx, op, atomIndex, bce))
                 return false;
         }
 
     emit_note_pop:
         if (!next)
             break;
-        if (!Emit1(cx, bce, JSOP_POP))
+        if (!bce->emit1(JSOP_POP))
             return false;
     }
 
     if (pn->pn_xflags & PNX_POPVAR) {
-        if (!Emit1(cx, bce, JSOP_POP))
+        if (!bce->emit1(JSOP_POP))
             return false;
     }
 
     return true;
 }
 
 static bool
 EmitAssignment(ExclusiveContext *cx, BytecodeEmitter *bce, ParseNode *lhs, JSOp op, ParseNode *rhs)
@@ -4078,41 +4078,41 @@ EmitAssignment(ExclusiveContext *cx, Byt
         break;
       case PNK_ARRAY:
       case PNK_OBJECT:
         break;
       case PNK_CALL:
         MOZ_ASSERT(lhs->pn_xflags & PNX_SETCALL);
         if (!EmitTree(cx, bce, lhs))
             return false;
-        if (!Emit1(cx, bce, JSOP_POP))
+        if (!bce->emit1(JSOP_POP))
             return false;
         break;
       default:
         MOZ_ASSERT(0);
     }
 
     if (op != JSOP_NOP) {
         MOZ_ASSERT(rhs);
         switch (lhs->getKind()) {
           case PNK_NAME:
             if (lhs->isConst()) {
                 if (lhs->isOp(JSOP_CALLEE)) {
-                    if (!Emit1(cx, bce, JSOP_CALLEE))
+                    if (!bce->emit1(JSOP_CALLEE))
                         return false;
                 } else if (lhs->isOp(JSOP_GETNAME) || lhs->isOp(JSOP_GETGNAME)) {
                     if (!EmitIndex32(cx, lhs->getOp(), atomIndex, bce))
                         return false;
                 } else {
                     MOZ_ASSERT(JOF_OPTYPE(lhs->getOp()) != JOF_ATOM);
                     if (!EmitVarOp(cx, lhs, lhs->getOp(), bce))
                         return false;
                 }
             } else if (lhs->isOp(JSOP_SETNAME) || lhs->isOp(JSOP_STRICTSETNAME)) {
-                if (!Emit1(cx, bce, JSOP_DUP))
+                if (!bce->emit1(JSOP_DUP))
                     return false;
                 if (!EmitIndex32(cx, JSOP_GETXPROP, atomIndex, bce))
                     return false;
             } else if (lhs->isOp(JSOP_SETGNAME) || lhs->isOp(JSOP_STRICTSETGNAME)) {
                 MOZ_ASSERT(lhs->pn_cookie.isFree());
                 if (!EmitAtomOp(cx, lhs, JSOP_GETGNAME, bce))
                     return false;
             } else if (lhs->isOp(JSOP_SETINTRINSIC)) {
@@ -4127,37 +4127,37 @@ EmitAssignment(ExclusiveContext *cx, Byt
                   case JSOP_SETALIASEDVAR: op = JSOP_GETALIASEDVAR; break;
                   default: MOZ_CRASH("Bad op");
                 }
                 if (!EmitVarOp(cx, lhs, op, bce))
                     return false;
             }
             break;
           case PNK_DOT: {
-            if (!Emit1(cx, bce, JSOP_DUP))
+            if (!bce->emit1(JSOP_DUP))
                 return false;
             bool isLength = (lhs->pn_atom == cx->names().length);
             if (!EmitIndex32(cx, isLength ? JSOP_LENGTH : JSOP_GETPROP, atomIndex, bce))
                 return false;
             break;
           }
           case PNK_ELEM:
-            if (!Emit1(cx, bce, JSOP_DUP2))
+            if (!bce->emit1(JSOP_DUP2))
                 return false;
             if (!EmitElemOpBase(cx, bce, JSOP_GETELEM))
                 return false;
             break;
           case PNK_CALL:
             /*
              * We just emitted a JSOP_SETCALL (which will always throw) and
              * popped the call's return value. Push a random value to make sure
              * the stack depth is correct.
              */
             MOZ_ASSERT(lhs->pn_xflags & PNX_SETCALL);
-            if (!Emit1(cx, bce, JSOP_NULL))
+            if (!bce->emit1(JSOP_NULL))
                 return false;
             break;
           default:;
         }
     }
 
     /* Now emit the right operand (it may affect the namespace). */
     if (rhs) {
@@ -4181,17 +4181,17 @@ EmitAssignment(ExclusiveContext *cx, Byt
          * Take care to avoid SRC_ASSIGNOP if the left-hand side is a const
          * declared in the current compilation unit, as in this case (just
          * a bit further below) we will avoid emitting the assignment op.
          */
         if (!lhs->isKind(PNK_NAME) || !lhs->isConst()) {
             if (NewSrcNote(cx, bce, SRC_ASSIGNOP) < 0)
                 return false;
         }
-        if (!Emit1(cx, bce, op))
+        if (!bce->emit1(op))
             return false;
     }
 
     /* Finally, emit the specialized assignment bytecode. */
     switch (lhs->getKind()) {
       case PNK_NAME:
         if (lhs->isOp(JSOP_SETARG) || lhs->isOp(JSOP_SETLOCAL) || lhs->isOp(JSOP_SETALIASEDVAR)) {
             if (!EmitVarOp(cx, lhs, lhs->getOp(), bce))
@@ -4210,17 +4210,17 @@ EmitAssignment(ExclusiveContext *cx, Byt
       }
       case PNK_CALL:
         /* Do nothing. The JSOP_SETCALL we emitted will always throw. */
         MOZ_ASSERT(lhs->pn_xflags & PNX_SETCALL);
         break;
       case PNK_ELEM:
       {
         JSOp setOp = bce->sc->strict() ? JSOP_STRICTSETELEM : JSOP_SETELEM;
-        if (!Emit1(cx, bce, setOp))
+        if (!bce->emit1(setOp))
             return false;
         break;
       }
       case PNK_ARRAY:
       case PNK_OBJECT:
         if (!EmitDestructuringOps(cx, bce, lhs))
             return false;
         break;
@@ -4421,42 +4421,42 @@ EmitCatch(ExclusiveContext *cx, Bytecode
     MOZ_ASSERT(stmt->type == STMT_BLOCK && stmt->isBlockScope);
     stmt->type = STMT_CATCH;
 
     /* Go up one statement info record to the TRY or FINALLY record. */
     stmt = stmt->down;
     MOZ_ASSERT(stmt->type == STMT_TRY || stmt->type == STMT_FINALLY);
 
     /* Pick up the pending exception and bind it to the catch variable. */
-    if (!Emit1(cx, bce, JSOP_EXCEPTION))
+    if (!bce->emit1(JSOP_EXCEPTION))
         return false;
 
     /*
      * Dup the exception object if there is a guard for rethrowing to use
      * it later when rethrowing or in other catches.
      */
-    if (pn->pn_kid2 && !Emit1(cx, bce, JSOP_DUP))
+    if (pn->pn_kid2 && !bce->emit1(JSOP_DUP))
         return false;
 
     ParseNode *pn2 = pn->pn_kid1;
     switch (pn2->getKind()) {
       case PNK_ARRAY:
       case PNK_OBJECT:
         if (!EmitDestructuringOps(cx, bce, pn2))
             return false;
-        if (!Emit1(cx, bce, JSOP_POP))
+        if (!bce->emit1(JSOP_POP))
             return false;
         break;
 
       case PNK_NAME:
         /* Inline and specialize BindNameToSlot for pn2. */
         MOZ_ASSERT(!pn2->pn_cookie.isFree());
         if (!EmitVarOp(cx, pn2, JSOP_INITLEXICAL, bce))
             return false;
-        if (!Emit1(cx, bce, JSOP_POP))
+        if (!bce->emit1(JSOP_POP))
             return false;
         break;
 
       default:
         MOZ_ASSERT(0);
     }
 
     // If there is a guard expression, emit it and arrange to jump to the next
@@ -4472,17 +4472,17 @@ EmitCatch(ExclusiveContext *cx, Bytecode
         if (guardCheck < 0)
             return false;
 
         {
             NonLocalExitScope nle(cx, bce);
 
             // Move exception back to cx->exception to prepare for
             // the next catch.
-            if (!Emit1(cx, bce, JSOP_THROWING))
+            if (!bce->emit1(JSOP_THROWING))
                 return false;
 
             // Leave the scope for this catch block.
             if (!nle.prepareForNonLocalJump(stmt))
                 return false;
 
             // Jump to the next handler.  The jump target is backpatched by EmitTry.
             ptrdiff_t guardJump = EmitJump(cx, bce, JSOP_GOTO, 0);
@@ -4490,17 +4490,17 @@ EmitCatch(ExclusiveContext *cx, Bytecode
                 return false;
             stmt->guardJump() = guardJump;
         }
 
         // Back to normal control flow.
         SetJumpOffsetAt(bce, guardCheck);
 
         // Pop duplicated exception object as we no longer need it.
-        if (!Emit1(cx, bce, JSOP_POP))
+        if (!bce->emit1(JSOP_POP))
             return false;
     }
 
     /* Emit the catch body. */
     return EmitTree(cx, bce, pn->pn_kid3);
 }
 
 // Using MOZ_NEVER_INLINE in here is a workaround for llvm.org/pr14047. See the
@@ -4528,17 +4528,17 @@ EmitTry(ExclusiveContext *cx, BytecodeEm
     // For that we store in a try note associated with the catch or
     // finally block the stack depth upon the try entry. The interpreter
     // uses this depth to properly unwind the stack and the scope chain.
     //
     int depth = bce->stackDepth;
 
     // Record the try location, then emit the try block.
     ptrdiff_t noteIndex = NewSrcNote(cx, bce, SRC_TRY);
-    if (noteIndex < 0 || !Emit1(cx, bce, JSOP_TRY))
+    if (noteIndex < 0 || !bce->emit1(JSOP_TRY))
         return false;
     ptrdiff_t tryStart = bce->offset();
     if (!EmitTree(cx, bce, pn->pn_kid1))
         return false;
     MOZ_ASSERT(depth == bce->stackDepth);
 
     // GOSUB to finally, if present.
     if (pn->pn_kid3) {
@@ -4611,19 +4611,19 @@ EmitTry(ExclusiveContext *cx, BytecodeEm
             // come here.
             if (stmtInfo.guardJump() != -1) {
                 SetJumpOffsetAt(bce, stmtInfo.guardJump());
                 stmtInfo.guardJump() = -1;
 
                 // If this catch block is the last one, rethrow, delegating
                 // execution of any finally block to the exception handler.
                 if (!pn3->pn_next) {
-                    if (!Emit1(cx, bce, JSOP_EXCEPTION))
+                    if (!bce->emit1(JSOP_EXCEPTION))
                         return false;
-                    if (!Emit1(cx, bce, JSOP_THROW))
+                    if (!bce->emit1(JSOP_THROW))
                         return false;
                 }
             }
         }
     }
 
     MOZ_ASSERT(bce->stackDepth == depth);
 
@@ -4636,30 +4636,30 @@ EmitTry(ExclusiveContext *cx, BytecodeEm
             return false;
 
         finallyStart = bce->offset();
 
         // Indicate that we're emitting a subroutine body.
         stmtInfo.type = STMT_SUBROUTINE;
         if (!UpdateSourceCoordNotes(cx, bce, pn->pn_kid3->pn_pos.begin))
             return false;
-        if (!Emit1(cx, bce, JSOP_FINALLY) ||
+        if (!bce->emit1(JSOP_FINALLY) ||
             !EmitTree(cx, bce, pn->pn_kid3) ||
-            !Emit1(cx, bce, JSOP_RETSUB))
+            !bce->emit1(JSOP_RETSUB))
         {
             return false;
         }
         bce->hasTryFinally = true;
         MOZ_ASSERT(bce->stackDepth == depth);
     }
     if (!PopStatementBCE(cx, bce))
         return false;
 
     // ReconstructPCStack needs a NOP here to mark the end of the last catch block.
-    if (!Emit1(cx, bce, JSOP_NOP))
+    if (!bce->emit1(JSOP_NOP))
         return false;
 
     // Fix up the end-of-try/catch jumps to come here.
     if (!BackPatch(cx, bce, catchJump, bce->code().end(), JSOP_GOTO))
         return false;
 
     // Add the try note last, to let post-order give us the right ordering
     // (first to last for a given nesting level, inner to outer by level).
@@ -4861,23 +4861,23 @@ EmitWith(ExclusiveContext *cx, BytecodeE
 /**
  * EmitIterator expects the iterable to already be on the stack.
  * It will replace that stack value with the corresponding iterator
  */
 static bool
 EmitIterator(ExclusiveContext *cx, BytecodeEmitter *bce)
 {
     // Convert iterable to iterator.
-    if (!Emit1(cx, bce, JSOP_DUP))                             // OBJ OBJ
+    if (!bce->emit1(JSOP_DUP))                                 // OBJ OBJ
         return false;
     if (!Emit2(cx, bce, JSOP_SYMBOL, jsbytecode(JS::SymbolCode::iterator))) // OBJ OBJ @@ITERATOR
         return false;
     if (!EmitElemOpBase(cx, bce, JSOP_CALLELEM))               // OBJ ITERFN
         return false;
-    if (!Emit1(cx, bce, JSOP_SWAP))                            // ITERFN OBJ
+    if (!bce->emit1(JSOP_SWAP))                                // ITERFN OBJ
         return false;
     if (!EmitCall(cx, bce, JSOP_CALL, 0))                      // ITER
         return false;
     CheckTypeSet(cx, bce, JSOP_CALL);
     return true;
 }
 
 static bool
@@ -4944,17 +4944,17 @@ EmitForOf(ExclusiveContext *cx, Bytecode
 
         // Compile the object expression to the right of 'of'.
         if (!EmitTree(cx, bce, forHeadExpr))
             return false;
         if (!EmitIterator(cx, bce))
             return false;
 
         // Push a dummy result so that we properly enter iteration midstream.
-        if (!Emit1(cx, bce, JSOP_UNDEFINED))                // ITER RESULT
+        if (!bce->emit1(JSOP_UNDEFINED))                // ITER RESULT
             return false;
     }
 
     // Enter the block before the loop body, after evaluating the obj.
     // Initialize let bindings with undefined when entering, as the name
     // assigned to is a plain assignment.
     StmtInfoBCE letStmt(cx);
     if (letDecl) {
@@ -4984,65 +4984,65 @@ EmitForOf(ExclusiveContext *cx, Bytecode
         bce->stackDepth++;
 
 #ifdef DEBUG
     int loopDepth = bce->stackDepth;
 #endif
 
     // Emit code to assign result.value to the iteration variable.
     if (type == STMT_FOR_OF_LOOP) {
-        if (!Emit1(cx, bce, JSOP_DUP))                         // ITER RESULT RESULT
+        if (!bce->emit1(JSOP_DUP))                             // ITER RESULT RESULT
             return false;
     }
     if (!EmitAtomOp(cx, cx->names().value, JSOP_GETPROP, bce)) // ... RESULT VALUE
         return false;
     if (type == STMT_FOR_OF_LOOP) {
         if (!EmitAssignment(cx, bce, forHead->pn_kid2, JSOP_NOP, nullptr)) // ITER RESULT VALUE
             return false;
-        if (!Emit1(cx, bce, JSOP_POP))                         // ITER RESULT
+        if (!bce->emit1(JSOP_POP))                             // ITER RESULT
             return false;
 
         // The stack should be balanced around the assignment opcode sequence.
         MOZ_ASSERT(bce->stackDepth == loopDepth);
 
         // Emit code for the loop body.
         if (!EmitTree(cx, bce, forBody))
             return false;
 
         // Set loop and enclosing "update" offsets, for continue.
         StmtInfoBCE *stmt = &stmtInfo;
         do {
             stmt->update = bce->offset();
         } while ((stmt = stmt->down) != nullptr && stmt->type == STMT_LABEL);
     } else {
-        if (!Emit1(cx, bce, JSOP_INITELEM_INC))                // ITER ARR (I+1)
+        if (!bce->emit1(JSOP_INITELEM_INC))                    // ITER ARR (I+1)
             return false;
 
         MOZ_ASSERT(bce->stackDepth == loopDepth - 1);
 
         // STMT_SPREAD never contain continue, so do not set "update" offset.
     }
 
     // COME FROM the beginning of the loop to here.
     SetJumpOffsetAt(bce, jmp);
     if (!EmitLoopEntry(cx, bce, forHeadExpr))
         return false;
 
     if (type == STMT_FOR_OF_LOOP) {
-        if (!Emit1(cx, bce, JSOP_POP))                         // ITER
-            return false;
-        if (!Emit1(cx, bce, JSOP_DUP))                         // ITER ITER
+        if (!bce->emit1(JSOP_POP))                             // ITER
+            return false;
+        if (!bce->emit1(JSOP_DUP))                             // ITER ITER
             return false;
     } else {
         if (!EmitDupAt(cx, bce, bce->stackDepth - 1 - 2))      // ITER ARR I ITER
             return false;
     }
     if (!EmitIteratorNext(cx, bce, forHead))                   // ... RESULT
         return false;
-    if (!Emit1(cx, bce, JSOP_DUP))                             // ... RESULT RESULT
+    if (!bce->emit1(JSOP_DUP))                                 // ... RESULT RESULT
         return false;
     if (!EmitAtomOp(cx, cx->names().done, JSOP_GETPROP, bce))  // ... RESULT DONE?
         return false;
 
     ptrdiff_t beq = EmitJump(cx, bce, JSOP_IFEQ, top - bce->offset()); // ... RESULT
     if (beq < 0)
         return false;
 
@@ -5094,17 +5094,17 @@ EmitForIn(ExclusiveContext *cx, Bytecode
      * destructuring for-in).
      */
     MOZ_ASSERT(pn->isOp(JSOP_ITER));
     if (!Emit2(cx, bce, JSOP_ITER, (uint8_t) pn->pn_iflags))
         return false;
 
     // For-in loops have both the iterator and the value on the stack. Push
     // undefined to balance the stack.
-    if (!Emit1(cx, bce, JSOP_UNDEFINED))
+    if (!bce->emit1(JSOP_UNDEFINED))
         return false;
 
     // Enter the block before the loop body, after evaluating the obj.
     // Initialize let bindings with undefined when entering, as the name
     // assigned to is a plain assignment.
     StmtInfoBCE letStmt(cx);
     if (letDecl) {
         if (!EnterBlockScope(cx, bce, &letStmt, pn1->pn_objbox, JSOP_UNDEFINED, 0))
@@ -5155,41 +5155,41 @@ EmitForIn(ExclusiveContext *cx, Bytecode
     } while ((stmt = stmt->down) != nullptr && stmt->type == STMT_LABEL);
 
     /*
      * Fixup the goto that starts the loop to jump down to JSOP_MOREITER.
      */
     SetJumpOffsetAt(bce, jmp);
     if (!EmitLoopEntry(cx, bce, nullptr))
         return false;
-    if (!Emit1(cx, bce, JSOP_POP))
-        return false;
-    if (!Emit1(cx, bce, JSOP_MOREITER))
-        return false;
-    if (!Emit1(cx, bce, JSOP_ISNOITER))
+    if (!bce->emit1(JSOP_POP))
+        return false;
+    if (!bce->emit1(JSOP_MOREITER))
+        return false;
+    if (!bce->emit1(JSOP_ISNOITER))
         return false;
     ptrdiff_t beq = EmitJump(cx, bce, JSOP_IFEQ, top - bce->offset());
     if (beq < 0)
         return false;
 
     /* Set the srcnote offset so we can find the closing jump. */
     if (!SetSrcNoteOffset(cx, bce, (unsigned)noteIndex, 0, beq - jmp))
         return false;
 
     // Fix up breaks and continues.
     if (!PopStatementBCE(cx, bce))
         return false;
 
     // Pop the enumeration value.
-    if (!Emit1(cx, bce, JSOP_POP))
+    if (!bce->emit1(JSOP_POP))
         return false;
 
     if (!bce->tryNoteList.append(JSTRY_ITER, bce->stackDepth, top, bce->offset()))
         return false;
-    if (!Emit1(cx, bce, JSOP_ENDITER))
+    if (!bce->emit1(JSOP_ENDITER))
         return false;
 
     if (letDecl) {
         if (!LeaveNestedScope(cx, bce, &letStmt))
             return false;
     }
 
     return true;
@@ -5222,28 +5222,28 @@ EmitNormalFor(ExclusiveContext *cx, Byte
 
     /*
      * NB: the SRC_FOR note has offsetBias 1 (JSOP_{NOP,POP}_LENGTH).
      * Use tmp to hold the biased srcnote "top" offset, which differs
      * from the top local variable by the length of the JSOP_GOTO
      * emitted in between tmp and top if this loop has a condition.
      */
     int noteIndex = NewSrcNote(cx, bce, SRC_FOR);
-    if (noteIndex < 0 || !Emit1(cx, bce, op))
+    if (noteIndex < 0 || !bce->emit1(op))
         return false;
     ptrdiff_t tmp = bce->offset();
 
     ptrdiff_t jmp = -1;
     if (forHead->pn_kid2) {
         /* Goto the loop condition, which branches back to iterate. */
         jmp = EmitJump(cx, bce, JSOP_GOTO, 0);
         if (jmp < 0)
             return false;
     } else {
-        if (op != JSOP_NOP && !Emit1(cx, bce, JSOP_NOP))
+        if (op != JSOP_NOP && !bce->emit1(JSOP_NOP))
             return false;
     }
 
     top = bce->offset();
     SET_STATEMENT_TOP(&stmtInfo, top);
 
     /* Emit code for the loop body. */
     if (!EmitLoopHead(cx, bce, forBody))
@@ -5268,17 +5268,17 @@ EmitNormalFor(ExclusiveContext *cx, Byte
     if (pn3) {
         if (!UpdateSourceCoordNotes(cx, bce, pn3->pn_pos.begin))
             return false;
         op = JSOP_POP;
         if (!EmitTree(cx, bce, pn3))
             return false;
 
         /* Always emit the POP or NOP to help IonBuilder. */
-        if (!Emit1(cx, bce, op))
+        if (!bce->emit1(op))
             return false;
 
         /* Restore the absolute line number for source note readers. */
         uint32_t lineNum = bce->parser->tokenStream.srcCoords.lineNum(pn->pn_pos.end);
         if (bce->currentLine() != lineNum) {
             if (NewSrcNote2(cx, bce, SRC_SETLINE, ptrdiff_t(lineNum)) < 0)
                 return false;
             bce->current->currentLine = lineNum;
@@ -5427,17 +5427,17 @@ EmitFunc(ExclusiveContext *cx, BytecodeE
 
     /* Make the function object a literal in the outer script's pool. */
     unsigned index = bce->objectList.add(pn->pn_funbox);
 
     /* Non-hoisted functions simply emit their respective op. */
     if (!pn->functionIsHoisted()) {
         /* JSOP_LAMBDA_ARROW is always preceded by JSOP_THIS. */
         MOZ_ASSERT(fun->isArrow() == (pn->getOp() == JSOP_LAMBDA_ARROW));
-        if (fun->isArrow() && !Emit1(cx, bce, JSOP_THIS))
+        if (fun->isArrow() && !bce->emit1(JSOP_THIS))
             return false;
         if (needsProto) {
             MOZ_ASSERT(pn->getOp() == JSOP_LAMBDA);
             pn->setOp(JSOP_FUNWITHPROTO);
         }
         return EmitIndex32(cx, pn->getOp(), index, bce);
     } else {
         MOZ_ASSERT(!needsProto);
@@ -5473,29 +5473,29 @@ EmitFunc(ExclusiveContext *cx, BytecodeE
 #endif
         pn->pn_index = index;
         if (!EmitIndexOp(cx, JSOP_LAMBDA, index, bce))
             return false;
         MOZ_ASSERT(pn->getOp() == JSOP_GETLOCAL || pn->getOp() == JSOP_GETARG);
         JSOp setOp = pn->getOp() == JSOP_GETLOCAL ? JSOP_SETLOCAL : JSOP_SETARG;
         if (!EmitVarOp(cx, pn, setOp, bce))
             return false;
-        if (!Emit1(cx, bce, JSOP_POP))
+        if (!bce->emit1(JSOP_POP))
             return false;
     }
 
     return true;
 }
 
 static bool
 EmitDo(ExclusiveContext *cx, BytecodeEmitter *bce, ParseNode *pn)
 {
     /* Emit an annotated nop so IonBuilder can recognize the 'do' loop. */
     ptrdiff_t noteIndex = NewSrcNote(cx, bce, SRC_WHILE);
-    if (noteIndex < 0 || !Emit1(cx, bce, JSOP_NOP))
+    if (noteIndex < 0 || !bce->emit1(JSOP_NOP))
         return false;
 
     ptrdiff_t noteIndex2 = NewSrcNote(cx, bce, SRC_WHILE);
     if (noteIndex2 < 0)
         return false;
 
     /* Compile the loop body. */
     ptrdiff_t top = bce->offset();
@@ -5658,17 +5658,17 @@ EmitReturn(ExclusiveContext *cx, Bytecod
     }
 
     /* Push a return value */
     if (ParseNode *pn2 = pn->pn_left) {
         if (!EmitTree(cx, bce, pn2))
             return false;
     } else {
         /* No explicit return value provided */
-        if (!Emit1(cx, bce, JSOP_UNDEFINED))
+        if (!bce->emit1(JSOP_UNDEFINED))
             return false;
     }
 
     if (bce->sc->isFunctionBox() && bce->sc->asFunctionBox()->isStarGenerator()) {
         if (!EmitFinishIteratorResult(cx, bce, true))
             return false;
     }
 
@@ -5690,24 +5690,24 @@ EmitReturn(ExclusiveContext *cx, Bytecod
     if (isGenerator) {
         if (bce->sc->asFunctionBox()->isStarGenerator() && InTryBlockWithFinally(bce)) {
             // Emit JSOP_SETALIASEDVAR .genrval to store the return value on the
             // scope chain, so it's not lost when we yield in a finally block.
             useGenRVal = true;
             MOZ_ASSERT(pn->pn_right);
             if (!EmitTree(cx, bce, pn->pn_right))
                 return false;
-            if (!Emit1(cx, bce, JSOP_POP))
+            if (!bce->emit1(JSOP_POP))
                 return false;
         } else {
-            if (!Emit1(cx, bce, JSOP_SETRVAL))
+            if (!bce->emit1(JSOP_SETRVAL))
                 return false;
         }
     } else {
-        if (!Emit1(cx, bce, JSOP_RETURN))
+        if (!bce->emit1(JSOP_RETURN))
             return false;
     }
 
     NonLocalExitScope nle(cx, bce);
 
     if (!nle.prepareForNonLocalJump(nullptr))
         return false;
 
@@ -5715,28 +5715,28 @@ EmitReturn(ExclusiveContext *cx, Bytecod
         ScopeCoordinate sc;
         // We know that .generator and .genrval are on the top scope chain node,
         // as we just exited nested scopes.
         sc.setHops(0);
         if (useGenRVal) {
             MOZ_ALWAYS_TRUE(LookupAliasedNameSlot(bce, bce->script, cx->names().dotGenRVal, &sc));
             if (!EmitAliasedVarOp(cx, JSOP_GETALIASEDVAR, sc, DontCheckLexical, bce))
                 return false;
-            if (!Emit1(cx, bce, JSOP_SETRVAL))
+            if (!bce->emit1(JSOP_SETRVAL))
                 return false;
         }
 
         MOZ_ALWAYS_TRUE(LookupAliasedNameSlot(bce, bce->script, cx->names().dotGenerator, &sc));
         if (!EmitAliasedVarOp(cx, JSOP_GETALIASEDVAR, sc, DontCheckLexical, bce))
             return false;
         if (!EmitYieldOp(cx, bce, JSOP_FINALYIELDRVAL))
             return false;
     } else if (top + static_cast<ptrdiff_t>(JSOP_RETURN_LENGTH) != bce->offset()) {
         bce->code()[top] = JSOP_SETRVAL;
-        if (!Emit1(cx, bce, JSOP_RETRVAL))
+        if (!bce->emit1(JSOP_RETRVAL))
             return false;
     }
 
     return true;
 }
 
 static bool
 EmitYield(ExclusiveContext *cx, BytecodeEmitter *bce, ParseNode *pn)
@@ -5747,34 +5747,34 @@ EmitYield(ExclusiveContext *cx, Bytecode
         if (bce->sc->asFunctionBox()->isStarGenerator()) {
             if (!EmitPrepareIteratorResult(cx, bce))
                 return false;
         }
         if (pn->pn_left) {
             if (!EmitTree(cx, bce, pn->pn_left))
                 return false;
         } else {
-            if (!Emit1(cx, bce, JSOP_UNDEFINED))
+            if (!bce->emit1(JSOP_UNDEFINED))
                 return false;
         }
         if (bce->sc->asFunctionBox()->isStarGenerator()) {
             if (!EmitFinishIteratorResult(cx, bce, false))
                 return false;
         }
     } else {
         MOZ_ASSERT(pn->getOp() == JSOP_INITIALYIELD);
     }
 
     if (!EmitTree(cx, bce, pn->pn_right))
         return false;
 
     if (!EmitYieldOp(cx, bce, pn->getOp()))
         return false;
 
-    if (pn->getOp() == JSOP_INITIALYIELD && !Emit1(cx, bce, JSOP_POP))
+    if (pn->getOp() == JSOP_INITIALYIELD && !bce->emit1(JSOP_POP))
         return false;
 
     return true;
 }
 
 static bool
 EmitYieldStar(ExclusiveContext *cx, BytecodeEmitter *bce, ParseNode *iter, ParseNode *gen)
 {
@@ -5782,32 +5782,32 @@ EmitYieldStar(ExclusiveContext *cx, Byte
     MOZ_ASSERT(bce->sc->asFunctionBox()->isStarGenerator());
 
     if (!EmitTree(cx, bce, iter))                                // ITERABLE
         return false;
     if (!EmitIterator(cx, bce))                                  // ITER
         return false;
 
     // Initial send value is undefined.
-    if (!Emit1(cx, bce, JSOP_UNDEFINED))                         // ITER RECEIVED
+    if (!bce->emit1(JSOP_UNDEFINED))                             // ITER RECEIVED
         return false;
 
     int depth = bce->stackDepth;
     MOZ_ASSERT(depth >= 2);
 
     ptrdiff_t initialSend = -1;
     if (!EmitBackPatchOp(cx, bce, &initialSend))                 // goto initialSend
         return false;
 
     // Try prologue.                                             // ITER RESULT
     StmtInfoBCE stmtInfo(cx);
     PushStatementBCE(bce, &stmtInfo, STMT_TRY, bce->offset());
     ptrdiff_t noteIndex = NewSrcNote(cx, bce, SRC_TRY);
     ptrdiff_t tryStart = bce->offset();                          // tryStart:
-    if (noteIndex < 0 || !Emit1(cx, bce, JSOP_TRY))
+    if (noteIndex < 0 || !bce->emit1(JSOP_TRY))
         return false;
     MOZ_ASSERT(bce->stackDepth == depth);
 
     // Load the generator object.
     if (!EmitTree(cx, bce, gen))                                 // ITER RESULT GENOBJ
         return false;
 
     // Yield RESULT as-is, without re-boxing.
@@ -5819,110 +5819,110 @@ EmitYieldStar(ExclusiveContext *cx, Byte
         return false;
     ptrdiff_t subsequentSend = -1;
     if (!EmitBackPatchOp(cx, bce, &subsequentSend))              // goto subsequentSend
         return false;
     ptrdiff_t tryEnd = bce->offset();                            // tryEnd:
 
     // Catch location.
     bce->stackDepth = uint32_t(depth);                           // ITER RESULT
-    if (!Emit1(cx, bce, JSOP_POP))                               // ITER
+    if (!bce->emit1(JSOP_POP))                                   // ITER
         return false;
     // THROW? = 'throw' in ITER
-    if (!Emit1(cx, bce, JSOP_EXCEPTION))                         // ITER EXCEPTION
-        return false;
-    if (!Emit1(cx, bce, JSOP_SWAP))                              // EXCEPTION ITER
-        return false;
-    if (!Emit1(cx, bce, JSOP_DUP))                               // EXCEPTION ITER ITER
+    if (!bce->emit1(JSOP_EXCEPTION))                             // ITER EXCEPTION
+        return false;
+    if (!bce->emit1(JSOP_SWAP))                                  // EXCEPTION ITER
+        return false;
+    if (!bce->emit1(JSOP_DUP))                                   // EXCEPTION ITER ITER
         return false;
     if (!EmitAtomOp(cx, cx->names().throw_, JSOP_STRING, bce))   // EXCEPTION ITER ITER "throw"
         return false;
-    if (!Emit1(cx, bce, JSOP_SWAP))                              // EXCEPTION ITER "throw" ITER
-        return false;
-    if (!Emit1(cx, bce, JSOP_IN))                                // EXCEPTION ITER THROW?
+    if (!bce->emit1(JSOP_SWAP))                                  // EXCEPTION ITER "throw" ITER
+        return false;
+    if (!bce->emit1(JSOP_IN))                                    // EXCEPTION ITER THROW?
         return false;
     // if (THROW?) goto delegate
     ptrdiff_t checkThrow = EmitJump(cx, bce, JSOP_IFNE, 0);      // EXCEPTION ITER
     if (checkThrow < 0)
         return false;
-    if (!Emit1(cx, bce, JSOP_POP))                               // EXCEPTION
-        return false;
-    if (!Emit1(cx, bce, JSOP_THROW))                             // throw EXCEPTION
+    if (!bce->emit1(JSOP_POP))                                   // EXCEPTION
+        return false;
+    if (!bce->emit1(JSOP_THROW))                                 // throw EXCEPTION
         return false;
 
     SetJumpOffsetAt(bce, checkThrow);                            // delegate:
     // RESULT = ITER.throw(EXCEPTION)                            // EXCEPTION ITER
     bce->stackDepth = uint32_t(depth);
-    if (!Emit1(cx, bce, JSOP_DUP))                               // EXCEPTION ITER ITER
-        return false;
-    if (!Emit1(cx, bce, JSOP_DUP))                               // EXCEPTION ITER ITER ITER
+    if (!bce->emit1(JSOP_DUP))                                   // EXCEPTION ITER ITER
+        return false;
+    if (!bce->emit1(JSOP_DUP))                                   // EXCEPTION ITER ITER ITER
         return false;
     if (!EmitAtomOp(cx, cx->names().throw_, JSOP_CALLPROP, bce)) // EXCEPTION ITER ITER THROW
         return false;
-    if (!Emit1(cx, bce, JSOP_SWAP))                              // EXCEPTION ITER THROW ITER
+    if (!bce->emit1(JSOP_SWAP))                                  // EXCEPTION ITER THROW ITER
         return false;
     if (!Emit2(cx, bce, JSOP_PICK, (jsbytecode)3))               // ITER THROW ITER EXCEPTION
         return false;
     if (!EmitCall(cx, bce, JSOP_CALL, 1, iter))                  // ITER RESULT
         return false;
     CheckTypeSet(cx, bce, JSOP_CALL);
     MOZ_ASSERT(bce->stackDepth == depth);
     ptrdiff_t checkResult = -1;
     if (!EmitBackPatchOp(cx, bce, &checkResult))                 // goto checkResult
         return false;
 
     // Catch epilogue.
     if (!PopStatementBCE(cx, bce))
         return false;
     // This is a peace offering to ReconstructPCStack.  See the note in EmitTry.
-    if (!Emit1(cx, bce, JSOP_NOP))
+    if (!bce->emit1(JSOP_NOP))
         return false;
     if (!bce->tryNoteList.append(JSTRY_CATCH, depth, tryStart + JSOP_TRY_LENGTH, tryEnd))
         return false;
 
     // After the try/catch block: send the received value to the iterator.
     if (!BackPatch(cx, bce, initialSend, bce->code().end(), JSOP_GOTO)) // initialSend:
         return false;
     if (!BackPatch(cx, bce, subsequentSend, bce->code().end(), JSOP_GOTO)) // subsequentSend:
         return false;
 
     // Send location.
     // result = iter.next(received)                              // ITER RECEIVED
-    if (!Emit1(cx, bce, JSOP_SWAP))                              // RECEIVED ITER
-        return false;
-    if (!Emit1(cx, bce, JSOP_DUP))                               // RECEIVED ITER ITER
-        return false;
-    if (!Emit1(cx, bce, JSOP_DUP))                               // RECEIVED ITER ITER ITER
+    if (!bce->emit1(JSOP_SWAP))                                  // RECEIVED ITER
+        return false;
+    if (!bce->emit1(JSOP_DUP))                                   // RECEIVED ITER ITER
+        return false;
+    if (!bce->emit1(JSOP_DUP))                                   // RECEIVED ITER ITER ITER
         return false;
     if (!EmitAtomOp(cx, cx->names().next, JSOP_CALLPROP, bce))   // RECEIVED ITER ITER NEXT
         return false;
-    if (!Emit1(cx, bce, JSOP_SWAP))                              // RECEIVED ITER NEXT ITER
+    if (!bce->emit1(JSOP_SWAP))                                  // RECEIVED ITER NEXT ITER
         return false;
     if (!Emit2(cx, bce, JSOP_PICK, (jsbytecode)3))               // ITER NEXT ITER RECEIVED
         return false;
     if (!EmitCall(cx, bce, JSOP_CALL, 1, iter))                  // ITER RESULT
         return false;
     CheckTypeSet(cx, bce, JSOP_CALL);
     MOZ_ASSERT(bce->stackDepth == depth);
 
     if (!BackPatch(cx, bce, checkResult, bce->code().end(), JSOP_GOTO)) // checkResult:
         return false;
     // if (!result.done) goto tryStart;                          // ITER RESULT
-    if (!Emit1(cx, bce, JSOP_DUP))                               // ITER RESULT RESULT
+    if (!bce->emit1(JSOP_DUP))                                   // ITER RESULT RESULT
         return false;
     if (!EmitAtomOp(cx, cx->names().done, JSOP_GETPROP, bce))    // ITER RESULT DONE
         return false;
     // if (!DONE) goto tryStart;
     if (EmitJump(cx, bce, JSOP_IFEQ, tryStart - bce->offset()) < 0) // ITER RESULT
         return false;
 
     // result.value
-    if (!Emit1(cx, bce, JSOP_SWAP))                              // RESULT ITER
-        return false;
-    if (!Emit1(cx, bce, JSOP_POP))                               // RESULT
+    if (!bce->emit1(JSOP_SWAP))                                  // RESULT ITER
+        return false;
+    if (!bce->emit1(JSOP_POP))                                   // RESULT
         return false;
     if (!EmitAtomOp(cx, cx->names().value, JSOP_GETPROP, bce))   // VALUE
         return false;
 
     MOZ_ASSERT(bce->stackDepth == depth - 1);
 
     return true;
 }
@@ -5996,17 +5996,17 @@ EmitStatement(ExclusiveContext *cx, Byte
         }
     }
 
     if (useful) {
         JSOp op = wantval ? JSOP_SETRVAL : JSOP_POP;
         MOZ_ASSERT_IF(pn2->isKind(PNK_ASSIGN), pn2->isOp(JSOP_NOP));
         if (!EmitTree(cx, bce, pn2))
             return false;
-        if (!Emit1(cx, bce, op))
+        if (!bce->emit1(op))
             return false;
     } else if (pn->isDirectivePrologueMember()) {
         // Don't complain about directive prologue members; just don't emit
         // their code.
     } else {
         if (JSAtom *atom = pn->isStringExprStatement()) {
             // Warn if encountering a non-directive prologue member string
             // expression statement, that is inconsistent with the current
@@ -6078,21 +6078,21 @@ EmitDelete(ExclusiveContext *cx, Bytecod
         bool useful = false;
         if (!CheckSideEffects(cx, bce, pn2, &useful))
             return false;
 
         if (useful) {
             MOZ_ASSERT_IF(pn2->isKind(PNK_CALL), !(pn2->pn_xflags & PNX_SETCALL));
             if (!EmitTree(cx, bce, pn2))
                 return false;
-            if (!Emit1(cx, bce, JSOP_POP))
+            if (!bce->emit1(JSOP_POP))
                 return false;
         }
 
-        if (!Emit1(cx, bce, JSOP_TRUE))
+        if (!bce->emit1(JSOP_TRUE))
             return false;
       }
     }
 
     return true;
 }
 
 static bool
@@ -6170,19 +6170,19 @@ EmitSelfHostedResumeGenerator(ExclusiveC
         return false;
 
     return true;
 }
 
 static bool
 EmitSelfHostedForceInterpreter(ExclusiveContext *cx, BytecodeEmitter *bce, ParseNode *pn)
 {
-    if (!Emit1(cx, bce, JSOP_FORCEINTERPRETER))
-        return false;
-    if (!Emit1(cx, bce, JSOP_UNDEFINED))
+    if (!bce->emit1(JSOP_FORCEINTERPRETER))
+        return false;
+    if (!bce->emit1(JSOP_UNDEFINED))
         return false;
     return true;
 }
 
 static bool
 EmitCallOrNew(ExclusiveContext *cx, BytecodeEmitter *bce, ParseNode *pn)
 {
     bool callop = pn->isKind(PNK_CALL) || pn->isKind(PNK_TAGGED_TEMPLATE);
@@ -6234,17 +6234,17 @@ EmitCallOrNew(ExclusiveContext *cx, Byte
       case PNK_DOT:
         if (!EmitPropOp(cx, pn2, callop ? JSOP_CALLPROP : JSOP_GETPROP, bce))
             return false;
         break;
       case PNK_ELEM:
         if (!EmitElemOp(cx, pn2, callop ? JSOP_CALLELEM : JSOP_GETELEM, bce))
             return false;
         if (callop) {
-            if (!Emit1(cx, bce, JSOP_SWAP))
+            if (!bce->emit1(JSOP_SWAP))
                 return false;
         }
         break;
       case PNK_FUNCTION:
         /*
          * Top level lambdas which are immediately invoked should be
          * treated as only running once. Every time they execute we will
          * create new types and scripts for their contents, to increase
@@ -6269,17 +6269,17 @@ EmitCallOrNew(ExclusiveContext *cx, Byte
       default:
         if (!EmitTree(cx, bce, pn2))
             return false;
         callop = false;             /* trigger JSOP_UNDEFINED after */
         break;
     }
     if (!callop) {
         JSOp thisop = pn->isKind(PNK_GENEXP) ? JSOP_THIS : JSOP_UNDEFINED;
-        if (!Emit1(cx, bce, thisop))
+        if (!bce->emit1(thisop))
             return false;
     }
 
     /*
      * Emit code for each argument in order, then emit the JSOP_*CALL or
      * JSOP_NEW bytecode with a two-byte immediate telling how many args
      * were pushed on the operand stack.
      */
@@ -6295,30 +6295,30 @@ EmitCallOrNew(ExclusiveContext *cx, Byte
             return false;
     }
     bce->emittingForInit = oldEmittingForInit;
 
     if (!spread) {
         if (!EmitCall(cx, bce, pn->getOp(), argc, pn))
             return false;
     } else {
-        if (!Emit1(cx, bce, pn->getOp()))
+        if (!bce->emit1(pn->getOp()))
             return false;
     }
     CheckTypeSet(cx, bce, pn->getOp());
     if (pn->isOp(JSOP_EVAL) ||
         pn->isOp(JSOP_STRICTEVAL) ||
         pn->isOp(JSOP_SPREADEVAL) ||
         pn->isOp(JSOP_STRICTSPREADEVAL))
     {
         uint32_t lineNum = bce->parser->tokenStream.srcCoords.lineNum(pn->pn_pos.begin);
         EMIT_UINT16_IMM_OP(JSOP_LINENO, lineNum);
     }
     if (pn->pn_xflags & PNX_SETCALL) {
-        if (!Emit1(cx, bce, JSOP_SETCALL))
+        if (!bce->emit1(JSOP_SETCALL))
             return false;
     }
     return true;
 }
 
 static bool
 EmitLogical(ExclusiveContext *cx, BytecodeEmitter *bce, ParseNode *pn)
 {
@@ -6336,28 +6336,28 @@ EmitLogical(ExclusiveContext *cx, Byteco
 
     /* Left-associative operator chain: avoid too much recursion. */
     ParseNode *pn2 = pn->pn_head;
     if (!EmitTree(cx, bce, pn2))
         return false;
     ptrdiff_t top = EmitJump(cx, bce, JSOP_BACKPATCH, 0);
     if (top < 0)
         return false;
-    if (!Emit1(cx, bce, JSOP_POP))
+    if (!bce->emit1(JSOP_POP))
         return false;
 
     /* Emit nodes between the head and the tail. */
     ptrdiff_t jmp = top;
     while ((pn2 = pn2->pn_next)->pn_next) {
         if (!EmitTree(cx, bce, pn2))
             return false;
         ptrdiff_t off = EmitJump(cx, bce, JSOP_BACKPATCH, 0);
         if (off < 0)
             return false;
-        if (!Emit1(cx, bce, JSOP_POP))
+        if (!bce->emit1(JSOP_POP))
             return false;
         SET_JUMP_OFFSET(bce->code(jmp), off - jmp);
         jmp = off;
     }
     if (!EmitTree(cx, bce, pn2))
         return false;
 
     pn2 = pn->pn_head;
@@ -6412,17 +6412,17 @@ EmitIncOrDec(ExclusiveContext *cx, Bytec
           case JSOP_SETGNAME:
           case JSOP_STRICTSETGNAME:
             maySet = true;
             break;
           default:
             maySet = false;
         }
         if (op == JSOP_CALLEE) {
-            if (!Emit1(cx, bce, op))
+            if (!bce->emit1(op))
                 return false;
         } else if (!pn2->pn_cookie.isFree()) {
             if (maySet) {
                 if (!EmitVarIncDec(cx, pn, bce))
                     return false;
             } else {
                 if (!EmitVarOp(cx, pn2, op, bce))
                     return false;
@@ -6434,24 +6434,24 @@ EmitIncOrDec(ExclusiveContext *cx, Bytec
                     return false;
             } else {
                 if (!EmitAtomOp(cx, pn2, op, bce))
                     return false;
             }
             break;
         }
         if (pn2->isConst()) {
-            if (!Emit1(cx, bce, JSOP_POS))
+            if (!bce->emit1(JSOP_POS))
                 return false;
             bool post;
             JSOp binop = GetIncDecInfo(pn->getKind(), &post);
             if (!post) {
-                if (!Emit1(cx, bce, JSOP_ONE))
+                if (!bce->emit1(JSOP_ONE))
                     return false;
-                if (!Emit1(cx, bce, binop))
+                if (!bce->emit1(binop))
                     return false;
             }
         }
     }
     return true;
 }
 
 /*
@@ -6550,27 +6550,27 @@ EmitPropertyList(ExclusiveContext *cx, B
 
         // Handle __proto__: v specially because *only* this form, and no other
         // involving "__proto__", performs [[Prototype]] mutation.
         if (propdef->isKind(PNK_MUTATEPROTO)) {
             MOZ_ASSERT(type == ObjectLiteral);
             if (!EmitTree(cx, bce, propdef->pn_kid))
                 return false;
             objp.set(nullptr);
-            if (!Emit1(cx, bce, JSOP_MUTATEPROTO))
+            if (!bce->emit1(JSOP_MUTATEPROTO))
                 return false;
             continue;
         }
 
         bool extraPop = false;
         if (type == ClassBody && propdef->as<ClassMethod>().isStatic()) {
             extraPop = true;
-            if (!Emit1(cx, bce, JSOP_DUP2))
-                return false;
-            if (!Emit1(cx, bce, JSOP_POP))
+            if (!bce->emit1(JSOP_DUP2))
+                return false;
+            if (!bce->emit1(JSOP_POP))
                 return false;
         }
 
         /* Emit an index for t[2] for later consumption by JSOP_INITELEM. */
         ParseNode *key = propdef->pn_left;
         bool isIndex = false;
         if (key->isKind(PNK_NUMBER)) {
             if (!EmitNumberOp(cx, key->pn_dval, bce))
@@ -6612,17 +6612,17 @@ EmitPropertyList(ExclusiveContext *cx, B
         if (isIndex) {
             objp.set(nullptr);
             switch (op) {
               case JSOP_INITPROP:        op = JSOP_INITELEM;        break;
               case JSOP_INITPROP_GETTER: op = JSOP_INITELEM_GETTER; break;
               case JSOP_INITPROP_SETTER: op = JSOP_INITELEM_SETTER; break;
               default: MOZ_CRASH("Invalid op");
             }
-            if (!Emit1(cx, bce, op))
+            if (!bce->emit1(op))
                 return false;
         } else {
             MOZ_ASSERT(key->isKind(PNK_OBJECT_PROPERTY_NAME) || key->isKind(PNK_STRING));
 
             jsatomid index;
             if (!bce->makeAtomIndex(key->pn_atom, &index))
                 return false;
 
@@ -6639,17 +6639,17 @@ EmitPropertyList(ExclusiveContext *cx, B
                     objp.set(nullptr);
             }
 
             if (!EmitIndex32(cx, op, index, bce))
                 return false;
         }
 
         if (extraPop) {
-            if (!Emit1(cx, bce, JSOP_POP))
+            if (!bce->emit1(JSOP_POP))
                 return false;
         }
     }
     return true;
 }
 
 /*
  * Using MOZ_NEVER_INLINE in here is a workaround for llvm.org/pr14047. See
@@ -6779,45 +6779,45 @@ EmitArray(ExclusiveContext *cx, Bytecode
         if (!afterSpread && pn2->isKind(PNK_SPREAD)) {
             afterSpread = true;
             if (!EmitNumberOp(cx, atomIndex, bce))                       // ARRAY INDEX
                 return false;
         }
         if (!UpdateSourceCoordNotes(cx, bce, pn2->pn_pos.begin))
             return false;
         if (pn2->isKind(PNK_ELISION)) {
-            if (!Emit1(cx, bce, JSOP_HOLE))
+            if (!bce->emit1(JSOP_HOLE))
                 return false;
         } else {
             ParseNode *expr = pn2->isKind(PNK_SPREAD) ? pn2->pn_kid : pn2;
             if (!EmitTree(cx, bce, expr))                                // ARRAY INDEX? VALUE
                 return false;
         }
         if (pn2->isKind(PNK_SPREAD)) {
             if (!EmitIterator(cx, bce))                                  // ARRAY INDEX ITER
                 return false;
             if (!Emit2(cx, bce, JSOP_PICK, (jsbytecode)2))               // INDEX ITER ARRAY
                 return false;
             if (!Emit2(cx, bce, JSOP_PICK, (jsbytecode)2))               // ITER ARRAY INDEX
                 return false;
             if (!EmitSpread(cx, bce))                                    // ARRAY INDEX
                 return false;
         } else if (afterSpread) {
-            if (!Emit1(cx, bce, JSOP_INITELEM_INC))
+            if (!bce->emit1(JSOP_INITELEM_INC))
                 return false;
         } else {
             off = EmitN(cx, bce, JSOP_INITELEM_ARRAY, 3);
             if (off < 0)
                 return false;
             SET_UINT24(bce->code(off), atomIndex);
         }
     }
     MOZ_ASSERT(atomIndex == count);
     if (afterSpread) {
-        if (!Emit1(cx, bce, JSOP_POP))                                   // ARRAY
+        if (!bce->emit1(JSOP_POP))                                       // ARRAY
             return false;
     }
     return true;
 }
 
 static bool
 EmitUnary(ExclusiveContext *cx, BytecodeEmitter *bce, ParseNode *pn)
 {
@@ -6831,47 +6831,47 @@ EmitUnary(ExclusiveContext *cx, Bytecode
         op = JSOP_TYPEOFEXPR;
 
     bool oldEmittingForInit = bce->emittingForInit;
     bce->emittingForInit = false;
     if (!EmitTree(cx, bce, pn2))
         return false;
 
     bce->emittingForInit = oldEmittingForInit;
-    return Emit1(cx, bce, op);
+    return bce->emit1(op);
 }
 
 static bool
 EmitDefaults(ExclusiveContext *cx, BytecodeEmitter *bce, ParseNode *pn)
 {
     MOZ_ASSERT(pn->isKind(PNK_ARGSBODY));
 
     ParseNode *arg, *pnlast = pn->last();
     for (arg = pn->pn_head; arg != pnlast; arg = arg->pn_next) {
         if (!(arg->pn_dflags & PND_DEFAULT))
             continue;
         if (!BindNameToSlot(cx, bce, arg))
             return false;
         if (!EmitVarOp(cx, arg, JSOP_GETARG, bce))
             return false;
-        if (!Emit1(cx, bce, JSOP_UNDEFINED))
-            return false;
-        if (!Emit1(cx, bce, JSOP_STRICTEQ))
+        if (!bce->emit1(JSOP_UNDEFINED))
+            return false;
+        if (!bce->emit1(JSOP_STRICTEQ))
             return false;
         // Emit source note to enable ion compilation.
         if (NewSrcNote(cx, bce, SRC_IF) < 0)
             return false;
         ptrdiff_t jump = EmitJump(cx, bce, JSOP_IFEQ, 0);
         if (jump < 0)
             return false;
         if (!EmitTree(cx, bce, arg->expr()))
             return false;
         if (!EmitVarOp(cx, arg, JSOP_SETARG, bce))
             return false;
-        if (!Emit1(cx, bce, JSOP_POP))
+        if (!bce->emit1(JSOP_POP))
             return false;
         SET_JUMP_OFFSET(bce->code(jump), bce->offset() - jump);
     }
 
     return true;
 }
 
 
@@ -6894,17 +6894,17 @@ EmitLexicalInitialization(ExclusiveConte
     jsatomid atomIndex;
     if (!MaybeEmitVarDecl(cx, bce, globalDefOp, pn, &atomIndex))
         return false;
 
     if (pn->getOp() != JSOP_INITLEXICAL) {
         bool global = js_CodeSpec[pn->getOp()].format & JOF_GNAME;
         if (!EmitIndex32(cx, global ? JSOP_BINDGNAME : JSOP_BINDNAME, atomIndex, bce))
             return false;
-        if (!Emit1(cx, bce, JSOP_SWAP))
+        if (!bce->emit1(JSOP_SWAP))
             return false;
     }
 
     if (!pn->pn_cookie.isFree()) {
         if (!EmitVarOp(cx, pn, pn->getOp(), bce))
             return false;
     } else {
         if (!EmitIndexOp(cx, pn->getOp(), atomIndex, bce))
@@ -6945,47 +6945,47 @@ EmitClass(ExclusiveContext *cx, Bytecode
     if (names) {
         if (!EnterBlockScope(cx, bce, &stmtInfo, classNode.scopeObject(), JSOP_UNINITIALIZED))
             return false;
     }
 
     if (heritageExpression) {
         if (!EmitTree(cx, bce, heritageExpression))
             return false;
-        if (!Emit1(cx, bce, JSOP_CLASSHERITAGE))
+        if (!bce->emit1(JSOP_CLASSHERITAGE))
             return false;
     }
 
     if (!EmitFunc(cx, bce, constructor, !!heritageExpression))
         return false;
 
     if (heritageExpression) {
         // JSOP_CLASSHERITAGE leaves both prototypes on the stack. After
         // creating the constructor, trickly it to the bottom to make the object.
-        if (!Emit1(cx, bce, JSOP_SWAP))
-            return false;
-        if (!Emit1(cx, bce, JSOP_OBJWITHPROTO))
+        if (!bce->emit1(JSOP_SWAP))
+            return false;
+        if (!bce->emit1(JSOP_OBJWITHPROTO))
             return false;
     } else {
         if (!EmitNewInit(cx, bce, JSProto_Object))
             return false;
     }
 
-    if (!Emit1(cx, bce, JSOP_DUP2))
+    if (!bce->emit1(JSOP_DUP2))
         return false;
     if (!EmitAtomOp(cx, cx->names().prototype, JSOP_INITLOCKEDPROP, bce))
         return false;
     if (!EmitAtomOp(cx, cx->names().constructor, JSOP_INITHIDDENPROP, bce))
         return false;
 
     RootedPlainObject obj(cx);
     if (!EmitPropertyList(cx, bce, classMethods, &obj, ClassBody))
         return false;
 
-    if (!Emit1(cx, bce, JSOP_POP))
+    if (!bce->emit1(JSOP_POP))
         return false;
 
     if (names) {
         // That DEFCONST is never gonna be used, but use it here for logical consistency.
         ParseNode *innerName = names->innerBinding();
         if (!EmitLexicalInitialization(cx, bce, innerName, JSOP_DEFCONST))
             return false;
 
@@ -6993,17 +6993,17 @@ EmitClass(ExclusiveContext *cx, Bytecode
             return false;
 
         ParseNode *outerName = names->outerBinding();
         if (outerName) {
             if (!EmitLexicalInitialization(cx, bce, outerName, JSOP_DEFVAR))
                 return false;
             // Only class statements make outer bindings, and they do not leave
             // themselves on the stack.
-            if (!Emit1(cx, bce, JSOP_POP))
+            if (!bce->emit1(JSOP_POP))
                 return false;
         }
     }
 
     MOZ_ALWAYS_TRUE(bce->sc->setLocalStrictMode(savedStrictness));
 
     return true;
 }
@@ -7059,59 +7059,59 @@ frontend::EmitTree(ExclusiveContext *cx,
                 // processed. To do this, we create the rest argument and let it
                 // sit on the stack while processing defaults. The rest
                 // parameter's slot is set to undefined for the course of
                 // default processing.
                 rest = pn->pn_head;
                 while (rest->pn_next != pnlast)
                     rest = rest->pn_next;
                 restIsDefn = rest->isDefn();
-                if (!Emit1(cx, bce, JSOP_REST))
+                if (!bce->emit1(JSOP_REST))
                     return false;
                 CheckTypeSet(cx, bce, JSOP_REST);
 
                 // Only set the rest parameter if it's not aliased by a nested
                 // function in the body.
                 if (restIsDefn) {
-                    if (!Emit1(cx, bce, JSOP_UNDEFINED))
+                    if (!bce->emit1(JSOP_UNDEFINED))
                         return false;
                     if (!BindNameToSlot(cx, bce, rest))
                         return false;
                     if (!EmitVarOp(cx, rest, JSOP_SETARG, bce))
                         return false;
-                    if (!Emit1(cx, bce, JSOP_POP))
+                    if (!bce->emit1(JSOP_POP))
                         return false;
                 }
             }
             if (!EmitDefaults(cx, bce, pn))
                 return false;
             if (fun->hasRest()) {
                 if (restIsDefn && !EmitVarOp(cx, rest, JSOP_SETARG, bce))
                     return false;
-                if (!Emit1(cx, bce, JSOP_POP))
+                if (!bce->emit1(JSOP_POP))
                     return false;
             }
         }
         for (ParseNode *pn2 = pn->pn_head; pn2 != pnlast; pn2 = pn2->pn_next) {
             // Only bind the parameter if it's not aliased by a nested function
             // in the body.
             if (!pn2->isDefn())
                 continue;
             if (!BindNameToSlot(cx, bce, pn2))
                 return false;
             if (pn2->pn_next == pnlast && fun->hasRest() && !hasDefaults) {
                 // Fill rest parameter. We handled the case with defaults above.
                 MOZ_ASSERT(!bce->sc->asFunctionBox()->argumentsHasLocalBinding());
                 bce->switchToProlog();
-                if (!Emit1(cx, bce, JSOP_REST))
+                if (!bce->emit1(JSOP_REST))
                     return false;
                 CheckTypeSet(cx, bce, JSOP_REST);
                 if (!EmitVarOp(cx, pn2, JSOP_SETARG, bce))
                     return false;
-                if (!Emit1(cx, bce, JSOP_POP))
+                if (!bce->emit1(JSOP_POP))
                     return false;
                 bce->switchToMain();
             }
         }
         if (pnlast->pn_xflags & PNX_FUNCDEFS) {
             // This block contains top-level function definitions. To ensure
             // that we emit the bytecode defining them before the rest of code
             // in the block we use a separate pass over functions. During the
@@ -7184,17 +7184,17 @@ frontend::EmitTree(ExclusiveContext *cx,
         ok = EmitReturn(cx, bce, pn);
         break;
 
       case PNK_YIELD_STAR:
         ok = EmitYieldStar(cx, bce, pn->pn_left, pn->pn_right);
         break;
 
       case PNK_GENERATOR:
-        if (!Emit1(cx, bce, JSOP_GENERATOR))
+        if (!bce->emit1(JSOP_GENERATOR))
             return false;
         break;
 
       case PNK_YIELD:
         ok = EmitYield(cx, bce, pn);
         break;
 
       case PNK_STATEMENTLIST:
@@ -7217,17 +7217,17 @@ frontend::EmitTree(ExclusiveContext *cx,
       {
         for (ParseNode *pn2 = pn->pn_head; ; pn2 = pn2->pn_next) {
             if (!UpdateSourceCoordNotes(cx, bce, pn2->pn_pos.begin))
                 return false;
             if (!EmitTree(cx, bce, pn2))
                 return false;
             if (!pn2->pn_next)
                 break;
-            if (!Emit1(cx, bce, JSOP_POP))
+            if (!bce->emit1(JSOP_POP))
                 return false;
         }
         break;
       }
 
       case PNK_ASSIGN:
       case PNK_ADDASSIGN:
       case PNK_SUBASSIGN:
@@ -7278,17 +7278,17 @@ frontend::EmitTree(ExclusiveContext *cx,
         /* Left-associative operator chain: avoid too much recursion. */
         ParseNode *subexpr = pn->pn_head;
         if (!EmitTree(cx, bce, subexpr))
             return false;
         JSOp op = pn->getOp();
         while ((subexpr = subexpr->pn_next) != nullptr) {
             if (!EmitTree(cx, bce, subexpr))
                 return false;
-            if (!Emit1(cx, bce, op))
+            if (!bce->emit1(op))
                 return false;
         }
         break;
       }
 
       case PNK_THROW:
       case PNK_TYPEOF:
       case PNK_VOID:
@@ -7352,17 +7352,17 @@ frontend::EmitTree(ExclusiveContext *cx,
          * under the array initialiser code generator for array comprehension
          * special casing. Note that the array object is a pure stack value,
          * unaliased by blocks, so we can EmitUnaliasedVarOp.
          */
         if (!EmitTree(cx, bce, pn->pn_kid))
             return false;
         if (!EmitDupAt(cx, bce, bce->arrayCompDepth))
             return false;
-        if (!Emit1(cx, bce, JSOP_ARRAYPUSH))
+        if (!bce->emit1(JSOP_ARRAYPUSH))
             return false;
         break;
       }
 
       case PNK_CALLSITEOBJ:
             ok = EmitCallSiteObject(cx, bce, pn);
             break;
 
@@ -7435,24 +7435,24 @@ frontend::EmitTree(ExclusiveContext *cx,
       case PNK_REGEXP:
         ok = EmitRegExp(cx, bce->regexpList.add(pn->as<RegExpLiteral>().objbox()), bce);
         break;
 
       case PNK_TRUE:
       case PNK_FALSE:
       case PNK_THIS:
       case PNK_NULL:
-        if (!Emit1(cx, bce, pn->getOp()))
+        if (!bce->emit1(pn->getOp()))
             return false;
         break;
 
       case PNK_DEBUGGER:
         if (!UpdateSourceCoordNotes(cx, bce, pn->pn_pos.begin))
             return false;
-        if (!Emit1(cx, bce, JSOP_DEBUGGER))
+        if (!bce->emit1(JSOP_DEBUGGER))
             return false;
         break;
 
       case PNK_NOP:
         MOZ_ASSERT(pn->getArity() == PN_NULLARY);
         break;
 
       case PNK_CLASS:
--- a/js/src/frontend/BytecodeEmitter.h
+++ b/js/src/frontend/BytecodeEmitter.h
@@ -247,25 +247,22 @@ struct BytecodeEmitter
     SrcNotesVector &notes() const { return current->notes; }
     ptrdiff_t lastNoteOffset() const { return current->lastNoteOffset; }
     unsigned currentLine() const { return current->currentLine; }
     unsigned lastColumn() const { return current->lastColumn; }
 
     bool reportError(ParseNode *pn, unsigned errorNumber, ...);
     bool reportStrictWarning(ParseNode *pn, unsigned errorNumber, ...);
     bool reportStrictModeError(ParseNode *pn, unsigned errorNumber, ...);
+
+    // Emit one bytecode.
+    bool emit1(JSOp op);
 };
 
 /*
- * Emit one bytecode.
- */
-bool
-Emit1(ExclusiveContext *cx, BytecodeEmitter *bce, JSOp op);
-
-/*
  * Emit two bytecodes, an opcode (op) with a byte of immediate operand (op1).
  */
 bool
 Emit2(ExclusiveContext *cx, BytecodeEmitter *bce, JSOp op, jsbytecode op1);
 
 /*
  * Emit three bytecodes, an opcode with two bytes of immediate operands.
  */