From 113efcaa1e814304662ccc56312d8c59014a3a6c Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 15 Aug 2016 14:29:57 -0700 Subject: offset support in table --- src/wasm.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/wasm.h') 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 data; + Segment() {} + Segment(Expression* offset) : offset(offset) { + } + Segment(Expression* offset, std::vector& init) : offset(offset) { + data.swap(init); + } + }; + Address initial, max; - std::vector names; + std::vector 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 data; // TODO: optimize -- cgit v1.2.3