1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:18:12 +00:00

LibJS/JIT: Compile the Call bytecode instruction

I've left a FIXME about dealing with some throwsy cases.
This commit is contained in:
Andreas Kling 2023-10-20 13:32:59 +02:00
parent 7fc35fde09
commit 640455b1d2
5 changed files with 43 additions and 12 deletions

View file

@ -1147,7 +1147,7 @@ ThrowCompletionOr<void> Call::execute_impl(Bytecode::Interpreter& interpreter) c
for (u32 i = 0; i < m_argument_count; ++i) {
argument_values.unchecked_append(interpreter.reg(Register { m_first_argument.index() + i }));
}
interpreter.accumulator() = TRY(perform_call(interpreter, *this, callee, move(argument_values)));
interpreter.accumulator() = TRY(perform_call(interpreter, interpreter.reg(m_this_value), call_type(), callee, move(argument_values)));
return {};
}
@ -1156,7 +1156,7 @@ ThrowCompletionOr<void> CallWithArgumentArray::execute_impl(Bytecode::Interprete
auto callee = interpreter.reg(m_callee);
TRY(throw_if_needed_for_call(interpreter, *this, callee));
auto argument_values = argument_list_evaluation(interpreter);
interpreter.accumulator() = TRY(perform_call(interpreter, *this, callee, move(argument_values)));
interpreter.accumulator() = TRY(perform_call(interpreter, interpreter.reg(m_this_value), call_type(), callee, move(argument_values)));
return {};
}