LibWasm: Implement most of the remaining instructions

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
This commit is contained in:
Ali Mohammad Pur
2021-05-14 22:54:27 +04:30
committed by Andreas Kling
parent 056be42c0b
commit 84e3957dc3
Notes: sideshowbarker 2024-07-18 17:54:31 +09:00
3 changed files with 403 additions and 59 deletions

View File

@@ -141,6 +141,7 @@ public:
}
auto& values() const { return m_values; }
auto& values() { return m_values; }
auto is_trap() const { return m_is_trap; }
private:
@@ -314,6 +315,11 @@ public:
auto is_mutable() const { return m_mutable; }
auto& value() const { return m_value; }
void set_value(Value value)
{
VERIFY(is_mutable());
m_value = move(value);
}
private:
bool m_mutable { false };
@@ -391,7 +397,7 @@ public:
[[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& last() { return m_data.last(); }
auto& peek() const { return m_data.last(); }
auto size() const { return m_data.size(); }
auto& entries() const { return m_data; }