Bug 1398768 part 11 - Remove JSOP_SPREADCALLARRAY and just use JSOP_NEWARRAY again. r=evilpie

--HG--
extra : rebase_source : 7635e07892c2a93baea5025fb7436250a1a2e2bf
This commit is contained in:
Jan de Mooij 2017-10-01 11:37:46 +02:00
parent 3eb82c60ee
commit c54af726e3
8 changed files with 10 additions and 30 deletions

View File

@ -9628,7 +9628,7 @@ BytecodeEmitter::emitCallOrNew(ParseNode* pn, ValueUsage valueUsage /* = ValueUs
return false;
}
if (!emitArray(args, argc, JSOP_SPREADCALLARRAY))
if (!emitArray(args, argc))
return false;
if (emitOptCode) {
@ -10141,11 +10141,11 @@ BytecodeEmitter::emitArrayLiteral(ParseNode* pn)
}
}
return emitArray(pn->pn_head, pn->pn_count, JSOP_NEWARRAY);
return emitArray(pn->pn_head, pn->pn_count);
}
bool
BytecodeEmitter::emitArray(ParseNode* pn, uint32_t count, JSOp op)
BytecodeEmitter::emitArray(ParseNode* pn, uint32_t count)
{
/*
@ -10156,7 +10156,6 @@ BytecodeEmitter::emitArray(ParseNode* pn, uint32_t count, JSOp op)
* to avoid dup'ing and popping the array as each element is added, as
* JSOP_SETELEM/JSOP_SETPROP would do.
*/
MOZ_ASSERT(op == JSOP_NEWARRAY || op == JSOP_SPREADCALLARRAY);
uint32_t nspread = 0;
for (ParseNode* elt = pn; elt; elt = elt->pn_next) {
@ -10177,7 +10176,7 @@ BytecodeEmitter::emitArray(ParseNode* pn, uint32_t count, JSOp op)
// For arrays with spread, this is a very pessimistic allocation, the
// minimum possible final size.
if (!emitUint32Operand(op, count - nspread)) // ARRAY
if (!emitUint32Operand(JSOP_NEWARRAY, count - nspread)) // ARRAY
return false;
ParseNode* pn2 = pn;

View File

@ -551,7 +551,7 @@ struct MOZ_STACK_CLASS BytecodeEmitter
MOZ_MUST_USE bool emitAtomOp(ParseNode* pn, JSOp op);
MOZ_MUST_USE bool emitArrayLiteral(ParseNode* pn);
MOZ_MUST_USE bool emitArray(ParseNode* pn, uint32_t count, JSOp op);
MOZ_MUST_USE bool emitArray(ParseNode* pn, uint32_t count);
MOZ_MUST_USE bool emitArrayComp(ParseNode* pn);
MOZ_MUST_USE bool emitInternedScopeOp(uint32_t index, JSOp op);

View File

@ -1022,6 +1022,7 @@ BaselineCompiler::emitBody()
// Intentionally not implemented.
case JSOP_SETINTRINSIC:
// Run-once opcode during self-hosting initialization.
case JSOP_UNUSED126:
case JSOP_UNUSED223:
case JSOP_LIMIT:
// === !! WARNING WARNING WARNING !! ===
@ -2087,12 +2088,6 @@ BaselineCompiler::emit_JSOP_NEWARRAY()
return true;
}
bool
BaselineCompiler::emit_JSOP_SPREADCALLARRAY()
{
return emit_JSOP_NEWARRAY();
}
typedef ArrayObject* (*NewArrayCopyOnWriteFn)(JSContext*, HandleArrayObject, gc::InitialHeap);
const VMFunction jit::NewArrayCopyOnWriteInfo =
FunctionInfo<NewArrayCopyOnWriteFn>(js::NewDenseCopyOnWriteArray, "NewDenseCopyOnWriteArray");

View File

@ -101,7 +101,6 @@ namespace jit {
_(JSOP_BITNOT) \
_(JSOP_NEG) \
_(JSOP_NEWARRAY) \
_(JSOP_SPREADCALLARRAY) \
_(JSOP_NEWARRAY_COPYONWRITE) \
_(JSOP_INITELEM_ARRAY) \
_(JSOP_NEWOBJECT) \

View File

@ -2001,7 +2001,6 @@ IonBuilder::inspectOpcode(JSOp op)
return jsop_newobject();
case JSOP_NEWARRAY:
case JSOP_SPREADCALLARRAY:
return jsop_newarray(GET_UINT32(pc));
case JSOP_NEWARRAY_COPYONWRITE:
@ -2448,6 +2447,7 @@ IonBuilder::inspectOpcode(JSOp op)
// Intentionally not implemented.
break;
case JSOP_UNUSED126:
case JSOP_UNUSED223:
case JSOP_LIMIT:
break;
@ -5179,7 +5179,7 @@ IonBuilder::jsop_funapply(uint32_t argc)
AbortReasonOr<Ok>
IonBuilder::jsop_spreadcall()
{
// The arguments array is constructed by a JSOP_SPREADCALLARRAY and not
// The arguments array is constructed by a JSOP_NEWARRAY and not
// leaked to user. The complications of spread call iterator behaviour are
// handled when the user objects are expanded and copied into this hidden
// array.

View File

@ -2029,9 +2029,6 @@ ExpressionDecompiler::decompilePC(jsbytecode* pc, uint8_t defIndex)
case JSOP_RESUME:
return write("RVAL");
case JSOP_SPREADCALLARRAY:
return write("[]");
case JSOP_SUPERBASE:
return write("HOMEOBJECTPROTO");

View File

@ -2005,6 +2005,7 @@ CASE(JSOP_NOP)
CASE(JSOP_NOP_DESTRUCTURING)
CASE(JSOP_TRY_DESTRUCTURING_ITERCLOSE)
CASE(JSOP_ITERNEXT)
CASE(JSOP_UNUSED126)
CASE(JSOP_UNUSED223)
CASE(JSOP_CONDSWITCH)
{
@ -3752,7 +3753,6 @@ CASE(JSOP_NEWINIT)
END_CASE(JSOP_NEWINIT)
CASE(JSOP_NEWARRAY)
CASE(JSOP_SPREADCALLARRAY)
{
uint32_t length = GET_UINT32(REGS.pc);
JSObject* obj = NewArrayOperation(cx, script, REGS.pc, length);

View File

@ -1282,17 +1282,7 @@
* Stack: propval, receiver, obj => obj[propval]
*/ \
macro(JSOP_GETELEM_SUPER, 125, "getelem-super", NULL, 1, 3, 1, JOF_BYTE|JOF_ELEM|JOF_TYPESET|JOF_LEFTASSOC) \
/*
* Pushes newly created array for a spread call onto the stack. This has
* the same semantics as JSOP_NEWARRAY, but is distinguished to avoid
* using unboxed arrays in spread calls, which would make compiling spread
* calls in baseline more complex.
* Category: Literals
* Type: Array
* Operands: uint32_t length
* Stack: => obj
*/ \
macro(JSOP_SPREADCALLARRAY, 126, "spreadcallarray", NULL, 5, 0, 1, JOF_UINT32) \
macro(JSOP_UNUSED126, 126, "unused126", NULL, 5, 0, 1, JOF_UINT32) \
\
/*
* Defines the given function on the current scope.