summaryrefslogtreecommitdiff
path: root/scripts/test/wasm2js.py
Commit message (Collapse)AuthorAgeFilesLines
* [wasm2js] Fix memory.size (#2330)Alon Zakai2019-09-051-2/+2
| | | | | | | We emitted the __wasm_memory_size function only when memory growth was enabled, but it can be used without that too. In theory we could only emit it if either memory growth or memory.size is used, but I think we can expect JS minifiers to do that later. Also fix a test suite bug - the check/auto_update script didn't run all the wasm2js tests when you run it with argument wasm2js (it used that as the list of tests, instead of the list of files, which confused me here for a while...).
* Allow all features on wasm2js and add atomic tests (#2311)Heejin Ahn2019-08-281-4/+4
| | | | | | This adds `-all` argument to wasm2js testing and fixes wasm2js to actually take that argument (currently it doesn't, when it takes a wast file). This also adds a wasm2js test for `atomic.fence` instruction that was added in #2307.
* Fix auto_update_tests.py after #2114 (#2306)Sam Clegg2019-08-261-2/+2
|
* Remove test output from source tree (#2114)Sam Clegg2019-08-211-1/+2
|
* Switch python indentation from 2-space to 4-space (#2299)Sam Clegg2019-08-161-110/+110
| | | | | | | | pep8 specifies 4 space indentation. The use of 2 spaces is, I believe a historical anomaly where certain large organizations such as google chose 2 over 4 and have yet to make the switch. Since there isn't too much code in binaryen today it seems reasonable to make the switch.
* Python3-ify check.py and auto_update_tests.py (#2270)Alon Zakai2019-07-311-14/+12
| | | | | I fixed flatten.bin.txt which seems to have just had some corrupted data, and I removed some fancy unicode from the spec comments tests, which I'm not sure it's important enough to figure out how to fix. Fixes #1691
* wasm2js: run full optimizations during the pipeline (#2071)Alon Zakai2019-04-301-70/+80
| | | | | We flatten for the i64 lowering etc. passes, and it is worth optimizing afterwards, to clean up stuff they created. That is run if the user ran wasm2js with an optimization level (like wasm2js -O3). Split the test files to check both optimized and unoptimized code.
* wasm2js: start to optionally optimize the JS (#2046)Alon Zakai2019-04-241-2/+2
| | | Removes redundant | 0s and similar things. (Apparently closure compiler doesn't do that, so makes sense to do here.)
* wasm2js: unreachability fixes (#2037)Alon Zakai2019-04-221-1/+3
| | | Also test in pass-debug mode, for better coverage.
* Wasm2js memory fixes (#2003)Alon Zakai2019-04-121-30/+50
| | | | | | | | * I64ToI32Lowering - don't assume address 0 is a hardcoded location for scratch memory. Import __tempMemory__ for that. * RemoveNonJSOps - also use __tempMemory__. Oddly here the address was a hardcoded 1024 (perhaps where the rust program put a static global?). * Support imported ints in wasm2js, coercing them as needed. * Add "env" import support in the tests, since now we emit imports from there. * Make wasm2js tests split out multi-module tests using split_wast which is more robust and avoids emitting multiple outputs in one file (which makes no sense for ES6 modules)
* wasm2js: emscripten glue option (#2000)Alon Zakai2019-04-111-0/+4
| | | | | | Add a wasm2js option for the glue to be in emscripten-compatible format (as opposed to ES6). This does a few things so far: * Emit START_FUNCTIONS, END_FUNCTIONS markers in the code, for future use in the optimizer. * Emit the glue as a function to be called from emscripten.
* Improve test scripts (#1959)* Improve test scripts * feedback [skip ci]Sam Clegg2019-03-211-0/+46
| | | | | - Move auto_update_tests.py code into respective scripts - Use shared argument parsing in generate_lld_tests.py - Use wasm-ld rather than passing -flavor
* Rename `wasm2asm` to `wasm2js`, emit ESM by default (#1642)Alex Crichton2018-08-301-0/+110
* Rename the `wasm2asm` tool to `wasm2js` This commit performs a relatively simple rename of the `wasm2asm` tool to `wasm2js`. The functionality of the tool doesn't change just yet but it's intended that we'll start generating an ES module instead of just an `asm.js` function soon. * wasm2js: Support `*.wasm` input files Previously `wasm2js` only supported `*.wast` files but to make it a bit easier to use in tooling pipelines this commit adds support for reading in a `*.wasm` file directly. Determining which parser to use depends on the input filename, where the binary parser is used with `*.wasm` files and the wast parser is used for all other files. * wasm2js: Emit ESM imports/exports by default This commit alters the default behavior of `wasm2js` to emit an ESM by default, either importing items from the environment or exporting. Items like initialization of memory are also handled here.