mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:28:10 +00:00
LibWasm: Create AK::StackInfo once per AbstractMachine
This makes test-wasm about 20% faster on my Linux machine :^)
This commit is contained in:
parent
4cc1de1b03
commit
f5bf53bc99
4 changed files with 17 additions and 4 deletions
|
@ -13,6 +13,11 @@
|
|||
namespace Wasm {
|
||||
|
||||
struct BytecodeInterpreter : public Interpreter {
|
||||
explicit BytecodeInterpreter(StackInfo const& stack_info)
|
||||
: m_stack_info(stack_info)
|
||||
{
|
||||
}
|
||||
|
||||
virtual void interpret(Configuration&) override;
|
||||
virtual ~BytecodeInterpreter() override = default;
|
||||
virtual bool did_trap() const override { return !m_trap.has<Empty>(); }
|
||||
|
@ -72,10 +77,14 @@ protected:
|
|||
}
|
||||
|
||||
Variant<Trap, JS::Completion, Empty> m_trap;
|
||||
StackInfo m_stack_info;
|
||||
StackInfo const& m_stack_info;
|
||||
};
|
||||
|
||||
struct DebuggerBytecodeInterpreter : public BytecodeInterpreter {
|
||||
DebuggerBytecodeInterpreter(StackInfo const& stack_info)
|
||||
: BytecodeInterpreter(stack_info)
|
||||
{
|
||||
}
|
||||
virtual ~DebuggerBytecodeInterpreter() override = default;
|
||||
|
||||
Function<bool(Configuration&, InstructionPointer&, Instruction const&)> pre_interpret_hook;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue