mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-21 22:57:31 +09:00
Remove JSOP_SPREADCALLARRAY and just use JSOP_NEWARRAY again.
This commit is contained in:
parent
1d499496a2
commit
a6bb928fa4
7 changed files with 9 additions and 25 deletions
|
|
@ -9192,7 +9192,7 @@ BytecodeEmitter::emitCallOrNew(ParseNode* pn)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!emitArray(args, argc, JSOP_SPREADCALLARRAY))
|
if (!emitArray(args, argc))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (optCodeEmitted) {
|
if (optCodeEmitted) {
|
||||||
|
|
@ -9683,11 +9683,11 @@ BytecodeEmitter::emitArrayLiteral(ParseNode* pn)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return emitArray(pn->pn_head, pn->pn_count, JSOP_NEWARRAY);
|
return emitArray(pn->pn_head, pn->pn_count);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
BytecodeEmitter::emitArray(ParseNode* pn, uint32_t count, JSOp op)
|
BytecodeEmitter::emitArray(ParseNode* pn, uint32_t count)
|
||||||
{
|
{
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -9698,7 +9698,6 @@ BytecodeEmitter::emitArray(ParseNode* pn, uint32_t count, JSOp op)
|
||||||
* to avoid dup'ing and popping the array as each element is added, as
|
* to avoid dup'ing and popping the array as each element is added, as
|
||||||
* JSOP_SETELEM/JSOP_SETPROP would do.
|
* JSOP_SETELEM/JSOP_SETPROP would do.
|
||||||
*/
|
*/
|
||||||
MOZ_ASSERT(op == JSOP_NEWARRAY || op == JSOP_SPREADCALLARRAY);
|
|
||||||
|
|
||||||
uint32_t nspread = 0;
|
uint32_t nspread = 0;
|
||||||
for (ParseNode* elt = pn; elt; elt = elt->pn_next) {
|
for (ParseNode* elt = pn; elt; elt = elt->pn_next) {
|
||||||
|
|
@ -9719,7 +9718,7 @@ BytecodeEmitter::emitArray(ParseNode* pn, uint32_t count, JSOp op)
|
||||||
|
|
||||||
// For arrays with spread, this is a very pessimistic allocation, the
|
// For arrays with spread, this is a very pessimistic allocation, the
|
||||||
// minimum possible final size.
|
// minimum possible final size.
|
||||||
if (!emitUint32Operand(op, count - nspread)) // ARRAY
|
if (!emitUint32Operand(JSOP_NEWARRAY, count - nspread)) // ARRAY
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
ParseNode* pn2 = pn;
|
ParseNode* pn2 = pn;
|
||||||
|
|
|
||||||
|
|
@ -521,7 +521,7 @@ struct MOZ_STACK_CLASS BytecodeEmitter
|
||||||
MOZ_MUST_USE bool emitAtomOp(ParseNode* pn, JSOp op);
|
MOZ_MUST_USE bool emitAtomOp(ParseNode* pn, JSOp op);
|
||||||
|
|
||||||
MOZ_MUST_USE bool emitArrayLiteral(ParseNode* pn);
|
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 emitArrayComp(ParseNode* pn);
|
||||||
|
|
||||||
MOZ_MUST_USE bool emitInternedScopeOp(uint32_t index, JSOp op);
|
MOZ_MUST_USE bool emitInternedScopeOp(uint32_t index, JSOp op);
|
||||||
|
|
|
||||||
|
|
@ -2049,12 +2049,6 @@ BaselineCompiler::emit_JSOP_NEWARRAY()
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
|
||||||
BaselineCompiler::emit_JSOP_SPREADCALLARRAY()
|
|
||||||
{
|
|
||||||
return emit_JSOP_NEWARRAY();
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef ArrayObject* (*NewArrayCopyOnWriteFn)(JSContext*, HandleArrayObject, gc::InitialHeap);
|
typedef ArrayObject* (*NewArrayCopyOnWriteFn)(JSContext*, HandleArrayObject, gc::InitialHeap);
|
||||||
const VMFunction jit::NewArrayCopyOnWriteInfo =
|
const VMFunction jit::NewArrayCopyOnWriteInfo =
|
||||||
FunctionInfo<NewArrayCopyOnWriteFn>(js::NewDenseCopyOnWriteArray, "NewDenseCopyOnWriteArray");
|
FunctionInfo<NewArrayCopyOnWriteFn>(js::NewDenseCopyOnWriteArray, "NewDenseCopyOnWriteArray");
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,6 @@ namespace jit {
|
||||||
_(JSOP_BITNOT) \
|
_(JSOP_BITNOT) \
|
||||||
_(JSOP_NEG) \
|
_(JSOP_NEG) \
|
||||||
_(JSOP_NEWARRAY) \
|
_(JSOP_NEWARRAY) \
|
||||||
_(JSOP_SPREADCALLARRAY) \
|
|
||||||
_(JSOP_NEWARRAY_COPYONWRITE) \
|
_(JSOP_NEWARRAY_COPYONWRITE) \
|
||||||
_(JSOP_INITELEM_ARRAY) \
|
_(JSOP_INITELEM_ARRAY) \
|
||||||
_(JSOP_NEWOBJECT) \
|
_(JSOP_NEWOBJECT) \
|
||||||
|
|
|
||||||
|
|
@ -2218,6 +2218,8 @@ IonBuilder::inspectOpcode(JSOp op)
|
||||||
// update that stale value.
|
// update that stale value.
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
|
// Any unused opcodes and JSOP_LIMIT will end up here without having
|
||||||
|
// to explicitly specify
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1916,6 +1916,7 @@ CASE(EnableInterruptsPseudoOpcode)
|
||||||
/* Various 1-byte no-ops. */
|
/* Various 1-byte no-ops. */
|
||||||
CASE(JSOP_NOP)
|
CASE(JSOP_NOP)
|
||||||
CASE(JSOP_NOP_DESTRUCTURING)
|
CASE(JSOP_NOP_DESTRUCTURING)
|
||||||
|
CASE(JSOP_UNUSED126)
|
||||||
CASE(JSOP_UNUSED192)
|
CASE(JSOP_UNUSED192)
|
||||||
CASE(JSOP_UNUSED209)
|
CASE(JSOP_UNUSED209)
|
||||||
CASE(JSOP_UNUSED210)
|
CASE(JSOP_UNUSED210)
|
||||||
|
|
@ -3636,7 +3637,6 @@ CASE(JSOP_NEWINIT)
|
||||||
END_CASE(JSOP_NEWINIT)
|
END_CASE(JSOP_NEWINIT)
|
||||||
|
|
||||||
CASE(JSOP_NEWARRAY)
|
CASE(JSOP_NEWARRAY)
|
||||||
CASE(JSOP_SPREADCALLARRAY)
|
|
||||||
{
|
{
|
||||||
uint32_t length = GET_UINT32(REGS.pc);
|
uint32_t length = GET_UINT32(REGS.pc);
|
||||||
JSObject* obj = NewArrayOperation(cx, script, REGS.pc, length);
|
JSObject* obj = NewArrayOperation(cx, script, REGS.pc, length);
|
||||||
|
|
|
||||||
|
|
@ -1281,17 +1281,7 @@
|
||||||
* Stack: receiver, obj, propval => obj[propval]
|
* Stack: receiver, obj, propval => obj[propval]
|
||||||
*/ \
|
*/ \
|
||||||
macro(JSOP_GETELEM_SUPER, 125, "getelem-super", NULL, 1, 3, 1, JOF_BYTE |JOF_ELEM|JOF_LEFTASSOC) \
|
macro(JSOP_GETELEM_SUPER, 125, "getelem-super", NULL, 1, 3, 1, JOF_BYTE |JOF_ELEM|JOF_LEFTASSOC) \
|
||||||
/*
|
macro(JSOP_UNUSED126, 126, "unused126", NULL, 5, 0, 1, JOF_UINT32) \
|
||||||
* 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) \
|
|
||||||
\
|
\
|
||||||
/*
|
/*
|
||||||
* Defines the given function on the current scope.
|
* Defines the given function on the current scope.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue