| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
error may be in a global init
|
|
|
|
|
|
|
|
| |
(#1017)
* Extends wasm-as, wasm-dis and s2wasm to consume debug locations.
* Exports source map from asm2wasm
|
| |
|
|
|
|
| |
* refactor optimization opts helper code to a class
|
|
|
|
| |
files may not exist, and it is not an error if they do not, we just want them to not be there (#1024)
|
|
|
|
|
|
| |
* validate that memory/table segment values fit in the initial range
* validate that select condition should be i32
|
|\
| |
| | |
More fuzz bug fixes
|
| |
| |
| |
| | |
before and after optimizations are run, checking for changes. this can be used when fuzzing
|
| | |
|
|/ |
|
|
|
|
|
|
|
|
| |
* values cannot flow through an if without an else, they never return a value
* check pass tests in pass-debug mode too
* add missing finalization in binary reading
|
|
|
|
|
|
| |
* address review feedback for #1014
|
| |
|
|
|
|
|
|
|
| |
* 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.
|
| |
|
|
|
|
|
| |
This adds a pass that converts to a CFG, runs the relooper, and re-generates wasm from that. This depends on flatten-control-flow being run before.
The main goal here is to help code generators other than asm2wasm (which already receives relooped code from fastcomp).
|
|
|
|
|
|
|
|
| |
* parallelize istring creation, by having a thread-local set and a global set guarded by a mutex. each time a new string shows up in a thread, it will be added to that thread's set, after accessing the global set through the lock first, which means we lock at most once per new string per thread
* don't leak strings in istring store
* since we now create names in a parallel thread-safe manner, we don't need to pre-create names in RelooperJumpThreading
|
|\
| |
| | |
Misc minor remove-unused-brs improvements
|
| | |
|
|/
|
|
| |
unnecessary complexity in that pass as well
|
|
|
|
|
|
|
|
|
|
|
| |
This pass flattens out control flow in order to achieve 2 properties:
* Control flow structures (block, loop, if) and control flow operations (br, br_if, br_table, return, unreachable) may only be block children, a loop body, or an if-true or if-false. (I.e., they cannot be nested inside an i32.add, a drop, a call, an if-condition, etc.)
* Disallow block, loop, and if return values, i.e., do not use control flow to pass around values.
As a result, expressions cannot contain control flow, and overall control flow is simpler, more structured, and more "flat".
This should make things like re-relooping wasm code much easier, as they can run after the cfg is flattened
|
| |
|
|
|
|
| |
happen, and autoDrop wasn't handling it (#1005)
|
|
|
|
|
|
|
|
|
|
|
|
| |
* fix type of drop, set_local, set_global, load, etc: when operand is unreachable, so is the node itself
* support binary tests properly in test/passes
* fix unreachable typing of blocks with no name and an unreachable child
* fix continue emitting in asm2wasm
* properly handle emitting of unreachable load
|
| |
|
|
|
|
| |
but does not properly modify the type (#1000)
|
|
|
|
|
|
|
|
| |
* 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
|
| |
|
| |
|
|
|
|
| |
being named, and colliding with others' original names (#994)
|
|\
| |
| | |
Make use of unreachable type consistent
|
| |
| |
| |
| | |
binary with either side unreachable - then they are unreachable. this makes our usage of the unreachable type consistent
|
|/
|
|
| |
the transformation, as the outside might care about that
|
|
|
|
| |
contents. make s2wasm avoid outputting that as well (#992)
|
|
|
|
|
|
|
|
|
|
| |
* improve dce to handle more cases of nested unreachable code, in particular, when the child is unreachable in type but not an actual Unreachable node, e.g. if it's a br. in that case, we just need to verify that the br is not to us where we are a block or loop
* handle unreachable switch conditions in dce
* handle dce of br condition which is unreachable, and host arguments
* handle dce of block i32 etc. which is actually unreachable
|
|
|
|
|
|
|
|
|
|
|
|
| |
* properly validate block endings
* blocks with a value must not have a last element that is none
* fully validate input types to binary expressions
* validate i32.eqz/i64.eqz more carefully
* if condition must be i32
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
| |
wasm added if types, which mean the if can be i32 even if the arms are unreachable etc (#991)
|
|
|
|
|
|
|
|
| |
* Add pass to instrument loads / stores
* Simplify instrumentation.
* Document.
|
|
|
|
|
| |
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).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
| |
* Fixed issue 965 as per @binji's wabt fix, add platform-specific build options, which fixes building on ARM.
* Added logging for platform-specific flags
|
|
|
|
|
|
| |
* update wasm.js and binaryen.js
* update test output for new names section
|