
This commit is a bit of a mixed bag, but most of the changes are repetitive enough to just include in a single commit. The following instructions remain unimplemented: - br.table - table.init - table.get - table.set - table.copy - table.size - table.grow - table.fill - ref.null - ref.func - ref.is_null - drop - i32/i64.clz - i32/i64.ctz - i32/i64.popcnt - i32/i64.rotl - i32/i64.rotr - X.trunc.Y - X.trunc_sat.Y - memory.size - memory.grow - memory.init - memory.copy - memory.fill - elem.drop - data.drop
24 lines
622 B
C++
24 lines
622 B
C++
/*
|
|
* Copyright (c) 2021, Ali Mohammad Pur <mpfard@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibWasm/AbstractMachine/Configuration.h>
|
|
|
|
namespace Wasm {
|
|
|
|
struct Interpreter {
|
|
void interpret(Configuration&);
|
|
|
|
private:
|
|
void interpret(Configuration&, InstructionPointer&, const Instruction&);
|
|
void branch_to_label(Configuration&, LabelIndex);
|
|
ReadonlyBytes load_from_memory(Configuration&, const Instruction&, size_t);
|
|
void store_to_memory(Configuration&, const Instruction&, ReadonlyBytes data);
|
|
void call_address(Configuration&, FunctionAddress);
|
|
};
|
|
|
|
}
|