summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Improve constant fuzzing (#1244)Alon Zakai2017-10-242-830/+713
| | | | | 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 flake8 failures in scripts/ (#1239)Taiju Tsuiki2017-10-246-19/+25
| | | flake8 starts warning on bare "except:" in python scripts, and all CI job is failing for that.
* fix safe-heap regression with handling of existing imports (#1237)Alon Zakai2017-10-243-2/+4050
|
* 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-20354-4079/+4133
|
* 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-2018-939/+1152
|
* 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-2010-1224/+380
| | | | los of extra inefficient variables. this is more similar to the output we had before the flatten rewrite (#1229)
* Update auto_update_tests.py for trap-mode flags (#1225)Jacob Gravelle2017-10-171-10/+19
|
* 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-164-27/+53
| | | | 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-162-29/+11
| | | | | | | | * 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-114-6/+89
| | | | 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-113-0/+142
| | | | 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-115-2/+118
| | | | blocks (#1214)
* remove some unneeded and outdated tests, which were useful in bootstrapping ↵Alon Zakai2017-10-111-69/+0
| | | | but are now much better covered by the emscripten test suite anyhow (#1222)
* Add Builder::makeGlobal for nicer global creation (#1221)Alon Zakai2017-10-105-44/+61
|
* fix test breakage from colliding PRs landing too quickly (#1220)Alon Zakai2017-10-101-24/+15
|
* some readme and doc fixes and improvements (#1219)Alon Zakai2017-10-102-9/+12
|
* fix a dce fuzz bug where if changed to unreachable but didn't propagate that ↵Alon Zakai2017-10-104-20/+78
| | | | effect up. also add set_global support in dce (#1218)
* Fuzzer: create and use globals in fuzz programs (#1217)Alon Zakai2017-10-102-373/+974
|
* fix wasm-builder set_global creation - we must call finalize, as the value ↵Alon Zakai2017-10-103-0/+83
| | | | may be unreachable (#1216)
* optimize helper funcs (like i32-div) if created in asm2wasm, so they are ↵Alon Zakai2017-10-0410-9/+142
| | | | 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-0326-2245/+4625
| | | | | | | | | | | | | | | | | | | | 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-037-13/+27
| | | | * refactor validator API to use enums
* Add --trap-mode=allow/clamp/js argument to asm2wasm and s2wasm (#1210)jgravelle-google2017-10-036-39/+49
| | | | | | | | | | * 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
* Fast validation (#1204)Alon Zakai2017-10-024-378/+482
| | | | | | | This makes wasm validation parallel (the function part). This makes loading+validating tanks (a 12MB wasm file) 2.3x faster on a 4-core machine (from 3.5 to 1.5 seconds). It's a big speedup because most of loading+validating was actually validating. It's also noticeable during compilation, since we validate by default at the end. 8% faster on -O2 and 23% on -O0. So actually fairly significant on -O0 builds. As a bonus, this PR also moves the code from being 99% in the header to be 1% in the header.
* Share trap mode between asm2wasm and s2wasm (#1168)jgravelle-google2017-10-0233-510/+2312
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Extract Asm2WasmBuilder::TrapMode to shared FloatTrapMode * Extract makeTrappingI32Binary * Extract makeTrappingI64Binary * Extract asm2wasm test script into scripts/test/asm2wasm.py This matches s2wasm.py, and makes iterating on asm2wasm slightly faster. * Simplify callsites with an arg struct * Combine func adding across i32 and i64 * Support f32-to-int in asm2wasm * Add BinaryenTrapMode pass, run pass from s2wasm * BinaryenTrapMode pass takes trap context as a parameter * Pass fully supports non-trapping binary ops * Defer adding functions until after iteration (hackily) * Update asm2wasm to work with deferred function adding, rebuild tests * Extract makeTrappingFloatToInt32 * Extract makeTrappingFloatToInt64 * Add unary conversions to trap pass * Add functions in the pass itself * Set s2wasm trap mode with command-line arguments * Print BINARYEN_PASS_DEBUG state when testing * Get asm2wasm using the BinaryenTrapMode pass instead of handling it inline * Also handle f32 to int in asm2wasm * Make BinaryenTrapMode only need a FloatTrapMode from the caller * Just pass the current binary Expression directly * Combine makeTrappingI32Binary with makeTrappingI64Binary * Pass Unary expr to makeTrappingFloatToInt32 * Unify makeTrappingFloatToInt32 & 64 * Move makeTrapping* functions inside BinaryenTrapMode, make addedFunctions non-static * Remove FloatTrapContext * Minor cleanups * Extract some smaller subfunctions * Emit name switch/casing, rename is32Bit to isI64 for consistency * Rename BinaryenTrapMode to FloatTrap, make trap mode a nested enum * Add some comments explaining why FloatTrap is non-parallel * Rename addedFunctions to generatedFunctions for precision * Rename move and split float-clamp.h to passes/FloatTrap.(h|cpp) * Use builder instead of allocator * Instantiate trap handling passes via the pass manager * Move passes/FloatTrap.h to ast/trapping.h * Add helper function to add trap-handling passes * Add trap mode pass tests * Rename FloatTrap.cpp to TrapMode.cpp * Add s2wasm trap mode tests. Force float->int conversion to be signed * Add trapping_sint_div_s test to unit.asm.js * Fix flake8 issues with test scripts * Update pass description comment * Extract building functions methods * Make generate functions into top-level functions * Add GeneratedTrappingFunctions class to manage function/import additions * Move ensure/makeTrapping functions outside class scope * Use GeneratedTrappingFunctions to add immediately in asm2wasm mode * Remove trapping_sint_div_s test We only added it to test that trapping divisions would get constant-folded at the correct time. Now that we're not changing the timing of trapping modes, the test is unneeded (and problematic). * Review feedback, add validator/*.wasm to .gitignore * Add support for unsigned float-to-int conversion * Use opcode directly instead of bools * Update s2wasm clamp test for unsigned ftoi
* fix regression from 45d88e3ef5f895b2fde77e3588f84d66e67bdd88 - left may not ↵Alon Zakai2017-10-023-1/+45
| | | | exist, need to return curr->left, after that change (#1207)
* fix optimize-instructions handling of shifts by a zero or of a zero when ↵Alon Zakai2017-10-023-2/+53
| | | | combining added constants (#1206)
* Thread fixes (#1205)Alon Zakai2017-10-022-24/+42
| | | | | | * don't use multiple threads in torture tests, which are parallel anyhow * if we fail to create a thread, don't use multiple threads
* Optimize wasm reading (#1202)Alon Zakai2017-09-282-2/+10
| | | * optimize wasm reading: use a set of the breaks we've seen, don't rescan blocks to see if they have breaks to them
* Merge pull request #1195 from WebAssembly/fuzzAlon Zakai2017-09-276-784/+490
|\ | | | | Fuzzer improvements and a fuzz fix on negative-zero comparison
| * fix ExpressionAnalyzer::equals on consts, they need to be bitwise equal, ↵Alon Zakai2017-09-273-1/+64
| | | | | | | | i.e., 0 != -0
| * fuzzing improvements:Alon Zakai2017-09-273-783/+426
|/ | | | | | | | * randomize initial memory * low chance to have tiny blocks * decent chance to have a branch back to the loop top
* fix dce bug with not updating the parent when turning a node unreachable (#1198)Alon Zakai2017-09-254-23/+138
|
* wasm2asm fixes for coercion on rotl/rotr/ctz/popcnt calls, and refactor the ↵Alon Zakai2017-09-234-33/+52
| | | | name of constants to include the WASM_ prefix so as not to collide with constants for the unprefixed values (#1199)
* Refactor i64 lowering to use RAII temp vars (#1177)Thomas Lively2017-09-232-211/+259
| | | | | | * Refactor i64 lowering to use RAII temp vars * Always generate trampoline blocks for Switch lowering
* Make localNames into a map (#1189)Thomas Lively2017-09-234-16/+20
|
* when we re-finalize a function body, we may have changed it from unreachable ↵Alon Zakai2017-09-223-0/+39
| | | | to none. that is bad if the function has a return value, as unreachable was ok but none is not. in that case, we must add an unreachable (#1193)
* Update text syntax for shared memory limits (#1197)Derek Schuff2017-09-2234-54/+52
| | | | Following WebAssembly/threads#58 e.g. (memory $0 23 256 shared) is now (memory $0 (shared 23 256))
* remove implicit fallthroughs (#1194) (#1196)Jeremy Day2017-09-203-703/+599
|
* Expressions should not appear twice in the ast (#1191)Alon Zakai2017-09-186-249/+307
|
* Add missing objects to build-js.sh (#1187)Sergey Pepyakin2017-09-181-0/+2
|
* default waterfall testing to off (#1186)Alon Zakai2017-09-162-6/+6
|