summaryrefslogtreecommitdiff
path: root/test/unit.asm.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2019-01-16 13:22:39 -0800
committerGitHub <noreply@github.com>2019-01-16 13:22:39 -0800
commit777d33d40ff030f1711c40bf3cd5bc4bc36af313 (patch)
tree343d05d218b55dfd6e453f90d76d896cd84d1865 /test/unit.asm.js
parentcbb24eb4a0810640c9dcee2f6682c64f9bc6c512 (diff)
downloadbinaryen-777d33d40ff030f1711c40bf3cd5bc4bc36af313.tar.gz
binaryen-777d33d40ff030f1711c40bf3cd5bc4bc36af313.tar.bz2
binaryen-777d33d40ff030f1711c40bf3cd5bc4bc36af313.zip
Emscripten stack simplification (#1870)
This takes advantage of the recent memory simplification in emscripten, where JS static allocation is done at compile time. That means we know the stack's initial location at compile time, and can apply it. This is the binaryen side of that: * asm2wasm support for asm.js globals with an initial value var X = Y; where Y is not 0 (which is what the stack now is). * wasm-emscripten-finalize support for a flag --initial-stack-pointer=X, and remove the old code to import the stack's initial location.
Diffstat (limited to 'test/unit.asm.js')
-rw-r--r--test/unit.asm.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/unit.asm.js b/test/unit.asm.js
index 05827ce54..b62c7aefb 100644
--- a/test/unit.asm.js
+++ b/test/unit.asm.js
@@ -30,6 +30,8 @@ function asm(global, env, buffer) {
var HEAPF32 = new global.Float32Array(buffer);
var HEAPF64 = new global.Float64Array(buffer);
+ var nonZero = 1337;
+
function big_negative() {
var temp = 0.0;
temp = +-2147483648;
@@ -785,6 +787,7 @@ function asm(global, env, buffer) {
emterpretify_assertions_safeHeap();
call_emscripten_log();
mod_detectSign(1.0, 2.31, 9.78);
+ nonZero = nonZero + 1 | 0;
}
function v() {