mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 14:28:49 +00:00
LibJS: Avoid calling generic Instruction::length() during dispatch
Since we know the exact type, we can avoid calling the generic lookup function that branches on instruction type.
This commit is contained in:
parent
4b04e97feb
commit
8f2ee01e6f
Notes:
github-actions[bot]
2025-04-03 11:57:56 +00:00
Author: https://github.com/awesomekling
Commit: 8f2ee01e6f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4204
2 changed files with 9 additions and 1 deletions
|
@ -386,7 +386,7 @@ FLATTEN_ON_CLANG void Interpreter::run_bytecode(size_t entry_point)
|
|||
#define DISPATCH_NEXT(name) \
|
||||
do { \
|
||||
if constexpr (Op::name::IsVariableLength) \
|
||||
program_counter += instruction.length(); \
|
||||
program_counter += static_cast<Op::name const&>(instruction).length(); \
|
||||
else \
|
||||
program_counter += sizeof(Op::name); \
|
||||
auto& next_instruction = *reinterpret_cast<Instruction const*>(&bytecode[program_counter]); \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue