mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 08:27:46 +00:00
LibWasm: Load and instantiate tables
This commit is a fairly large refactor, mainly because it unified the two different ways that existed to represent references. Now Reference values are also a kind of value. It also implements a printer for values/references instead of copying the implementation everywhere.
This commit is contained in:
parent
c392a0cf7f
commit
be62e4d1d7
10 changed files with 350 additions and 192 deletions
|
@ -10,6 +10,8 @@
|
|||
|
||||
namespace Wasm {
|
||||
|
||||
class Value;
|
||||
|
||||
String instruction_name(const OpCode& opcode);
|
||||
|
||||
struct Printer {
|
||||
|
@ -28,14 +30,7 @@ struct Printer {
|
|||
void print(const Wasm::DataSection&);
|
||||
void print(const Wasm::DataSection::Data&);
|
||||
void print(const Wasm::ElementSection&);
|
||||
void print(const Wasm::ElementSection::SegmentType0&);
|
||||
void print(const Wasm::ElementSection::SegmentType1&);
|
||||
void print(const Wasm::ElementSection::SegmentType2&);
|
||||
void print(const Wasm::ElementSection::SegmentType3&);
|
||||
void print(const Wasm::ElementSection::SegmentType4&);
|
||||
void print(const Wasm::ElementSection::SegmentType5&);
|
||||
void print(const Wasm::ElementSection::SegmentType6&);
|
||||
void print(const Wasm::ElementSection::SegmentType7&);
|
||||
void print(const Wasm::ElementSection::Element&);
|
||||
void print(const Wasm::ExportSection&);
|
||||
void print(const Wasm::ExportSection::Export&);
|
||||
void print(const Wasm::Expression&);
|
||||
|
@ -54,6 +49,7 @@ struct Printer {
|
|||
void print(const Wasm::MemoryType&);
|
||||
void print(const Wasm::Module&);
|
||||
void print(const Wasm::Module::Function&);
|
||||
void print(const Wasm::Reference&);
|
||||
void print(const Wasm::StartSection&);
|
||||
void print(const Wasm::StartSection::StartFunction&);
|
||||
void print(const Wasm::TableSection&);
|
||||
|
@ -61,6 +57,7 @@ struct Printer {
|
|||
void print(const Wasm::TableType&);
|
||||
void print(const Wasm::TypeSection&);
|
||||
void print(const Wasm::ValueType&);
|
||||
void print(const Wasm::Value&);
|
||||
|
||||
private:
|
||||
void print_indent();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue