LibWasm: Create AK::StackInfo once per AbstractMachine

This makes test-wasm about 20% faster on my Linux machine :^)
This commit is contained in:
Andreas Kling
2023-05-28 12:13:43 +02:00
parent 4cc1de1b03
commit f5bf53bc99
4 changed files with 17 additions and 4 deletions

View File

@@ -162,7 +162,7 @@ InstantiationResult AbstractMachine::instantiate(Module const& module, Vector<Ex
auxiliary_instance.globals().append(*ptr);
}
BytecodeInterpreter interpreter;
BytecodeInterpreter interpreter(m_stack_info);
module.for_each_section_of_type<GlobalSection>([&](auto& global_section) {
for (auto& entry : global_section.entries()) {
@@ -491,7 +491,7 @@ Optional<InstantiationError> AbstractMachine::allocate_all_final_phase(Module co
Result AbstractMachine::invoke(FunctionAddress address, Vector<Value> arguments)
{
BytecodeInterpreter interpreter;
BytecodeInterpreter interpreter(m_stack_info);
return invoke(interpreter, address, move(arguments));
}