summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md15
-rw-r--r--src/wasm.h2
-rw-r--r--test/emcc_hello_world.wast1
-rw-r--r--test/hello_world.wast1
4 files changed, 12 insertions, 7 deletions
diff --git a/README.md b/README.md
index cc3215178..392577fb2 100644
--- a/README.md
+++ b/README.md
@@ -58,13 +58,6 @@ That will emit `a.html`, `a.js`, and `a.asm.js`. That last file is the asm.js mo
* Note: you can try `-O1` or higher, but you should probably use `--profiling` which keeps the code semi-readable (otherwise, you'll get minified names, etc., and that code path is untested).
-## TODO
-
- * Start running the output through WebAssembly interpreters. Right now it is likely wrong in many ways.
- * WebAssembly lacks global variables, so `asm2wasm` maps them onto addresses in memory. This requires that you have some reserved space for those variables. You can do that with `emcc -s GLOBAL_BASE=1000`. We still need to write the code to copy the globals there.
- * Emscripten emits asm.js and JavaScript, that work together using web APIs to do things like print, render, etc. Need to figure out how to test that.
- * We could probably optimize the emitted WebAssembly.
-
## Testing
```
@@ -93,3 +86,11 @@ Same as Emscripten: MIT license.
For changes to `src/`, please make pulls into emscripten's `asm2wasm` branch (in `tools/optimizer`; this code is sync'ed with there, for convenience).
+## TODO
+
+ * Start running the output through WebAssembly interpreters. Right now it is likely wrong in many ways.
+ * WebAssembly lacks global variables, so `asm2wasm` maps them onto addresses in memory. This requires that you have some reserved space for those variables. You can do that with `emcc -s GLOBAL_BASE=1000`. We still need to write the code to copy the globals there.
+ * Emscripten emits asm.js and JavaScript, that work together using web APIs to do things like print, render, etc. Need to figure out how to test that.
+ * We could probably optimize the emitted WebAssembly.
+ * Memory section needs the right size.
+
diff --git a/src/wasm.h b/src/wasm.h
index 40d9a126e..d8cada7f5 100644
--- a/src/wasm.h
+++ b/src/wasm.h
@@ -796,6 +796,8 @@ public:
unsigned indent = 0;
printOpening(o, "module", true);
incIndent(o, indent);
+ doIndent(o, indent);
+ printOpening(o, "memory") << " 16777216)\n"; // XXX
for (auto& curr : functionTypes) {
doIndent(o, indent);
curr.second->print(o, indent, true);
diff --git a/test/emcc_hello_world.wast b/test/emcc_hello_world.wast
index 676a16b57..358d3f536 100644
--- a/test/emcc_hello_world.wast
+++ b/test/emcc_hello_world.wast
@@ -1,4 +1,5 @@
(module
+ (memory 16777216)
(type $FUNCSIG$ii (func (param i32) (result i32)))
(type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32)))
(type $FUNCSIG$vi (func (param i32)))
diff --git a/test/hello_world.wast b/test/hello_world.wast
index 95d84116b..e36b85c4a 100644
--- a/test/hello_world.wast
+++ b/test/hello_world.wast
@@ -1,4 +1,5 @@
(module
+ (memory 16777216)
(export "add" $add)
(func $add (param $x i32) (param $y i32) (result i32)
(i32.add