summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* Flatten tee (#1296)Alon Zakai2017-11-171-1/+15
| | | | | * flatten tee_local in flatten, as it leads to more-optimizable code (tee_local, when nested, can introduce side effects in bad places). * also fix some test stuff from recent merges
* Fix if copying (#1278)Alon Zakai2017-11-162-6/+36
| | | | * fix if copying - we should preserve the forced explicit type if there is one, and not just infer it from the arms. this adds a builder method for makeIf that receives a type to apply to the if, and for blocks a method that makes a block from a list, also with a variant with a provided type
* Decouple wasm-linker from Emscripten glue (#1293)Jacob Gravelle2017-11-156-139/+170
|
* Add const expression utilities to binaryen-c/.js (#1288)Daniel Wirtz2017-11-153-0/+85
|
* add i64_atomics_* support to asm2wasm (#1262)Alon Zakai2017-11-143-1/+51
| | | | | | * add i64_atomics_* support to asm2wasm * OptimizeInstructions: atomic loads can't be signed
* accept overlapping segments (#1289)Alon Zakai2017-11-141-5/+2
|
* a stacky value in the middle of a block may be consumed (#1267)Alon Zakai2017-11-131-1/+20
|
* Update call_indirect text syntax to match spec update (#1281)Derek Schuff2017-11-132-2/+4
| | | | Function type gets its own element rather than being a part of the call_indirect (see WebAssembly/spec#599)
* Fix yet another BinaryenAddGlobal tracing issue (#1283)Daniel Wirtz2017-11-131-1/+1
| | | Now also includes a test.
* Add atomic ops to binaryen.js (#1280)Daniel Wirtz2017-11-131-0/+180
|
* Fast pass fuzzing (#1258)Alon Zakai2017-11-132-24/+85
| | | | * add fuzz-pass option, which picks random passes to fuzz in each wasm-opt invocation
* Added expression utility functions to binaryen-c/.js (#1269)Daniel Wirtz2017-11-113-0/+121
|
* Fixed use of undefined 'types' array in BinaryenAddGlobal tracing (#1279)Daniel Wirtz2017-11-101-1/+1
| | | | | | * Fixed use of undefined 'types' array in BinaryenAddGlobal tracing * also fix use of 'expressions'
* Rereloop fuzz fix (#1259)Alon Zakai2017-11-091-0/+12
| | | | * fix relooper bug, ensure function body has right type, as relooper output does not flow stuff out, but wasm functions with a result do expect a flow value, so none is not an option. in other words, as the docs say, a relooper block must end with a terminator (return, unreachable, break, etc.) and not flow out.
* Added BinaryenAtomic* incl. ops to binaryen-c (#1276)Daniel Wirtz2017-11-092-1/+57
| | | | | | * Added BinaryenAtomicRMW incl. ops to binaryen-c * AtomicCmpxchg, AtomicWait, AtomicWake
* fix wasm-reduce bug, the second validator param is the features, not the ↵Alon Zakai2017-11-091-1/+1
| | | | flags (#1277)
* Use 'BinaryenGlobalRef' instead of 'BinaryenImportRef' for globals in ↵Daniel Wirtz2017-11-072-2/+4
| | | | binaryen-c (#1270)
* Restrict validation output to just validation errors in the API (#1253)Daniel Wirtz2017-11-018-6/+25
| | | Do not print the entire and possibly very large module when validation fails. Leave printing to tools using the validator, instead of always doing it in the validator where it can't be overridden.
* Fix binaryen.js's wasm2asm (#1257)Alon Zakai2017-11-012-0/+55
| | | | * fix wasm2asm in binaryen.js, the function locals may not all have names, so add them as necessary
* Added the ability to run specific optimization passes to binaryen-c/.js (#1252)Daniel Wirtz2017-10-304-1/+32
|
* Print wasm2asm parsing errors (#1251)Alon Zakai2017-10-271-12/+22
|
* Add Features enum to IR (#1250)Derek Schuff2017-10-2711-12/+41
| | | | | | | | | | | | This enum describes which wasm features the IR is expected to include. The validator should reject operations which require excluded features, and passes should avoid producing IR which requires excluded features. This makes it easier to catch possible errors in Binaryen producers (e.g. emscripten). Asm2wasm has a flag to enable or disable atomics. Other tools currently just accept all features (as, dis and opt are just for inspecting or modifying existing modules, so it would be annoying to have to use flags with those tools and I expect the risk of accidentally introducing atomics to be low).
* notation change: AST => IR (#1245)Alon Zakai2017-10-2467-156/+157
| | | The IR is indeed a tree, but not an "abstract syntax tree" since there is no language for which it is the syntax (except in the most trivial and meaningless sense).
* Improve constant fuzzing (#1244)Alon Zakai2017-10-241-5/+8
| | | | | Generalize constant emitting in fuzzer, using +-1 and *+-1 effects to create more constants in a convenient way. Also workaround for a gcc-7.2/windows issue that we don't fully understand, but removing the 1, -1 from those pick() calls avoids the bug.
* Fix atomics refinalization (we were missing some glue) (#1241)Alon Zakai2017-10-242-2/+118
| | | | And add a visitor which must override all its elements, so this never happens again
* fix safe-heap regression with handling of existing imports (#1237)Alon Zakai2017-10-241-2/+2
|
* Remove unused PassOptions from wasm-ctor-eval.cpp (#1238)Taiju Tsuiki2017-10-241-1/+0
| | | |passOptions| in wasm-ctor-eval.cpp causes a compile failure, -Wunused-variable on the clang build.
* add a timeout param to wasm-reduce (#1230)Alon Zakai2017-10-231-2/+11
|
* only look at the |signed| field of loads if it is relevant (#1235)Alon Zakai2017-10-233-6/+53
|
* Emit binary function index in comment in text format, for convenience (#1232)Alon Zakai2017-10-204-30/+76
|
* Move pointer positioning outside of vector access operator to avoid MSVC ↵Mark A. Ropper2017-10-201-2/+2
| | | | complaining about out-of-range values (#1233)
* Atomics support in interpreter + optimizer + fuzz fixes for that (#1227)Alon Zakai2017-10-2014-118/+361
|
* Avoid returning a PassRunner just for OptimizationOptions (#1234)Alon Zakai2017-10-203-5/+7
| | | | | | | | * avoid returning a PassRunner just for OptimizationOptions, it would need a more careful design with a copy constructor. instead, just simplify the API to do the thing we need, which is run the passes * disallow copy constructor * delete copy operator too
* use simplify-locals in wasm2asm, so the output is not horribly verbose with ↵Alon Zakai2017-10-201-0/+1
| | | | los of extra inefficient variables. this is more similar to the output we had before the flatten rewrite (#1229)
* clean up ImportUtils: make getImport return the import (more consistent with ↵Alon Zakai2017-10-173-31/+50
| | | | other similar APIs) and fix some ctor-evalling handling of imports, which was incorrect - we need to create fake globals when importing globals, not later, which is too late for initialized globals from imports (#1226)
* Use the type system to check if something is flowed out of (#1224)Alon Zakai2017-10-162-15/+3
| | | | now that the type system has a proper unreachable, we don't need obviouslyDoesNotFlowOut
* Fixed parseFile() skipping every other line (#1223)Alexander Meißner2017-10-161-29/+10
| | | | | | | | * Fixed parseFile() skipping every other line Was caused by "s = strchr(s, '\n')" Also replaced recordFile() by parseFile() as they do exactly the same * Added parseFile() to process() in s2wasm.h
* fix ssaify bug where we failed to update the location of values as we moved ↵Alon Zakai2017-10-112-6/+25
| | | | them around, causing us to zero out the wrong thing in another place and ensuing hilarity (#1212)
* fix simplify-locals bug where we create a br_if value, which is dangerous if ↵Alon Zakai2017-10-111-0/+46
| | | | we are moving code out of the br_if's condition - the value executes before (#1213)
* fix re-reloop fuzz bug, we need to ensure a terminator in all relooper ↵Alon Zakai2017-10-112-0/+33
| | | | blocks (#1214)
* Add Builder::makeGlobal for nicer global creation (#1221)Alon Zakai2017-10-105-44/+61
|
* some readme and doc fixes and improvements (#1219)Alon Zakai2017-10-101-1/+1
|
* fix a dce fuzz bug where if changed to unreachable but didn't propagate that ↵Alon Zakai2017-10-102-1/+18
| | | | effect up. also add set_global support in dce (#1218)
* Fuzzer: create and use globals in fuzz programs (#1217)Alon Zakai2017-10-101-5/+44
|
* fix wasm-builder set_global creation - we must call finalize, as the value ↵Alon Zakai2017-10-101-0/+1
| | | | may be unreachable (#1216)
* optimize helper funcs (like i32-div) if created in asm2wasm, so they are ↵Alon Zakai2017-10-043-8/+32
| | | | consistently handled regardless of whether we optimize in parallel or not (#1208)
* Add a superclass typedef to WalkerPass to simplify overrides (#1211)jgravelle-google2017-10-0412-14/+17
|
* Flattening rewrite (#1201)Alon Zakai2017-10-038-529/+396
| | | | | | | | | | | | | | | | | | | | Rename flatten-control-flow to flatten, which now flattens everything, not just control flow, so e.g. (i32.add (call $x) (call $y) ) ==> (block (set_local $temp_x (call $x)) (set_local $temp_y (call $y)) (i32.add (get_local $x) (get_local $y) ) ) This uses more locals than before, but is much simpler and avoids a bunch of corner cases and fuzz bugs the old one hit. We can optimize later if necessary.
* Refactor validator API to use enums (#1209)Alon Zakai2017-10-036-11/+24
| | | | * refactor validator API to use enums
* Add --trap-mode=allow/clamp/js argument to asm2wasm and s2wasm (#1210)jgravelle-google2017-10-033-33/+43
| | | | | | | | | | * Add --trap-mode=allow/clamp/js argument to asm2wasm and s2wasm * Update asm2wasm and auto_update_tests scripts to use --trap-mode * Throw std::invalid_argument instead of adding a new Invalid TrapMode type * Remove legacy asm2wasm trap mode arguments