diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-08-15 14:29:57 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-08-15 15:03:36 -0700 |
commit | 113efcaa1e814304662ccc56312d8c59014a3a6c (patch) | |
tree | 5639a4a9d834947c9fc190e5916b9961e545cfba /src/wasm.h | |
parent | 086c4c0f89bbe626f4c98ae95716084db0541b0d (diff) | |
download | binaryen-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.h | 14 |
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 |