Bug 1260577 - followup: Change confusing name SelfAssign to CompoundAssign. (rs=jorendorff)
authorEric Faust <efaustbmo@gmail.com>
Wed, 30 Mar 2016 09:32:30 -0700
changeset 291081 57e8e4c71ecf66ccf431eebf8c88083df266f65c
parent 291080 e45ba191b66a4a74123297dd8e1a93e3f329886e
child 291082 7c4258b493b12d00a89276c41a5f39cdcf28d2fc
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorendorff
bugs1260577
milestone48.0a1
Bug 1260577 - followup: Change confusing name SelfAssign to CompoundAssign. (rs=jorendorff)
js/src/frontend/BytecodeEmitter.cpp
js/src/frontend/BytecodeEmitter.h
--- a/js/src/frontend/BytecodeEmitter.cpp
+++ b/js/src/frontend/BytecodeEmitter.cpp
@@ -2818,17 +2818,17 @@ BytecodeEmitter::emitElemOperands(ParseN
     }
 
     if (!emitTree(pn->pn_right))
         return false;
 
     if (opts == EmitElemOption::Set) {
         if (!emit2(JSOP_PICK, 2))
             return false;
-    } else if (opts == EmitElemOption::IncDec || opts == EmitElemOption::SelfAssign) {
+    } else if (opts == EmitElemOption::IncDec || opts == EmitElemOption::CompoundAssign) {
         if (!emit1(JSOP_TOID))
             return false;
     }
     return true;
 }
 
 bool
 BytecodeEmitter::emitSuperElemOperands(ParseNode* pn, EmitElemOption opts)
@@ -2840,17 +2840,17 @@ BytecodeEmitter::emitSuperElemOperands(P
     // Since JSOP_THIS might throw in derived class constructors, we cannot
     // just push it earlier as the receiver. We have to swap it down instead.
 
     if (!emitTree(pn->pn_right))
         return false;
 
     // 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.
-    if (opts == EmitElemOption::IncDec || opts == EmitElemOption::SelfAssign) {
+    if (opts == EmitElemOption::IncDec || opts == EmitElemOption::CompoundAssign) {
         if (!emit1(JSOP_TOID))
             return false;
     }
 
     if (!emitGetThisForSuperBase(pn->pn_left))
         return false;
 
     if (opts == EmitElemOption::Call) {
@@ -4603,17 +4603,17 @@ BytecodeEmitter::emitAssignment(ParseNod
                 return false;
             offset += 1;
         }
         if (!makeAtomIndex(lhs->pn_atom, &atomIndex))
             return false;
         break;
       case PNK_ELEM: {
         MOZ_ASSERT(lhs->isArity(PN_BINARY));
-        EmitElemOption opt = op == JSOP_NOP ? EmitElemOption::Get : EmitElemOption::SelfAssign;
+        EmitElemOption opt = op == JSOP_NOP ? EmitElemOption::Get : EmitElemOption::CompoundAssign;
         if (lhs->as<PropertyByValue>().isSuper()) {
             if (!emitSuperElemOperands(lhs, opt))
                 return false;
             offset += 3;
         } else {
             if (!emitElemOperands(lhs, opt))
                 return false;
             offset += 2;
--- a/js/src/frontend/BytecodeEmitter.h
+++ b/js/src/frontend/BytecodeEmitter.h
@@ -514,17 +514,17 @@ struct BytecodeEmitter
     bool emitPropOp(ParseNode* pn, JSOp op);
     bool emitPropIncDec(ParseNode* pn);
 
     bool emitComputedPropertyName(ParseNode* computedPropName);
 
     // 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.
-    enum class EmitElemOption { Get, Set, Call, IncDec, SelfAssign };
+    enum class EmitElemOption { Get, Set, Call, IncDec, CompoundAssign };
     bool emitElemOperands(ParseNode* pn, EmitElemOption opts);
 
     bool emitElemOpBase(JSOp op);
     bool emitElemOp(ParseNode* pn, JSOp op);
     bool emitElemIncDec(ParseNode* pn);
 
     bool emitCatch(ParseNode* pn);
     bool emitIf(ParseNode* pn);