mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-03 08:52:54 +00:00
LibJS: Join locals, constants and registers into single vector
Merging registers, constants and locals into single vector means: - Better data locality - No need to check type in Interpreter::get() and Interpreter::set() which are very hot functions Performance improvement is visible in almost all Octane and Kraken tests.
This commit is contained in:
parent
59cb7994c6
commit
d79438a2a6
Notes:
sideshowbarker
2024-07-17 05:19:06 +09:00
Author: https://github.com/kalenikaliaksandr
Commit: d79438a2a6
Pull-request: https://github.com/SerenityOS/serenity/pull/24316
11 changed files with 478 additions and 57 deletions
|
@ -42,6 +42,22 @@ void Instruction::visit_labels(Function<void(JS::Bytecode::Label&)> visitor)
|
|||
#undef __BYTECODE_OP
|
||||
}
|
||||
|
||||
void Instruction::visit_operands(Function<void(JS::Bytecode::Operand&)> visitor)
|
||||
{
|
||||
#define __BYTECODE_OP(op) \
|
||||
case Type::op: \
|
||||
static_cast<Op::op&>(*this).visit_operands_impl(move(visitor)); \
|
||||
return;
|
||||
|
||||
switch (type()) {
|
||||
ENUMERATE_BYTECODE_OPS(__BYTECODE_OP)
|
||||
default:
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
#undef __BYTECODE_OP
|
||||
}
|
||||
|
||||
template<typename Op>
|
||||
concept HasVariableLength = Op::IsVariableLength;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue