summaryrefslogtreecommitdiff
path: root/src/tools
Commit message (Collapse)AuthorAgeFilesLines
* fix call depth detection in wasm-opt interpretingAlon Zakai (kripken)2017-06-011-1/+1
|
* Exporting/importing debug location information from .wast/.asm.js/.s formats ↵Yury Delendik2017-06-013-4/+51
| | | | | | | | (#1017) * Extends wasm-as, wasm-dis and s2wasm to consume debug locations. * Exports source map from asm2wasm
* Refactor optimization opts (#1023)Alon Zakai2017-05-243-98/+129
| | | | * refactor optimization opts helper code to a class
* add --fuzz-exec option to wasm-opt, which (when possible) executes results ↵Alon Zakai (kripken)2017-05-201-0/+73
| | | | before and after optimizations are run, checking for changes. this can be used when fuzzing
* 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.
* ctor-eval fixes (#996)Alon Zakai2017-05-051-3/+19
| | | | | | | | * fix wasm-ctor-eval, we need to look for the STACKTOP etc. imports, they may not be named, if this build is not with -g * pack memory after ctor evalling, since we merge it up which is less efficient * do some useful opts after ctor-evalling, to clean things up
* Parsing fixes (#990)Alon Zakai2017-05-021-0/+2
| | | | | | | | | | * properly catch a bunch of possible parse errors, found by afl-fuzz * clean up wasm-interpreter, use WASM_UNREACHABLE instead of abort * detect duplicate names in function names section * detect duplicate export names
* --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.
* ctor evaller (#982)Alon Zakai2017-04-281-0/+409
| | | | | Add wasm-ctor-eval, which evaluates functions at compile time - typically static constructor functions - and applies their effects into memory, saving work at startup. If we encounter something we can't evaluate at compile time in our interpreter, stop there. This is similar to ctor_evaller.py in emscripten (which was for asm.js).
* 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
* Fix typo in --finalize-table-base short name to -ftb (#972)Wink Saville2017-04-191-1/+1
|
* Fix bustage (#975)Alon Zakai2017-04-181-0/+5
| | | | | | * support -g in wasm-opt, which makes it easier to upgrade binaries for bustage * upgrade binaries in test/merge to new names section format
* wasm-merge tool (#919)Alon Zakai2017-04-171-0/+639
| | | | wasm-merge tool: combines two wasm files into a larger one, handling collisions, and aware of the dynamic linking conventions. it does not do full static linking, but may eventually.
* s2wasm: Add command line option for importing memory (#963)Max Klein2017-04-121-1/+7
| | | | | | This option allows to import the linear memory from JS code instead of exporting it. --emscripten-glue does this too but often the emscripten glue isn't needed, so this option only affects the memory. All the code necessary for importing the memory basically already exists, so nothing except for the command line option itself had to be added.
* Wasm h to cpp (#926)jgravelle-google2017-03-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | * Move WasmType function implementations to wasm.cpp * Move Literal methods to wasm.cpp * Reorder wasm.cpp shared constants back to top * Move expression functions to wasm.cpp * Finish moving things to wasm.cpp * Split out Literal into its own .h/.cpp. Also factor out common wasm-type module * Remove unneeded/transitive includes from wasm.h * Add comment to try/check methods * Rename tryX/checkX methods to getXOrNull * Add missing include that should fix appveyor build breakage * More appveyor
* 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)
* Fixes compilation error on clang (#925)Kazuki Oikawa2017-02-271-1/+1
|
* 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
* Improve handling of implicit traps (#898)Alon Zakai2017-02-061-7/+6
| | | | | | | | * add --ignore-implicit-traps option, and by default do not ignore them, to properly preserve semantics * implicit traps can be reordered, but are side effects and should not be removed * add testing for --ignore-implicit-traps
* Remove unused captures to fix warnings/errors when compiling with Clang (#896)Eric Holk2017-02-031-2/+1
|
* Read/Write Abstraction (#889)Alon Zakai2017-01-262-13/+39
| | | | | * 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 --symbolmap option to wasm-as, which emits a side file with the name ↵Alon Zakai2016-11-091-0/+5
| | | | mapping (similar to Names section, but external)
* 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-193-23/+101
| | | | And use them in wasm-opt and asm2wasm consistently and uniformly.
* Pass options (#788)Alon Zakai2016-10-181-2/+16
| | | | * add PassOptions structure, and use it for new -Os param to wasm-opt
* Import memory instead of defining/exporting it when using emscripten glue (#777)Derek Schuff2016-10-141-1/+2
| | | | | The emscripten JS module code creates the memory using the native wasm APIs, and imports that into the wasm module.
* Refactor Import::Kind and Export::Kind into an ExternalKind enum class (#725)Alon Zakai2016-10-031-2/+2
|
* 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
* Make wasm-as emit the names section/debug info only with -g (#705)Alon Zakai2016-09-261-0/+5
|
* error on putting spectest.print in a tableAlon Zakai2016-09-211-0/+11
|
* validate spectest.print as a functionAlon Zakai2016-09-201-1/+7
|
* global importing fixes: use the right counter for globals and for functionsAlon Zakai2016-09-201-1/+12
|
* support module operations in shell testsAlon Zakai2016-09-171-28/+55
|
* support assert_malformed in shell test runnerAlon Zakai2016-09-161-1/+6
|
* Add flag to s2wasm to export __growWasmMemory function (#696)jgravelle-google2016-09-091-0/+16
| | | | | | | | | | | | | | | | | | | | | * Add a flag to s2wasm to export grow_memory Binaryen's wasm.js-post.js calls back in to wasm in order to grow the linear memory, via a function that asm2wasm exports called __growWasmMemory. This changes exposes that method through s2wasm when invoked with a flag. * Move AsmConstWalker from wasm-linker to wasm-emscripten * Add test for memory growth in s2wasm * Move makeDynCallThunks into wasm-emscripten module * Move mutation in getTableSegment into a separate method * Move emscripten metadata generation into wasm-emscripten Also make AsmConstWalker internal to the wasm-emscripten module, as it's only used for the metadata pass.
* 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
|
* wasm-shell improvements: print out which module is built, add option to skip ↵Alon Zakai2016-09-071-2/+27
| | | | lines
* better printing when assert_invalids failAlon Zakai2016-09-071-1/+7
|
* validate properly in wasm-optAlon Zakai2016-07-131-1/+4
|
* separate wasm-opt out from wasm-shell: opt optimizes, shell runs wast shell ↵Alon Zakai2016-07-133-46/+103
| | | | tests
* rename binaryen-shell to wasm-shellAlon Zakai2016-07-131-1/+1
|
* print line numbers when running tests in shellAlon Zakai2016-07-061-1/+4
|
* prefix make_unique in binaryen_shell for visual studio workarounds (#595)Alon Zakai2016-06-231-4/+4
|
* support -o in binaryen-shell (#592)Alon Zakai2016-06-181-0/+9
|