summaryrefslogtreecommitdiff
path: root/src/tools/asm2wasm.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Exporting/importing debug location information from .wast/.asm.js/.s formats ↵Yury Delendik2017-06-011-3/+16
| | | | | | | | (#1017) * Extends wasm-as, wasm-dis and s2wasm to consume debug locations. * Exports source map from asm2wasm
* Refactor optimization opts (#1023)Alon Zakai2017-05-241-9/+13
| | | | * refactor optimization opts helper code to a class
* Validate finalization (#1014)Alon Zakai2017-05-181-1/+6
| | | | | | | * validate that types are properly finalized, when in pass-debug mode (BINARYEN_PASS_DEBUG env var): check after each pass is run that the type of each node is equal to the proper type (when finalizing it, i.e., fully recomputing the type). * fix many fuzz bugs found by that. * in particular, fix dce bugs with type changes not being fully updated during code removal. add a new TypeUpdater helper class that lets a pass update types efficiently, by the helper tracking deps between blocks and branches etc., and updating/propagating type changes only as necessary.
* --no-js-ffi opt to disable JS FFI mangling. (#984)Joel Martin2017-05-011-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Preserve debug info through the optimizer (#981)Alon Zakai2017-04-281-4/+3
| | | | | | | | | | | | | | * add debugInfo option to passes, and use it to keep debug info alive through optimizations when we need it * add fib testcase for debug info * when preserving debug info, do not move code around call-imports, so debug info intrinsics remain stationary * improve wasm-module-building handling of the single-threaded case: don't create workers, which is more efficient and also nicer for debugging * process debug info in a more precise way, reordering it from being after the node (as it was a comment in JS) to before the node * remove unreachable hack for debug info, which is no longer needed since we reorder them, and make sure to finalize blocks in which we reorder
* Use 3 modes for potentially trapping ops in asm2wasm (#929)Alon Zakai2017-03-071-5/+17
| | | * use 3 modes for potentially trapping ops in asm2wasm: allow (just emit a potentially trapping op), js (do exactly what js does, even if it takes a slow ffi to do it), and clamp (avoid the trap by clamping as necessary)
* asm2wasm debuginfo (#895)Alon Zakai2017-02-071-2/+10
| | | | | | | | | | | | * parse file/line comments in asm.js into debug intrinsics * convert debug intrinsics into annotations, and print them * ignore --debuginfo if not emitting text, as wasm binaries don't support that yet * emit full debug info when -g and emitting text; when -g and emitting binary, all we can do is the Names section * update wasm.js
* Read/Write Abstraction (#889)Alon Zakai2017-01-261-2/+19
| | | | | * Added ModuleReader/Writer classes that support text and binary I/O * Use them in wasm-opt and asm2wasm
* add table-max option, and make it and mem-max set the limit to no limit for -1Alon Zakai2016-12-071-2/+21
|
* add --mem-max option to set the maximum size of memory, overriding the ↵Alon Zakai2016-11-111-0/+10
| | | | default (which is the normal size of memory if no growth, or infinity if growth) (#837)
* add a pass to optimize memory segments, and pack memory in asm2wasmAlon Zakai2016-11-011-0/+5
|
* add a --memory-base options to asm2wasm, to fix the memory base instead of ↵Alon Zakai2016-10-311-1/+12
| | | | depending on an import
* Add -O0,-O1,etc. options (#790)Alon Zakai2016-10-191-5/+7
| | | | And use them in wasm-opt and asm2wasm consistently and uniformly.
* passRunner debug and validation improvements (#726)Alon Zakai2016-10-021-5/+0
|
* asm2wasm i64 support (#723)Alon Zakai2016-09-301-1/+6
| | | | | | | | | | | | * support i64 intrinsics from fastcomp, adding --wasm-only flag * refactor callImport logic in asm2wasm to avoid recomputing wasm types again * legalize illegal i64 params in exports and imports * do safe i64 binary ops depending on precision * fix addVar, only assert on names if we are using a name
* import memoryBase and tableBaseAlon Zakai2016-09-071-9/+1
|
* add asm2wasm option to import a mem init fileAlon Zakai2016-09-071-1/+23
| | | | | | | | apply memory segments only if there isn't a memory initializer (which we need for asmjs and asm2wasm modes) use wasm-opt to check recreated wasts for validity, as wasm-shell would try to execute them add testing for combined modes like asmjs,interpret-binary
* use globals in asm2wasmAlon Zakai2016-09-071-11/+1
|
* add OptimizingIncrementalModuleBuilder for faster incremental module ↵Alon Zakai2016-06-021-6/+1
| | | | building + optimizing
* move console tool sources into src/tools (#490)Alon Zakai2016-05-121-0/+114