summaryrefslogtreecommitdiff
path: root/src/wasm.h
diff options
context:
space:
mode:
authorDerek Schuff <dschuff@chromium.org>2016-10-03 21:41:43 -0700
committerGitHub <noreply@github.com>2016-10-03 21:41:43 -0700
commitc4e70a04c42cdad380707d2e4b4f6f9503462414 (patch)
tree5c221b431b75e1729689a47857153756bc9e5c08 /src/wasm.h
parent5046a524d506add48cb3779b39b4983e78292410 (diff)
downloadbinaryen-c4e70a04c42cdad380707d2e4b4f6f9503462414.tar.gz
binaryen-c4e70a04c42cdad380707d2e4b4f6f9503462414.tar.bz2
binaryen-c4e70a04c42cdad380707d2e4b4f6f9503462414.zip
More binary updates for 0xc (#733)
Refine tables to explicitly exist or not. Previously they were printed or encoded if it had any segments, or an initial or max size. However tables can be defined but empty, so we had a special hack that defined an empty segment when we really just wanted an empty table. Now, just make the existence explicit. Update Function table encoding for 0xc (Table and Element sections) Add end opcodes after function bodies (these are consumed by getMaybeBlock with the same behavior that it had before when it reached the function end, so no explicit decode) Update call_indirect encoding for 0xc (no arity, call target is last)
Diffstat (limited to 'src/wasm.h')
-rw-r--r--src/wasm.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/wasm.h b/src/wasm.h
index 54461d2e7..ca9392d98 100644
--- a/src/wasm.h
+++ b/src/wasm.h
@@ -1466,11 +1466,14 @@ public:
}
};
+ // Currently the wasm object always 'has' one Table. It 'exists' if it has been defined or imported.
+ // The table can exist but be empty and have no defined initial or max size.
+ bool exists;
Name name;
Address initial, max;
std::vector<Segment> segments;
- Table() : initial(0), max(kMaxSize) {
+ Table() : exists(false), initial(0), max(kMaxSize) {
name = Name::fromInt(0);
}
};