diff options
author | Alon Zakai <azakai@google.com> | 2024-06-17 14:36:38 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-17 14:36:38 -0700 |
commit | 1dd05202ced86548361d5efc439ad106007f8bb8 (patch) | |
tree | 1054eb9269d63682ebfc502fd6f4db4ce7f6d66f /test/wasm2js/refs.2asm.js | |
parent | d849a43040dfc21d1593283ad38a12a3bd80e17c (diff) | |
download | binaryen-1dd05202ced86548361d5efc439ad106007f8bb8.tar.gz binaryen-1dd05202ced86548361d5efc439ad106007f8bb8.tar.bz2 binaryen-1dd05202ced86548361d5efc439ad106007f8bb8.zip |
wasm2js: Support arbitrary temp variable types (#6661)
Previously only basic types were allowed.
Generalizing this to arbitrary types means we use a map instead of a vector,
which is slower, but I can't measure any noticeable difference. Temp vars are
pretty rare, and there are just much slower parts of wasm2js, I think.
Diffstat (limited to 'test/wasm2js/refs.2asm.js')
-rw-r--r-- | test/wasm2js/refs.2asm.js | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/test/wasm2js/refs.2asm.js b/test/wasm2js/refs.2asm.js index f1d60af6c..f4c08408f 100644 --- a/test/wasm2js/refs.2asm.js +++ b/test/wasm2js/refs.2asm.js @@ -50,6 +50,17 @@ function asmFunc(imports) { return temp; } + function funcref_temps($0, $1) { + $1 = +$1; + var $2 = null, $3 = null, wasm2js_funcref$0 = null, wasm2js_funcref$1 = null, wasm2js_i32$0 = 0; + $2 = $0; + loop : while (1) { + $3 = funcref_temps; + break loop; + }; + funcref_temps(funcref_temps, +(+((wasm2js_funcref$0 = $2, wasm2js_funcref$1 = $3 || wasm2js_trap(), wasm2js_i32$0 = 0, wasm2js_i32$0 ? wasm2js_funcref$0 : wasm2js_funcref$1) == null | 0))); + } + return { "null_": null_, "is_null": is_null, @@ -57,7 +68,8 @@ function asmFunc(imports) { "ref_eq": ref_eq, "ref_as": ref_as, "use_global": use_global, - "use_global_ref": use_global_ref + "use_global_ref": use_global_ref, + "funcref_temps": funcref_temps }; } @@ -70,3 +82,4 @@ export var ref_eq = retasmFunc.ref_eq; export var ref_as = retasmFunc.ref_as; export var use_global = retasmFunc.use_global; export var use_global_ref = retasmFunc.use_global_ref; +export var funcref_temps = retasmFunc.funcref_temps; |