Bug 1217001 - Part 10: Delete redundant boolean argument. r=shu.
authorJason Orendorff <jorendorff@mozilla.com>
Wed, 14 Oct 2015 18:54:19 -0500
changeset 305303 8bb80a132a0c33b0abb63b9026888e615ae712ae
parent 305302 f7d59de65bcd8300135a7abbd1aef8fb4a526592
child 305304 119bb65c0ae504029651c622134906a787cbdc8b
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersshu
bugs1217001
milestone44.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 1217001 - Part 10: Delete redundant boolean argument. r=shu.
js/src/frontend/BytecodeEmitter.cpp
js/src/frontend/BytecodeEmitter.h
--- a/js/src/frontend/BytecodeEmitter.cpp
+++ b/js/src/frontend/BytecodeEmitter.cpp
@@ -4211,20 +4211,19 @@ BytecodeEmitter::emitTemplateString(Pars
         if (!emitAtomOp(cx->names().empty, JSOP_STRING))
             return false;
     }
 
     return true;
 }
 
 bool
-BytecodeEmitter::emitVariables(ParseNode* pn, VarEmitOption emitOption, bool isLetExpr)
+BytecodeEmitter::emitVariables(ParseNode* pn, VarEmitOption emitOption)
 {
     MOZ_ASSERT(pn->isArity(PN_LIST));
-    MOZ_ASSERT(isLetExpr == (emitOption == PushInitialValues));
 
     ParseNode* next;
     for (ParseNode* binding = pn->pn_head; binding; binding = next) {
         if (!updateSourceCoordNotes(binding->pn_pos.begin))
             return false;
         next = binding->pn_next;
 
         ParseNode* initializer;
@@ -4285,17 +4284,17 @@ BytecodeEmitter::emitVariables(ParseNode
 
             initializer = binding->pn_left;
             if (!emitDestructuringDecls(pn->getOp(), initializer))
                 return false;
 
             if (!emitTree(binding->pn_right))
                 return false;
 
-            if (!emitDestructuringOps(initializer, isLetExpr))
+            if (!emitDestructuringOpsHelper(initializer, emitOption))
                 return false;
 
             if (emitOption == InitializeVars) {
                 if (!emit1(JSOP_POP))
                     return false;
             }
         } else {
             /*
@@ -4340,17 +4339,20 @@ BytecodeEmitter::emitVariables(ParseNode
                         return false;
                 }
 
                 bool oldEmittingForInit = emittingForInit;
                 emittingForInit = false;
                 if (!emitTree(initializer))
                     return false;
                 emittingForInit = oldEmittingForInit;
-            } else if (op == JSOP_INITLEXICAL || op == JSOP_INITGLEXICAL || isLetExpr) {
+            } else if (op == JSOP_INITLEXICAL ||
+                       op == JSOP_INITGLEXICAL ||
+                       emitOption == PushInitialValues)
+            {
                 // 'let' bindings cannot be used before they are
                 // initialized. JSOP_INITLEXICAL distinguishes the binding site.
                 MOZ_ASSERT(emitOption != DefineVars);
                 if (!emit1(JSOP_UNDEFINED))
                     return false;
             }
 
             // If we are not initializing, nothing to pop. If we are initializing
@@ -5168,17 +5170,17 @@ BytecodeEmitter::emitLetBlock(ParseNode*
     MOZ_ASSERT(pnLet->isArity(PN_BINARY));
     ParseNode* varList = pnLet->pn_left;
     MOZ_ASSERT(varList->isArity(PN_LIST));
     ParseNode* letBody = pnLet->pn_right;
     MOZ_ASSERT(letBody->isLexical() && letBody->isKind(PNK_LEXICALSCOPE));
 
     int letHeadDepth = this->stackDepth;
 
-    if (!emitVariables(varList, PushInitialValues, true))
+    if (!emitVariables(varList, PushInitialValues))
         return false;
 
     /* Push storage for hoisted let decls (e.g. 'let (x) { let y }'). */
     uint32_t valuesPushed = this->stackDepth - letHeadDepth;
     StmtInfoBCE stmtInfo(cx);
     if (!enterBlockScope(&stmtInfo, letBody->pn_objbox, JSOP_UNINITIALIZED, valuesPushed))
         return false;
 
--- a/js/src/frontend/BytecodeEmitter.h
+++ b/js/src/frontend/BytecodeEmitter.h
@@ -464,17 +464,17 @@ struct BytecodeEmitter
 
     bool emitVarOp(ParseNode* pn, JSOp op);
     bool emitVarIncDec(ParseNode* pn);
 
     bool emitNameOp(ParseNode* pn, bool callContext);
     bool emitNameIncDec(ParseNode* pn);
 
     bool maybeEmitVarDecl(JSOp prologueOp, ParseNode* pn, jsatomid* result);
-    bool emitVariables(ParseNode* pn, VarEmitOption emitOption, bool isLetExpr = false);
+    bool emitVariables(ParseNode* pn, VarEmitOption emitOption);
 
     bool emitNewInit(JSProtoKey key);
     bool emitSingletonInitialiser(ParseNode* pn);
 
     bool emitPrepareIteratorResult();
     bool emitFinishIteratorResult(bool done);
     bool iteratorResultShape(unsigned* shape);