summaryrefslogtreecommitdiff
path: root/src/binary-reader.h
diff options
context:
space:
mode:
authorBen Smith <binjimin@gmail.com>2018-06-14 15:16:43 -0700
committerGitHub <noreply@github.com>2018-06-14 15:16:43 -0700
commitd23c99d036ab31f7de21bc4a90b651c4cfd4a356 (patch)
tree7e352f593a161accef670ad0553a8aa6257d4364 /src/binary-reader.h
parentace6f17fae2ae6511e1c676217d76143ddf0f23d (diff)
downloadwabt-d23c99d036ab31f7de21bc4a90b651c4cfd4a356.tar.gz
wabt-d23c99d036ab31f7de21bc4a90b651c4cfd4a356.tar.bz2
wabt-d23c99d036ab31f7de21bc4a90b651c4cfd4a356.zip
Add support for multi-value proposal (#861)
Use the `--enable-multi-value` flag to enable. A lot of code already "worked" with multi-value, and just needed to remove the restrictions. Most of the other changes are modifying the callback APIs to be more general, e.g. taking more than 1 result type. * Types are now stored as the negative values; this works nicely with the encoding of inline function types (used for block signatures), which are always positive values. * Remove `BlockSignature` and use `BlockDeclaration` instead, which is just a typedef to `FuncSignature`. This allows for explicit or implicit type specifications on the block signatures. * Allow for >1 "keep" values in the DropKeep interpreter instruction
Diffstat (limited to 'src/binary-reader.h')
-rw-r--r--src/binary-reader.h14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/binary-reader.h b/src/binary-reader.h
index cf09ddba..c64b490e 100644
--- a/src/binary-reader.h
+++ b/src/binary-reader.h
@@ -182,7 +182,7 @@ class BinaryReaderDelegate {
virtual Result OnOpcodeF32(uint32_t value) = 0;
virtual Result OnOpcodeF64(uint64_t value) = 0;
virtual Result OnOpcodeV128(v128 value) = 0;
- virtual Result OnOpcodeBlockSig(Index num_types, Type* sig_types) = 0;
+ virtual Result OnOpcodeBlockSig(Type sig_type) = 0;
virtual Result OnAtomicLoadExpr(Opcode opcode,
uint32_t alignment_log2,
Address offset) = 0;
@@ -202,7 +202,7 @@ class BinaryReaderDelegate {
uint32_t alignment_log2,
Address offset) = 0;
virtual Result OnBinaryExpr(Opcode opcode) = 0;
- virtual Result OnBlockExpr(Index num_types, Type* sig_types) = 0;
+ virtual Result OnBlockExpr(Type sig_type) = 0;
virtual Result OnBrExpr(Index depth) = 0;
virtual Result OnBrIfExpr(Index depth) = 0;
virtual Result OnBrTableExpr(Index num_targets,
@@ -224,14 +224,12 @@ class BinaryReaderDelegate {
virtual Result OnGetLocalExpr(Index local_index) = 0;
virtual Result OnI32ConstExpr(uint32_t value) = 0;
virtual Result OnI64ConstExpr(uint64_t value) = 0;
- virtual Result OnIfExpr(Index num_types, Type* sig_types) = 0;
- virtual Result OnIfExceptExpr(Index num_types,
- Type* sig_types,
- Index except_index) = 0;
+ virtual Result OnIfExpr(Type sig_type) = 0;
+ virtual Result OnIfExceptExpr(Type sig_type, Index except_index) = 0;
virtual Result OnLoadExpr(Opcode opcode,
uint32_t alignment_log2,
Address offset) = 0;
- virtual Result OnLoopExpr(Index num_types, Type* sig_types) = 0;
+ virtual Result OnLoopExpr(Type sig_type) = 0;
virtual Result OnMemoryGrowExpr() = 0;
virtual Result OnMemorySizeExpr() = 0;
virtual Result OnNopExpr() = 0;
@@ -245,7 +243,7 @@ class BinaryReaderDelegate {
Address offset) = 0;
virtual Result OnTeeLocalExpr(Index local_index) = 0;
virtual Result OnThrowExpr(Index except_index) = 0;
- virtual Result OnTryExpr(Index num_types, Type* sig_types) = 0;
+ virtual Result OnTryExpr(Type sig_type) = 0;
virtual Result OnUnaryExpr(Opcode opcode) = 0;
virtual Result OnTernaryExpr(Opcode opcode) = 0;