summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2015-12-23 12:39:19 -0800
committerAlon Zakai <alonzakai@gmail.com>2015-12-23 12:39:19 -0800
commite06c85acfe7332640aadfea2c4f62ab71d159a88 (patch)
treece1a4dabaddf44f5e6d94f32082b2bb0762d16ed /src
parentdd48f32a130a4c45d7b2ca0df95f4a27cadd117e (diff)
downloadbinaryen-e06c85acfe7332640aadfea2c4f62ab71d159a88.tar.gz
binaryen-e06c85acfe7332640aadfea2c4f62ab71d159a88.tar.bz2
binaryen-e06c85acfe7332640aadfea2c4f62ab71d159a88.zip
emit staticBump in metadata
Diffstat (limited to 'src')
-rw-r--r--src/s2wasm.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/s2wasm.h b/src/s2wasm.h
index 467f912bf..5f2a0d75d 100644
--- a/src/s2wasm.h
+++ b/src/s2wasm.h
@@ -40,8 +40,8 @@ class S2WasmBuilder {
bool debug;
public:
- S2WasmBuilder(AllocatingModule& wasm, const char* input, bool debug, size_t nextStatic)
- : wasm(wasm), allocator(wasm.allocator), debug(debug), nextStatic(nextStatic) {
+ S2WasmBuilder(AllocatingModule& wasm, const char* input, bool debug, size_t globalBase)
+ : wasm(wasm), allocator(wasm.allocator), debug(debug), globalBase(globalBase), nextStatic(globalBase) {
s = input;
scan();
s = input;
@@ -52,7 +52,8 @@ public:
private:
// state
- size_t nextStatic; // location of next static allocation, i.e., the data segment
+ size_t globalBase, // where globals can start to be statically allocated, i.e., the data segment
+ nextStatic; // location of next static allocation
std::map<Name, int32_t> staticAddresses; // name => address
struct Addressing {
@@ -1069,6 +1070,8 @@ public:
o << "]";
}
o << "}";
+ o << ",";
+ o << "\"staticBump\": " << (nextStatic - globalBase);
o << " }";
}