From 6fc725e2e5c66b6aea6c79443be92f72a8d2ded8 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Fri, 27 Dec 2013 15:30:26 -0600 Subject: [PATCH] Bug 953284 - Remove JSOP_NOTEARG. r=jandem --- js/src/frontend/BytecodeEmitter.cpp | 31 ----------------------------- js/src/jit/BaselineCompiler.cpp | 6 ------ js/src/jit/BaselineCompiler.h | 1 - js/src/jit/IonBuilder.cpp | 10 ---------- js/src/jsopcode.tbl | 4 +--- js/src/vm/Interpreter.cpp | 3 --- js/src/vm/Xdr.h | 2 +- 7 files changed, 2 insertions(+), 55 deletions(-) diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitter.cpp index 51f39034c3e5..ddad6bb9a815 100644 --- a/js/src/frontend/BytecodeEmitter.cpp +++ b/js/src/frontend/BytecodeEmitter.cpp @@ -2064,8 +2064,6 @@ EmitNameOp(ExclusiveContext *cx, BytecodeEmitter *bce, ParseNode *pn, bool callC if (Emit1(cx, bce, JSOP_UNDEFINED) < 0) return false; } - if (Emit1(cx, bce, JSOP_NOTEARG) < 0) - return false; } return true; @@ -2136,9 +2134,6 @@ EmitPropOp(ExclusiveContext *cx, ParseNode *pn, JSOp op, BytecodeEmitter *bce) 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; } @@ -2248,8 +2243,6 @@ EmitElemOpBase(ExclusiveContext *cx, BytecodeEmitter *bce, JSOp 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; } @@ -4357,8 +4350,6 @@ EmitForOf(ExclusiveContext *cx, BytecodeEmitter *bce, ParseNode *pn, ptrdiff_t t 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); @@ -4434,12 +4425,8 @@ EmitForOf(ExclusiveContext *cx, BytecodeEmitter *bce, ParseNode *pn, ptrdiff_t t 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); @@ -5164,8 +5151,6 @@ EmitYieldStar(ExclusiveContext *cx, BytecodeEmitter *bce, ParseNode *iter) 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); @@ -5236,12 +5221,8 @@ EmitYieldStar(ExclusiveContext *cx, BytecodeEmitter *bce, ParseNode *iter) 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); @@ -5277,12 +5258,8 @@ EmitYieldStar(ExclusiveContext *cx, BytecodeEmitter *bce, ParseNode *iter) 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); @@ -5528,15 +5505,11 @@ EmitCallOrNew(ExclusiveContext *cx, BytecodeEmitter *bce, ParseNode *pn) 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; @@ -5587,8 +5560,6 @@ EmitCallOrNew(ExclusiveContext *cx, BytecodeEmitter *bce, ParseNode *pn) 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) { @@ -5603,8 +5574,6 @@ EmitCallOrNew(ExclusiveContext *cx, BytecodeEmitter *bce, ParseNode *pn) 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)) diff --git a/js/src/jit/BaselineCompiler.cpp b/js/src/jit/BaselineCompiler.cpp index a37c00a458a9..e7ba329e64a1 100644 --- a/js/src/jit/BaselineCompiler.cpp +++ b/js/src/jit/BaselineCompiler.cpp @@ -839,12 +839,6 @@ BaselineCompiler::emit_JSOP_LABEL() return true; } -bool -BaselineCompiler::emit_JSOP_NOTEARG() -{ - return true; -} - bool BaselineCompiler::emit_JSOP_POP() { diff --git a/js/src/jit/BaselineCompiler.h b/js/src/jit/BaselineCompiler.h index 7672be2afe57..2046fb1ed522 100644 --- a/js/src/jit/BaselineCompiler.h +++ b/js/src/jit/BaselineCompiler.h @@ -24,7 +24,6 @@ namespace jit { #define OPCODE_LIST(_) \ _(JSOP_NOP) \ _(JSOP_LABEL) \ - _(JSOP_NOTEARG) \ _(JSOP_POP) \ _(JSOP_POPN) \ _(JSOP_POPNV) \ diff --git a/js/src/jit/IonBuilder.cpp b/js/src/jit/IonBuilder.cpp index 6f5cdd4d0f33..3f89db061f1c 100644 --- a/js/src/jit/IonBuilder.cpp +++ b/js/src/jit/IonBuilder.cpp @@ -1512,9 +1512,6 @@ IonBuilder::inspectOpcode(JSOp op) case JSOP_REST: return jsop_rest(); - case JSOP_NOTEARG: - return jsop_notearg(); - case JSOP_GETARG: case JSOP_CALLARG: if (info().argsObjAliasesFormals()) { @@ -3813,13 +3810,6 @@ IonBuilder::jsop_neg() return true; } -bool -IonBuilder::jsop_notearg() -{ - // :TODO: Remove JSOP_NOTEARG (bug 953284). - return true; -} - class AutoAccumulateReturns { MIRGraph &graph_; diff --git a/js/src/jsopcode.tbl b/js/src/jsopcode.tbl index df811fa1dab8..4adb69bf3750 100644 --- a/js/src/jsopcode.tbl +++ b/js/src/jsopcode.tbl @@ -493,14 +493,12 @@ OPDEF(JSOP_IMPLICITTHIS, 226, "implicitthis", "", 5, 0, 1, JOF_ATOM) */ 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) diff --git a/js/src/vm/Interpreter.cpp b/js/src/vm/Interpreter.cpp index 8d28cddd55fa..5b9682053d55 100644 --- a/js/src/vm/Interpreter.cpp +++ b/js/src/vm/Interpreter.cpp @@ -1710,9 +1710,6 @@ CASE(JSOP_LOOPENTRY) END_CASE(JSOP_LOOPENTRY) -CASE(JSOP_NOTEARG) -END_CASE(JSOP_NOTEARG) - CASE(JSOP_LINENO) END_CASE(JSOP_LINENO) diff --git a/js/src/vm/Xdr.h b/js/src/vm/Xdr.h index ed80e6238bd0..a64d762d50fb 100644 --- a/js/src/vm/Xdr.h +++ b/js/src/vm/Xdr.h @@ -22,7 +22,7 @@ namespace js { * 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: