From 73eb0785e0f791d535c803907f347ecb81f929b5 Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Sun, 23 May 2021 21:21:17 +0430 Subject: [PATCH] LibWasm: Don't put values and labels in OwnPtrs Doing that was causing a lot of malloc/free traffic, but since there's no need to have a stable pointer to them, we can just store them by value. This makes execution significantly faster :^) --- .../LibWasm/AbstractMachine/AbstractMachine.h | 4 +- .../LibWasm/AbstractMachine/Configuration.cpp | 25 ++-- .../LibWasm/AbstractMachine/Configuration.h | 2 +- .../LibWasm/AbstractMachine/Interpreter.cpp | 136 +++++++++--------- .../LibWasm/AbstractMachine/Interpreter.h | 2 +- 5 files changed, 83 insertions(+), 86 deletions(-) diff --git a/Userland/Libraries/LibWasm/AbstractMachine/AbstractMachine.h b/Userland/Libraries/LibWasm/AbstractMachine/AbstractMachine.h index dd51e74225..346f93dee9 100644 --- a/Userland/Libraries/LibWasm/AbstractMachine/AbstractMachine.h +++ b/Userland/Libraries/LibWasm/AbstractMachine/AbstractMachine.h @@ -388,7 +388,7 @@ public: private: size_t m_arity { 0 }; - InstructionPointer m_continuation; + InstructionPointer m_continuation { 0 }; }; class Frame { @@ -418,7 +418,7 @@ private: class Stack { public: - using EntryType = Variant, NonnullOwnPtr