diff options
author | Joel Martin <github@martintribe.org> | 2017-05-01 17:55:02 -0500 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2017-05-01 15:55:02 -0700 |
commit | 6ae56e73d0eb3a5769af3920a2e75e0a910777bb (patch) | |
tree | 667ddee347a6e15cef6f2811f1b8f1e03a9dd3a2 /check.py | |
parent | b6d42e0c28460667d9e9c992833be668d0897362 (diff) | |
download | binaryen-6ae56e73d0eb3a5769af3920a2e75e0a910777bb.tar.gz binaryen-6ae56e73d0eb3a5769af3920a2e75e0a910777bb.tar.bz2 binaryen-6ae56e73d0eb3a5769af3920a2e75e0a910777bb.zip |
--no-js-ffi opt to disable JS FFI mangling. (#984)
* Always use scripts.test.shared for bin paths.
Update scripts/test/shared.py to add WASM_MERGE relative to build
directory. Update auto_update_tests.py to use scripts.test.shared
variables for all bin paths. Update check.py to use
scripts.test.shared for wasm-merge path (this was missing).
This allows check.py and auto_update_tests.py to be run from the
source directory using built binaries in a different location.
* --no-legalize-javascript-ffi disables JS FFI mangling.
For JS/Web platform, calls to JS imports are wrapped to convert i64 to
i32 and f32 to f64. Likewise calls from JS into exports do the inverse
wrapping. This change provides an option to disable that wrapping and
use the original types for the call.
Includes tests test/noffi_f32.asm.js and test/noffi_i64.asm.js to make
sure neither f32->f64 nor i64->i32 type mangling is happening when
--no-legalize-javascript-ffi is specified.
To fully disable JS FFI mangling when using emscripten, the fastcomp
FFI mangling must also be disabled using the
-emscripten-legalize-javascript-ffi=0 flag.
Diffstat (limited to 'check.py')
-rwxr-xr-x | check.py | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -23,7 +23,7 @@ import sys from scripts.test.support import run_command, split_wast from scripts.test.shared import ( ASM2WASM, BIN_DIR, EMCC, MOZJS, NATIVECC, NATIVEXX, NODEJS, S2WASM_EXE, - WASM_AS, WASM_OPT, WASM_SHELL, WASM_SHELL_EXE, WASM_DIS, + WASM_AS, WASM_OPT, WASM_SHELL, WASM_MERGE, WASM_SHELL_EXE, WASM_DIS, binary_format_check, delete_from_orbit, fail, fail_with_error, fail_if_not_identical, fail_if_not_contained, has_vanilla_emcc, has_vanilla_llvm, minify_check, num_failures, options, tests, @@ -112,13 +112,15 @@ for asm in tests: cmd += ['-O'] if 'debugInfo' in asm: cmd += ['-g'] + if 'noffi' in asm: + cmd += ['--no-legalize-javascript-ffi'] if precise and opts: # test mem init importing open('a.mem', 'wb').write(asm) cmd += ['--mem-init=a.mem'] if asm[0] == 'e': cmd += ['--mem-base=1024'] - if 'i64' in asm or 'wasm-only' in asm: + if 'i64' in asm or 'wasm-only' in asm or 'noffi' in asm: cmd += ['--wasm-only'] wasm = os.path.join(options.binaryen_test, wasm) print '..', asm, wasm @@ -224,7 +226,7 @@ for t in os.listdir(os.path.join('test', 'merge')): u = t + '.toMerge' for finalize in [0, 1]: for opt in [0, 1]: - cmd = [os.path.join('bin', 'wasm-merge'), t, u, '-o', 'a.wast', '-S', '--verbose'] + cmd = WASM_MERGE + [t, u, '-o', 'a.wast', '-S', '--verbose'] if finalize: cmd += ['--finalize-memory-base=1024', '--finalize-table-base=8'] if opt: cmd += ['-O'] stdout = run_command(cmd) |