LibJS/Bytecode: Remove exception checks from Return/Await/Yield

These instructions can't throw anyway.
This commit is contained in:
Andreas Kling 2024-05-10 07:45:51 +02:00 committed by Alexander Kalenik
commit 3e1a6fca91
Notes: sideshowbarker 2024-07-17 07:09:53 +09:00

View file

@ -630,37 +630,19 @@ FLATTEN_ON_CLANG void Interpreter::run_bytecode(size_t entry_point)
handle_Await: {
auto& instruction = *reinterpret_cast<Op::Await const*>(&bytecode[program_counter]);
auto result = instruction.execute_impl(*this);
if (result.is_error()) {
if (handle_exception(program_counter, *result.throw_completion().value()) == HandleExceptionResponse::ExitFromExecutable)
return;
goto start;
}
(void)instruction.execute_impl(*this);
goto may_return;
}
handle_Return: {
auto& instruction = *reinterpret_cast<Op::Return const*>(&bytecode[program_counter]);
auto result = instruction.execute_impl(*this);
if (result.is_error()) {
if (handle_exception(program_counter, *result.throw_completion().value()) == HandleExceptionResponse::ExitFromExecutable)
return;
goto start;
}
(void)instruction.execute_impl(*this);
goto may_return;
}
handle_Yield: {
auto& instruction = *reinterpret_cast<Op::Yield const*>(&bytecode[program_counter]);
auto result = instruction.execute_impl(*this);
if (result.is_error()) {
if (handle_exception(program_counter, *result.throw_completion().value()) == HandleExceptionResponse::ExitFromExecutable)
return;
goto start;
}
(void)instruction.execute_impl(*this);
goto may_return;
}