Skip to content

Commit

Permalink
Update opcode for bug 1760989
Browse files Browse the repository at this point in the history
  • Loading branch information
arai-a committed Mar 30, 2022
1 parent 65dda10 commit d5aabc4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
8 changes: 1 addition & 7 deletions crates/emitter/src/emitter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,7 @@ impl InstructionWriter {
| Opcode::CallIgnoresRv
| Opcode::Eval
| Opcode::CallIter
| Opcode::StrictEval
| Opcode::FunCall => {
| Opcode::StrictEval => {
// callee, this, arguments...
2 + (argc as usize)
}
Expand Down Expand Up @@ -789,11 +788,6 @@ impl InstructionWriter {
self.write_u16(argc);
}

pub fn fun_call(&mut self, argc: u16) {
self.emit_argc_op(Opcode::FunCall, argc);
self.write_u16(argc);
}

pub fn call_ignores_rv(&mut self, argc: u16) {
self.emit_argc_op(Opcode::CallIgnoresRv, argc);
self.write_u16(argc);
Expand Down
7 changes: 2 additions & 5 deletions crates/stencil/src/copy/Opcodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -1739,9 +1739,6 @@
* iterable") rather than `JSMSG_NOT_FUNCTION` ("x[Symbol.iterator] is not
* a function"). The `argc` operand must be 0 for this variation.
*
* `JSOp::FunCall` hints to the VM that the callee is likely
* `Function.prototype.call`.
*
* `JSOp::CallIgnoresRv` hints to the VM that the return value is ignored.
* This allows alternate faster implementations to be used that avoid
* unnecesary allocations.
Expand All @@ -1757,7 +1754,6 @@
*/ \
MACRO(Call, call, NULL, 3, -1, 1, JOF_ARGC|JOF_INVOKE|JOF_IC) \
MACRO(CallIter, call_iter, NULL, 3, -1, 1, JOF_ARGC|JOF_INVOKE|JOF_IC) \
MACRO(FunCall, fun_call, NULL, 3, -1, 1, JOF_ARGC|JOF_INVOKE|JOF_IC) \
MACRO(CallIgnoresRv, call_ignores_rv, NULL, 3, -1, 1, JOF_ARGC|JOF_INVOKE|JOF_IC) \
/*
* Like `JSOp::Call`, but the arguments are provided in an array rather than
Expand Down Expand Up @@ -3541,13 +3537,14 @@
* a power of two. Use this macro to do so.
*/
#define FOR_EACH_TRAILING_UNUSED_OPCODE(MACRO) \
IF_RECORD_TUPLE(/* empty */, MACRO(225)) \
IF_RECORD_TUPLE(/* empty */, MACRO(226)) \
IF_RECORD_TUPLE(/* empty */, MACRO(227)) \
IF_RECORD_TUPLE(/* empty */, MACRO(228)) \
IF_RECORD_TUPLE(/* empty */, MACRO(229)) \
IF_RECORD_TUPLE(/* empty */, MACRO(230)) \
IF_RECORD_TUPLE(/* empty */, MACRO(231)) \
IF_RECORD_TUPLE(/* empty */, MACRO(232)) \
MACRO(232) \
MACRO(233) \
MACRO(234) \
MACRO(235) \
Expand Down
1 change: 0 additions & 1 deletion crates/stencil/src/opcode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ macro_rules! using_opcode_database {
(BuiltinObject, builtin_object, NULL, 2, 0, 1, JOF_UINT8),
(Call, call, NULL, 3, -1, 1, JOF_ARGC|JOF_INVOKE|JOF_IC),
(CallIter, call_iter, NULL, 3, -1, 1, JOF_ARGC|JOF_INVOKE|JOF_IC),
(FunCall, fun_call, NULL, 3, -1, 1, JOF_ARGC|JOF_INVOKE|JOF_IC),
(CallIgnoresRv, call_ignores_rv, NULL, 3, -1, 1, JOF_ARGC|JOF_INVOKE|JOF_IC),
(SpreadCall, spread_call, NULL, 1, 3, 1, JOF_BYTE|JOF_INVOKE|JOF_SPREAD|JOF_IC),
(OptimizeSpreadCall, optimize_spread_call, NULL, 1, 1, 1, JOF_BYTE|JOF_IC),
Expand Down

0 comments on commit d5aabc4

Please sign in to comment.