summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* s-expr parsing: handle empty switchAlon Zakai (kripken)2017-06-011-0/+1
|
* harden parsing.hAlon Zakai (kripken)2017-06-011-46/+50
|
* harden s-expr parsingAlon Zakai (kripken)2017-06-011-25/+29
|
* fix call depth detection in wasm-opt interpretingAlon Zakai (kripken)2017-06-012-2/+2
|
* fix wasm-opt with INTERPRETER_DEBUGAlon Zakai (kripken)2017-06-011-0/+1
|
* handle the wrong number of functions being provided in binary formatAlon Zakai (kripken)2017-06-011-0/+8
|
* in extra pass-debug validation, don't assume there is always a function, the ↵Alon Zakai (kripken)2017-06-011-1/+1
| | | | error may be in a global init
* Exporting/importing debug location information from .wast/.asm.js/.s formats ↵Yury Delendik2017-06-0133-111/+786
| | | | | | | | (#1017) * Extends wasm-as, wasm-dis and s2wasm to consume debug locations. * Exports source map from asm2wasm
* simplify reloop testcaseAlon Zakai2017-05-242-5/+12
|
* Refactor optimization opts (#1023)Alon Zakai2017-05-243-98/+129
| | | | * refactor optimization opts helper code to a class
* be more careful when deleting files when testing binaryen methods - the ↵Alon Zakai2017-05-241-5/+5
| | | | files may not exist, and it is not an error if they do not, we just want them to not be there (#1024)
* More fuzz fixes (#1021)Alon Zakai2017-05-221-4/+16
| | | | | | * validate that memory/table segment values fit in the initial range * validate that select condition should be i32
* Merge pull request #1019 from WebAssembly/fuzzAlon Zakai2017-05-2121-7595/+7615
|\ | | | | More fuzz bug fixes
| * 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
| * relooper improvementsAlon Zakai (kripken)2017-05-205-5/+76
| |
| * use TypeUpdater in vacuumAlon Zakai (kripken)2017-05-2015-7590/+7466
|/
* afl-fuzz bug fixes (#1018)Alon Zakai2017-05-207-1/+312
| | | | | | | | * 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 (#1016)Alon Zakai2017-05-189-35/+80
| | | | | | * address review feedback for #1014
* optimize dceing of blocks and known-to-exist children (#1015)Alon Zakai2017-05-181-57/+34
|
* Validate finalization (#1014)Alon Zakai2017-05-1859-363/+4275
| | | | | | | * 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.
* optimize if and select in the case their values are identical (#1013)Alon Zakai2017-05-177-67/+190
|
* Re-reloop pass (#1009)Alon Zakai2017-05-1612-24/+1651
| | | | | 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 (#1008)Alon Zakai2017-05-162-42/+37
| | | | | | | | * 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
* Merge pull request #1007 from WebAssembly/brsAlon Zakai2017-05-1015-1200/+1169
|\ | | | | Misc minor remove-unused-brs improvements
| * merge blocks before and after remove-unused-brsAlon Zakai (kripken)2017-05-106-62/+64
| |
| * allow values to flow out of loops in RemoveUnneededBrs, and simplify some ↵Alon Zakai (kripken)2017-05-1010-1138/+1105
|/ | | | unnecessary complexity in that pass as well
* Flatten control flow pass (#999)Alon Zakai2017-05-107-0/+2432
| | | | | | | | | | | 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
* asm2wasm: properly infer return type of a call inside a sequence (#1006)Alon Zakai2017-05-098-14/+134
|
* fix autoDrop, now that we properly set block types, unreachable can easily ↵Alon Zakai2017-05-098-1/+184
| | | | happen, and autoDrop wasn't handling it (#1005)
* Unreachable typing fixes (#1004)Alon Zakai2017-05-0916-41/+403
| | | | | | | | | | | | * 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
* text format parsing fixes (#1002)Alon Zakai2017-05-081-4/+5
|
* fix an afl-fuzz bug where precompute alters a br to remove its condition, ↵Alon Zakai2017-05-083-0/+32
| | | | but does not properly modify the type (#1000)
* ctor-eval fixes (#996)Alon Zakai2017-05-0519-34/+171
| | | | | | | | * 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
* Make header guards consistent (#997)Sam Clegg2017-05-049-26/+23
|
* optimize duplication checks in binary format reading (#995)Alon Zakai2017-05-041-7/+5
|
* make function name duplicate testing handle the case of just some functions ↵Alon Zakai2017-05-031-5/+8
| | | | being named, and colliding with others' original names (#994)
* Merge pull request #993 from WebAssembly/dce-typesAlon Zakai2017-05-036-25/+106
|\ | | | | Make use of unreachable type consistent
| * fix unreachable typing: for all nodes, if they are not reached - e.g., a ↵Alon Zakai (kripken)2017-05-024-25/+40
| | | | | | | | binary with either side unreachable - then they are unreachable. this makes our usage of the unreachable type consistent
| * when creating blocks during dce, make sure they have the same type as before ↵Alon Zakai (kripken)2017-05-023-13/+79
|/ | | | the transformation, as the outside might care about that
* disallow empty blocks with a type - if they return a type, they must have ↵Alon Zakai2017-05-023-0/+11
| | | | contents. make s2wasm avoid outputting that as well (#992)
* improve dce to handle more cases of nested unreachable code (#989)Alon Zakai2017-05-028-80/+219
| | | | | | | | | | * 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
* Validation fixes for issues noticed by afl (#988)Alon Zakai2017-05-0210-6/+118
| | | | | | | | | | | | * 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
* Parsing fixes (#990)Alon Zakai2017-05-025-53/+156
| | | | | | | | | | * 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-0120-18/+404
| | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* handle a drop of an if with both arms unreachable, which is possible since ↵Alon Zakai2017-05-013-4/+38
| | | | 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. (#959)Michael Bebenita2017-04-298-0/+639
| | | | | | | | * Add pass to instrument loads / stores * Simplify instrumentation. * Document.
* ctor evaller (#982)Alon Zakai2017-04-2851-83/+1248
| | | | | 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-2814-101/+1231
| | | | | | | | | | | | | | * 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 (#978)H-Plus-Time2017-04-241-2/+47
| | | | | | * 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 (#977)Alon Zakai2017-04-193-503/+504
| | | | | | * update wasm.js and binaryen.js * update test output for new names section