summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md6
-rwxr-xr-xbuild.sh4
-rwxr-xr-xemcc_to_polyfill.sh2
3 files changed, 4 insertions, 8 deletions
diff --git a/README.md b/README.md
index 731931e22..af5854000 100644
--- a/README.md
+++ b/README.md
@@ -13,9 +13,7 @@ More specifically, this repository contains:
$ ./build.sh
```
-This requires a C++11 compiler.
-
-Note: you might want to add `-O2` or such.
+`asm2wasm` requires a C++11 compiler. `wasm.js` requires Emscripten (which you can [get here](http://kripken.github.io/emscripten-site/docs/getting_started/downloads.html)).
## Running
@@ -63,8 +61,6 @@ Run
That will call `emcc` and then emit `a.normal.js`, a normal asm.js build for comparison purposes, and `a.wasm.js`, which contains the entire polyfill (`asm2wasm` translator + `wasm.js` interpreter).
-You will need `emcc`, so you should [grab Emscripten](http://kripken.github.io/emscripten-site/docs/getting_started/downloads.html).
-
### C/C++ Source => asm2wasm
Using emcc you can generate asm.js files for direct parsing by `asm2wasm` on the commandline, for example using
diff --git a/build.sh b/build.sh
index 53eaeece6..0e104532f 100755
--- a/build.sh
+++ b/build.sh
@@ -1,6 +1,6 @@
echo "building asm2wasm"
-g++ -std=c++11 src/asm2wasm-main.cpp src/parser.cpp src/simple_ast.cpp src/optimizer-shared.cpp -g -o bin/asm2wasm
+g++ -O2 -std=c++11 src/asm2wasm-main.cpp src/parser.cpp src/simple_ast.cpp src/optimizer-shared.cpp -g -o bin/asm2wasm
echo "building interpreter/js"
-em++ -std=c++11 src/wasm-js.cpp src/parser.cpp src/simple_ast.cpp src/optimizer-shared.cpp -o bin/wasm.js -s MODULARIZE=1 -s 'EXPORT_NAME="WasmJS"' --memory-init-file 0 -s DEMANGLE_SUPPORT=1 -O2 -profiling -s TOTAL_MEMORY=67108864 #-DWASM_INTERPRETER_DEBUG
+em++ -std=c++11 src/wasm-js.cpp src/parser.cpp src/simple_ast.cpp src/optimizer-shared.cpp -o bin/wasm.js -s MODULARIZE=1 -s 'EXPORT_NAME="WasmJS"' --memory-init-file 0 -s DEMANGLE_SUPPORT=1 -O3 -profiling -s TOTAL_MEMORY=67108864 #-DWASM_INTERPRETER_DEBUG
cat src/js/post.js >> bin/wasm.js
diff --git a/emcc_to_polyfill.sh b/emcc_to_polyfill.sh
index 41337ae2d..fd2dd7791 100755
--- a/emcc_to_polyfill.sh
+++ b/emcc_to_polyfill.sh
@@ -3,7 +3,7 @@
set -e
echo "calling emcc"
-emcc -o a.html --separate-asm -O2 -profiling -s DEMANGLE_SUPPORT=1 -s TOTAL_MEMORY=67108864 $@
+emcc -o a.html --separate-asm -O3 -profiling -s DEMANGLE_SUPPORT=1 -s TOTAL_MEMORY=67108864 $@
# we now have a.asm.js and a.js