LibJS: Mark exception-handling paths with [[unlikely]] in interpreter

This appears actually helpful and consistently makes all benchmarks
slightly faster on my machine.
This commit is contained in:
Andreas Kling 2025-04-06 02:32:04 +02:00 committed by Alexander Kalenik
parent aec7dd5778
commit c8865458da
Notes: github-actions[bot] 2025-04-06 02:48:07 +00:00

View file

@ -481,7 +481,7 @@ FLATTEN_ON_CLANG void Interpreter::run_bytecode(size_t entry_point)
goto start; \
} \
auto result = op_snake_case(vm(), get(instruction.lhs()), get(instruction.rhs())); \
if (result.is_error()) { \
if (result.is_error()) [[unlikely]] { \
if (handle_exception(program_counter, result.error_value()) == HandleExceptionResponse::ExitFromExecutable) \
return; \
goto start; \
@ -563,7 +563,7 @@ FLATTEN_ON_CLANG void Interpreter::run_bytecode(size_t entry_point)
auto& instruction = *reinterpret_cast<Op::name const*>(&bytecode[program_counter]); \
{ \
auto result = instruction.execute_impl(*this); \
if (result.is_error()) { \
if (result.is_error()) [[unlikely]] { \
if (handle_exception(program_counter, result.error_value()) == HandleExceptionResponse::ExitFromExecutable) \
return; \
goto start; \