diff --git a/Userland/Libraries/LibWasm/AbstractMachine/AbstractMachine.h b/Userland/Libraries/LibWasm/AbstractMachine/AbstractMachine.h index 264c832e7c..4646df4738 100644 --- a/Userland/Libraries/LibWasm/AbstractMachine/AbstractMachine.h +++ b/Userland/Libraries/LibWasm/AbstractMachine/AbstractMachine.h @@ -39,6 +39,12 @@ TYPEDEF_DISTINCT_NUMERIC_GENERAL(u64, true, true, false, false, false, true, Mem // fancy than just a dumb interpreter. class Value { public: + Value() + : m_value(0) + , m_type(ValueType::I32) + { + } + using AnyValueType = Variant; explicit Value(AnyValueType value) : m_value(move(value)) @@ -426,17 +432,18 @@ public: using EntryType = Variant; Stack() = default; - [[nodiscard]] bool is_empty() const { return m_data.is_empty(); } - void push(EntryType entry) { m_data.append(move(entry)); } - auto pop() { return m_data.take_last(); } - auto& peek() const { return m_data.last(); } + [[nodiscard]] ALWAYS_INLINE bool is_empty() const { return m_data.is_empty(); } + FLATTEN void push(EntryType entry) { m_data.append(move(entry)); } + FLATTEN auto pop() { return m_data.take_last(); } + FLATTEN auto& peek() const { return m_data.last(); } + FLATTEN auto& peek() { return m_data.last(); } - auto size() const { return m_data.size(); } - auto& entries() const { return m_data; } - auto& entries() { return m_data; } + ALWAYS_INLINE auto size() const { return m_data.size(); } + ALWAYS_INLINE auto& entries() const { return m_data; } + ALWAYS_INLINE auto& entries() { return m_data; } private: - Vector m_data; + Vector m_data; }; using InstantiationResult = AK::Result, InstantiationError>; diff --git a/Userland/Libraries/LibWasm/AbstractMachine/Interpreter.cpp b/Userland/Libraries/LibWasm/AbstractMachine/Interpreter.cpp index 5fee8c1aa7..c0cbc0d57f 100644 --- a/Userland/Libraries/LibWasm/AbstractMachine/Interpreter.cpp +++ b/Userland/Libraries/LibWasm/AbstractMachine/Interpreter.cpp @@ -55,7 +55,6 @@ void BytecodeInterpreter::branch_to_label(Configuration& configuration, LabelInd auto results = pop_values(configuration, label->arity()); size_t drop_count = index.value() + 1; - for (; !configuration.stack().is_empty();) { auto& entry = configuration.stack().peek(); if (entry.has