Bug 953284 - Remove JSOP_NOTEARG. r=jandem
authorBenjamin Peterson <benjamin@python.org>
Fri, 27 Dec 2013 15:30:26 -0600
changeset 161820 a0727f8476dcd4b4b61c1dbe658ccf1154fdac48
parent 161819 a3afdb32b40e60ebc144cc035ce8c9c94df2f6a5
child 161821 f90dc83379528b65e3321485c9f5da722131a9f9
push id25905
push userphilringnalda@gmail.com
push dateSat, 28 Dec 2013 02:40:12 +0000
treeherdermozilla-central@fe7f7ead589c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs953284
milestone29.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 953284 - Remove JSOP_NOTEARG. r=jandem
js/src/frontend/BytecodeEmitter.cpp
js/src/jit/BaselineCompiler.cpp
js/src/jit/BaselineCompiler.h
js/src/jit/IonBuilder.cpp
js/src/jsopcode.tbl
js/src/vm/Interpreter.cpp
js/src/vm/Xdr.h
--- a/js/src/frontend/BytecodeEmitter.cpp
+++ b/js/src/frontend/BytecodeEmitter.cpp
@@ -2059,18 +2059,16 @@ EmitNameOp(ExclusiveContext *cx, Bytecod
     if (callContext) {
         if (op == JSOP_CALLNAME && bce->needsImplicitThis()) {
             if (!EmitAtomOp(cx, pn, JSOP_IMPLICITTHIS, bce))
                 return false;
         } else {
             if (Emit1(cx, bce, JSOP_UNDEFINED) < 0)
                 return false;
         }
-        if (Emit1(cx, bce, JSOP_NOTEARG) < 0)
-            return false;
     }
 
     return true;
 }
 
 static bool
 EmitPropLHS(ExclusiveContext *cx, ParseNode *pn, JSOp op, BytecodeEmitter *bce)
 {
@@ -2131,19 +2129,16 @@ EmitPropOp(ExclusiveContext *cx, ParseNo
         return false;
 
     if (!EmitAtomOp(cx, pn, op, bce))
         return false;
 
     if (op == JSOP_CALLPROP && Emit1(cx, bce, JSOP_SWAP) < 0)
         return false;
 
-    if (op == JSOP_CALLPROP && Emit1(cx, bce, JSOP_NOTEARG) < 0)
-        return false;
-
     return true;
 }
 
 static bool
 EmitPropIncDec(ExclusiveContext *cx, ParseNode *pn, BytecodeEmitter *bce)
 {
     JS_ASSERT(pn->pn_kid->getKind() == PNK_DOT);
 
@@ -2243,18 +2238,16 @@ EmitElemOpBase(ExclusiveContext *cx, Byt
 {
     if (Emit1(cx, bce, op) < 0)
         return false;
     CheckTypeSet(cx, bce, op);
 
     if (op == JSOP_CALLELEM) {
         if (Emit1(cx, bce, JSOP_SWAP) < 0)
             return false;
-        if (Emit1(cx, bce, JSOP_NOTEARG) < 0)
-            return false;
     }
     return true;
 }
 
 static bool
 EmitElemOp(ExclusiveContext *cx, ParseNode *pn, JSOp op, BytecodeEmitter *bce)
 {
     return EmitElemOperands(cx, pn, op, bce) && EmitElemOpBase(cx, bce, op);
@@ -4352,18 +4345,16 @@ EmitForOf(ExclusiveContext *cx, Bytecode
 
     // Convert iterable to iterator.
     if (Emit1(cx, bce, JSOP_DUP) < 0)                          // OBJ OBJ
         return false;
     if (!EmitAtomOp(cx, cx->names().std_iterator, JSOP_CALLPROP, bce)) // OBJ @@ITERATOR
         return false;
     if (Emit1(cx, bce, JSOP_SWAP) < 0)                         // @@ITERATOR OBJ
         return false;
-    if (Emit1(cx, bce, JSOP_NOTEARG) < 0)
-        return false;
     if (EmitCall(cx, bce, JSOP_CALL, 0) < 0)                   // ITER
         return false;
     CheckTypeSet(cx, bce, JSOP_CALL);
 
     // Push a dummy result so that we properly enter iteration midstream.
     if (Emit1(cx, bce, JSOP_UNDEFINED) < 0)                    // ITER RESULT
         return false;
 
@@ -4429,22 +4420,18 @@ EmitForOf(ExclusiveContext *cx, Bytecode
     if (Emit1(cx, bce, JSOP_DUP) < 0)                          // ITER ITER
         return false;
     if (Emit1(cx, bce, JSOP_DUP) < 0)                          // ITER ITER ITER
         return false;
     if (!EmitAtomOp(cx, cx->names().next, JSOP_CALLPROP, bce)) // ITER ITER NEXT
         return false;
     if (Emit1(cx, bce, JSOP_SWAP) < 0)                         // ITER NEXT ITER
         return false;
-    if (Emit1(cx, bce, JSOP_NOTEARG) < 0)
-        return false;
     if (Emit1(cx, bce, JSOP_UNDEFINED) < 0)                    // ITER NEXT ITER UNDEFINED
         return false;
-    if (Emit1(cx, bce, JSOP_NOTEARG) < 0)
-        return false;
     if (EmitCall(cx, bce, JSOP_CALL, 1) < 0)                   // ITER RESULT
         return false;
     CheckTypeSet(cx, bce, JSOP_CALL);
     if (Emit1(cx, bce, JSOP_DUP) < 0)                          // ITER RESULT RESULT
         return false;
     if (!EmitAtomOp(cx, cx->names().done, JSOP_GETPROP, bce))  // ITER RESULT DONE?
         return false;
 
@@ -5159,18 +5146,16 @@ EmitYieldStar(ExclusiveContext *cx, Byte
 
     // Convert iterable to iterator.
     if (Emit1(cx, bce, JSOP_DUP) < 0)                            // ITERABLE ITERABLE
         return false;
     if (!EmitAtomOp(cx, cx->names().std_iterator, JSOP_CALLPROP, bce)) // ITERABLE @@ITERATOR
         return false;
     if (Emit1(cx, bce, JSOP_SWAP) < 0)                           // @@ITERATOR ITERABLE
         return false;
-    if (Emit1(cx, bce, JSOP_NOTEARG) < 0)
-        return false;
     if (EmitCall(cx, bce, JSOP_CALL, 0) < 0)                     // ITER
         return false;
     CheckTypeSet(cx, bce, JSOP_CALL);
 
     int depth = bce->stackDepth;
     JS_ASSERT(depth >= 1);
 
     // Initial send value is undefined.
@@ -5231,22 +5216,18 @@ EmitYieldStar(ExclusiveContext *cx, Byte
     if (Emit1(cx, bce, JSOP_DUP) < 0)                            // EXCEPTION ITER ITER
         return false;
     if (Emit1(cx, bce, JSOP_DUP) < 0)                            // 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) < 0)                           // EXCEPTION ITER THROW ITER
         return false;
-    if (Emit1(cx, bce, JSOP_NOTEARG) < 0)                        // EXCEPTION ITER THROW ITER
-        return false;
     if (Emit2(cx, bce, JSOP_PICK, (jsbytecode)3) < 0)            // ITER THROW ITER EXCEPTION
         return false;
-    if (Emit1(cx, bce, JSOP_NOTEARG) < 0)                        // ITER THROW ITER EXCEPTION
-        return false;
     if (EmitCall(cx, bce, JSOP_CALL, 1) < 0)                     // ITER RESULT
         return false;
     CheckTypeSet(cx, bce, JSOP_CALL);
     JS_ASSERT(bce->stackDepth == depth + 1);
     ptrdiff_t checkResult = -1;
     if (EmitBackPatchOp(cx, bce, &checkResult) < 0)              // goto checkResult
         return false;
 
@@ -5272,22 +5253,18 @@ EmitYieldStar(ExclusiveContext *cx, Byte
     if (Emit1(cx, bce, JSOP_DUP) < 0)                            // RECEIVED ITER ITER
         return false;
     if (Emit1(cx, bce, JSOP_DUP) < 0)                            // 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) < 0)                           // RECEIVED ITER NEXT ITER
         return false;
-    if (Emit1(cx, bce, JSOP_NOTEARG) < 0)                        // RECEIVED ITER NEXT ITER
-        return false;
     if (Emit2(cx, bce, JSOP_PICK, (jsbytecode)3) < 0)            // ITER NEXT ITER RECEIVED
         return false;
-    if (Emit1(cx, bce, JSOP_NOTEARG) < 0)                        // ITER NEXT ITER RECEIVED
-        return false;
     if (EmitCall(cx, bce, JSOP_CALL, 1) < 0)                     // ITER RESULT
         return false;
     CheckTypeSet(cx, bce, JSOP_CALL);
     JS_ASSERT(bce->stackDepth == depth + 1);
 
     if (!BackPatch(cx, bce, checkResult, bce->code().end(), JSOP_GOTO)) // checkResult:
         return false;
     // if (!result.done) goto tryStart;                          // ITER RESULT
@@ -5523,25 +5500,21 @@ EmitCallOrNew(ExclusiveContext *cx, Byte
                 return false;
             }
             ParseNode *funNode = pn2->pn_next;
             if (!EmitTree(cx, bce, funNode))
                 return false;
             ParseNode *thisArg = funNode->pn_next;
             if (!EmitTree(cx, bce, thisArg))
                 return false;
-            if (Emit1(cx, bce, JSOP_NOTEARG) < 0)
-                return false;
             bool oldEmittingForInit = bce->emittingForInit;
             bce->emittingForInit = false;
             for (ParseNode *argpn = thisArg->pn_next; argpn; argpn = argpn->pn_next) {
                 if (!EmitTree(cx, bce, argpn))
                     return false;
-                if (Emit1(cx, bce, JSOP_NOTEARG) < 0)
-                    return false;
             }
             bce->emittingForInit = oldEmittingForInit;
             argc -= 2;
             emitArgs = false;
             break;
         }
         if (!EmitNameOp(cx, bce, pn2, callop))
             return false;
@@ -5582,34 +5555,30 @@ EmitCallOrNew(ExclusiveContext *cx, Byte
             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) < 0)
             return false;
-        if (Emit1(cx, bce, JSOP_NOTEARG) < 0)
-            return false;
     }
 
     if (emitArgs) {
         /*
          * 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.
          */
         bool oldEmittingForInit = bce->emittingForInit;
         bce->emittingForInit = false;
         if (!spread) {
             for (ParseNode *pn3 = pn2->pn_next; pn3; pn3 = pn3->pn_next) {
                 if (!EmitTree(cx, bce, pn3))
                     return false;
-                if (Emit1(cx, bce, JSOP_NOTEARG) < 0)
-                    return false;
             }
         } else {
             if (!EmitArray(cx, bce, pn2->pn_next, argc))
                 return false;
         }
         bce->emittingForInit = oldEmittingForInit;
     }
 
--- a/js/src/jit/BaselineCompiler.cpp
+++ b/js/src/jit/BaselineCompiler.cpp
@@ -835,22 +835,16 @@ BaselineCompiler::emit_JSOP_NOP()
 
 bool
 BaselineCompiler::emit_JSOP_LABEL()
 {
     return true;
 }
 
 bool
-BaselineCompiler::emit_JSOP_NOTEARG()
-{
-    return true;
-}
-
-bool
 BaselineCompiler::emit_JSOP_POP()
 {
     frame.pop();
     return true;
 }
 
 bool
 BaselineCompiler::emit_JSOP_POPN()
--- a/js/src/jit/BaselineCompiler.h
+++ b/js/src/jit/BaselineCompiler.h
@@ -19,17 +19,16 @@
 #endif
 
 namespace js {
 namespace jit {
 
 #define OPCODE_LIST(_)         \
     _(JSOP_NOP)                \
     _(JSOP_LABEL)              \
-    _(JSOP_NOTEARG)            \
     _(JSOP_POP)                \
     _(JSOP_POPN)               \
     _(JSOP_POPNV)              \
     _(JSOP_DUP)                \
     _(JSOP_DUP2)               \
     _(JSOP_SWAP)               \
     _(JSOP_PICK)               \
     _(JSOP_GOTO)               \
--- a/js/src/jit/IonBuilder.cpp
+++ b/js/src/jit/IonBuilder.cpp
@@ -1507,19 +1507,16 @@ IonBuilder::inspectOpcode(JSOp op)
         return jsop_arguments();
 
       case JSOP_RUNONCE:
         return jsop_runonce();
 
       case JSOP_REST:
         return jsop_rest();
 
-      case JSOP_NOTEARG:
-        return jsop_notearg();
-
       case JSOP_GETARG:
       case JSOP_CALLARG:
         if (info().argsObjAliasesFormals()) {
             MGetArgumentsObjectArg *getArg = MGetArgumentsObjectArg::New(alloc(),
                                                                          current->argumentsObject(),
                                                                          GET_SLOTNO(pc));
             current->add(getArg);
             current->push(getArg);
@@ -3808,23 +3805,16 @@ IonBuilder::jsop_neg()
 
     MDefinition *right = current->pop();
 
     if (!jsop_binary(JSOP_MUL, negator, right))
         return false;
     return true;
 }
 
-bool
-IonBuilder::jsop_notearg()
-{
-    // :TODO: Remove JSOP_NOTEARG (bug 953284).
-    return true;
-}
-
 class AutoAccumulateReturns
 {
     MIRGraph &graph_;
     MIRGraphReturns *prev_;
 
   public:
     AutoAccumulateReturns(MIRGraph &graph, MIRGraphReturns &returns)
       : graph_(graph)
--- a/js/src/jsopcode.tbl
+++ b/js/src/jsopcode.tbl
@@ -488,24 +488,22 @@ OPDEF(JSOP_IMPLICITTHIS,  226, "implicit
 
 /*
  * This opcode is the target of the entry jump for some loop. The uint8 argument
  * is the loop depth. This value starts at 1 and is just a hint: deeply
  * nested loops all have the same value.
  */
 OPDEF(JSOP_LOOPENTRY,     227, "loopentry",    NULL,  2,  0,  0,  JOF_UINT8)
 
-/* Notes the point at which a value is pushed as an argument. */
-OPDEF(JSOP_NOTEARG,       228, "notearg",      NULL,  1,  0,  0,  JOF_BYTE)
-
 /*
  * Pad out the unused opcode space to the nearest power-of-two boundary. The
  * interpreter uses this to construct a table which is a power-of-two size.
  */
 #ifdef OPPAD
+OPPAD(228)
 OPPAD(229)
 OPPAD(230)
 OPPAD(231)
 OPPAD(232)
 OPPAD(233)
 OPPAD(234)
 OPPAD(235)
 OPPAD(236)
--- a/js/src/vm/Interpreter.cpp
+++ b/js/src/vm/Interpreter.cpp
@@ -1705,19 +1705,16 @@ CASE(JSOP_LOOPENTRY)
                 goto jit_return_pop_frame;
             goto leave_on_safe_point;
         }
     }
 #endif /* JS_ION */
 
 END_CASE(JSOP_LOOPENTRY)
 
-CASE(JSOP_NOTEARG)
-END_CASE(JSOP_NOTEARG)
-
 CASE(JSOP_LINENO)
 END_CASE(JSOP_LINENO)
 
 CASE(JSOP_UNDEFINED)
     PUSH_UNDEFINED();
 END_CASE(JSOP_UNDEFINED)
 
 CASE(JSOP_POP)
--- a/js/src/vm/Xdr.h
+++ b/js/src/vm/Xdr.h
@@ -17,17 +17,17 @@ namespace js {
  * Bytecode version number. Increment the subtrahend whenever JS bytecode
  * changes incompatibly.
  *
  * This version number is XDR'd near the front of xdr bytecode and
  * aborts deserialization if there is a mismatch between the current
  * and saved versions. If deserialization fails, the data should be
  * invalidated if possible.
  */
-static const uint32_t XDR_BYTECODE_VERSION = uint32_t(0xb973c0de - 159);
+static const uint32_t XDR_BYTECODE_VERSION = uint32_t(0xb973c0de - 160);
 
 class XDRBuffer {
   public:
     XDRBuffer(JSContext *cx)
       : context(cx), base(nullptr), cursor(nullptr), limit(nullptr) { }
 
     JSContext *cx() const {
         return context;