mirror of
https://github.com/SerenityOS/serenity
synced 2026-05-05 22:52:10 +02: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:
committed by
Andreas Kling
parent
59cb7994c6
commit
d79438a2a6
@@ -43,8 +43,7 @@ NonnullOwnPtr<ExecutionContext> ExecutionContext::copy() const
|
||||
copy->executable = executable;
|
||||
copy->arguments = arguments;
|
||||
copy->passed_argument_count = passed_argument_count;
|
||||
copy->locals = locals;
|
||||
copy->registers = registers;
|
||||
copy->registers_and_constants_and_locals = registers_and_constants_and_locals;
|
||||
copy->unwind_contexts = unwind_contexts;
|
||||
copy->saved_lexical_environments = saved_lexical_environments;
|
||||
copy->previously_scheduled_jumps = previously_scheduled_jumps;
|
||||
@@ -63,8 +62,7 @@ void ExecutionContext::visit_edges(Cell::Visitor& visitor)
|
||||
visitor.visit(executable);
|
||||
visitor.visit(function_name);
|
||||
visitor.visit(arguments);
|
||||
visitor.visit(locals);
|
||||
visitor.visit(registers);
|
||||
visitor.visit(registers_and_constants_and_locals);
|
||||
for (auto& context : unwind_contexts) {
|
||||
visitor.visit(context.lexical_environment);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user