summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* Untee pass (#1053)Alon Zakai2017-06-144-3/+66
|
* S-expression parsing in C API and binaryen.js (#1050)Alon Zakai2017-06-133-0/+29
| | | | | | * add C API and binaryen.js support for parsing s-expressions * update js builds and tests
* SSA pass (#1049)Alon Zakai2017-06-1313-29/+698
| | | | | | | * Add SSA pass which ensures a single assign for each local, except for merged locals where we ensure exactly a single assign from one of the paths leading to that use * Also add InstrumentLocals pass, useful for debugging locals (similar to InstrumentMemory but for locals) * Fix a PickLoadSigns bug with tees not being ignored, which was not noticed until now because we ran it on flatter output by default, but the ssa pass uncovered the bug
* fix interpreted code from wasm.js (#1043)Alon Zakai2017-06-121-2/+2
| | | | | | * fix interpreted code from wasm.js, when the result is none, we must return an empty Literal (the interpreter now asserts on this, it didn't before) * update js builds
* Support new result syntax for if/loop/block (#1047)Sam Clegg2017-06-127-25/+37
| | | | | | Support both syntax formats in input since the old spec tests still need to be parsable.
* Optimize/merge duplicate function types (#1041)Alon Zakai2017-06-121-1/+66
|
* Log callImport fatal error to cerr so it is not buffered. (#1036)Sam Clegg2017-06-123-3/+13
| | | | | | | Use Fatal() rather than stdout or report callImport error Without this the write to stdout can be lost (Since the following line aborts)
* Output inf/-inf rather than infinity/-infinitySam Clegg2017-06-091-1/+1
| | | | | wast2wasm wes recently updated to only support the former: https://github.com/WebAssembly/wabt/pull/482
* C API fixes (#1042)Alon Zakai2017-06-071-16/+17
| | | | | | * fix mutex usage in C API, and some minor cleanup around it too * update testcase that was forgotten to be updated before
* Update binaryen-c/binaryen.js, fixes #1028, fixes #1029 (#1030)Daniel Wirtz2017-06-076-11/+179
| | | This PR adds global variable support (addGlobal, getGlobal, setGlobal), host operations (currentMemory, growMemory), a few utility functions (removeImport, removeExport, getFunctionTypeBySignature with the latter being scheduled for removal once a better alternative is in place) and it introduces an additional argument to specify the result type in BinaryenBlock (effectively breaking the C-API but retaining previous behaviour by introducing the BinaryenUndefined() type for this purpose). Additionally, it enables compilation with exception support in build-js.sh as exceptions are thrown and caught when optimizing endless loops, intentionally resulting in an unreachable opcode. Affected test cases have been updated accordingly.
* S2wasm runtime funcs (#1027)jgravelle-google2017-06-054-16/+137
| | | | | | | | | | | | | | | | * Generate stackSave function in s2wasm * Generate stackAlloc in s2wasm * Generate stackRestore in s2wasm * Update dot_s tests for runtime functions * Add s2wasm check for exporting runtime functions * Fix flake8 for s2wasm.py * Rename wasmBuilder to builder
* validate returned values in all cases, even if the function returns none we ↵Alon Zakai2017-06-021-6/+4
| | | | should still not have returns with a value, etc. update spec tests to remove some stacky tests that do not fit these new validation rules (#1034)
* clean up unnecessary spacingAlon Zakai2017-06-011-1/+1
|
* use atoll in getCheckedAddress string parsingAlon Zakai2017-06-011-1/+1
|
* refactor s-expr parsing code to remove duplication and unnecessary thingsAlon Zakai2017-06-012-39/+23
|
* remove unneeded code in interpreterAlon Zakai (kripken)2017-06-011-1/+0
|
* error if select sides are concrete but differentAlon Zakai (kripken)2017-06-011-0/+3
|
* fix fuzz-exec catching of traps, they can occur during init, not just callAlon Zakai (kripken)2017-06-011-6/+7
|
* handle out of range memory size values in s-expr parsingAlon Zakai (kripken)2017-06-011-2/+10
|
* handle out of range break offset parsingAlon Zakai2017-06-011-0/+2
|
* verify s-expr parsing of alignmentsAlon Zakai2017-06-011-2/+6
|
* validate memory/table Address values in s-expr parsingAlon Zakai (kripken)2017-06-011-4/+20
|
* trap on bad result types in shell-interface callTableAlon Zakai (kripken)2017-06-011-0/+3
|
* handle empty stack in sourceToUniqueAlon Zakai (kripken)2017-06-011-1/+4
|
* host op parsing error handlingAlon Zakai (kripken)2017-06-012-2/+11
|
* handle duplicate functions in s-expr parsingAlon Zakai (kripken)2017-06-011-0/+1
|
* throw parse errors in UniqueNameMapperAlon Zakai (kripken)2017-06-011-2/+8
|
* handle duplicate function types in s-expr parsingAlon Zakai (kripken)2017-06-011-0/+2
|
* handle duplicate imports and globals in s-expr parsingAlon Zakai (kripken)2017-06-011-0/+6
|
* handle a parse error of a function declaration with mixed import insideAlon Zakai (kripken)2017-06-011-0/+1
|
* 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
|
* 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-0115-27/+438
| | | | | | | | (#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
* 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
* 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-202-1/+9
|
* use TypeUpdater in vacuumAlon Zakai (kripken)2017-05-202-36/+48
|
* afl-fuzz bug fixes (#1018)Alon Zakai2017-05-202-0/+7
| | | | | | | | * 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-188-35/+77
| | | | | | * 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-1827-142/+809
| | | | | | | * 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-171-0/+39
|
* Re-reloop pass (#1009)Alon Zakai2017-05-167-14/+342
| | | | | 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 blocks before and after remove-unused-brsAlon Zakai (kripken)2017-05-101-1/+2
|