summaryrefslogtreecommitdiff
path: root/src/wasm.h
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-08-15 14:29:57 -0700
committerAlon Zakai <alonzakai@gmail.com>2016-08-15 15:03:36 -0700
commit113efcaa1e814304662ccc56312d8c59014a3a6c (patch)
tree5639a4a9d834947c9fc190e5916b9961e545cfba /src/wasm.h
parent086c4c0f89bbe626f4c98ae95716084db0541b0d (diff)
downloadbinaryen-113efcaa1e814304662ccc56312d8c59014a3a6c.tar.gz
binaryen-113efcaa1e814304662ccc56312d8c59014a3a6c.tar.bz2
binaryen-113efcaa1e814304662ccc56312d8c59014a3a6c.zip
offset support in table
Diffstat (limited to 'src/wasm.h')
-rw-r--r--src/wasm.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/wasm.h b/src/wasm.h
index 82933bda0..68558033d 100644
--- a/src/wasm.h
+++ b/src/wasm.h
@@ -1434,8 +1434,19 @@ class Table {
public:
static const Index kMaxSize = Index(-1);
+ struct Segment {
+ Expression* offset;
+ std::vector<Name> data;
+ Segment() {}
+ Segment(Expression* offset) : offset(offset) {
+ }
+ Segment(Expression* offset, std::vector<Name>& init) : offset(offset) {
+ data.swap(init);
+ }
+ };
+
Address initial, max;
- std::vector<Name> names;
+ std::vector<Segment> segments;
Table() : initial(0), max(kMaxSize) {}
};
@@ -1445,6 +1456,7 @@ public:
static const Address::address_t kPageSize = 64 * 1024;
static const Address::address_t kMaxSize = ~Address::address_t(0) / kPageSize;
static const Address::address_t kPageMask = ~(kPageSize - 1);
+
struct Segment {
Expression* offset;
std::vector<char> data; // TODO: optimize