mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 21:59:07 +00:00
LibJS/Bytecode: Remove exception checks from Return/Await/Yield
These instructions can't throw anyway.
This commit is contained in:
parent
8eccfdb98c
commit
3e1a6fca91
Notes:
sideshowbarker
2024-07-17 07:09:53 +09:00
Author: https://github.com/awesomekling
Commit: 3e1a6fca91
Pull-request: https://github.com/SerenityOS/serenity/pull/24276
Reviewed-by: https://github.com/Hendiadyoin1
Reviewed-by: https://github.com/shannonbooth
1 changed files with 3 additions and 21 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue