Commit message (Collapse) | Author | Age | Files | Lines | ||
---|---|---|---|---|---|---|
... | ||||||
* | Do not export start function (#998) | Daniel Wirtz | 2017-08-18 | 1 | -1/+0 | |
| | ||||||
* | wasm2asm test generation (#1124) | Thomas Lively | 2017-08-16 | 9 | -115/+300 | |
| | | | | | | | | | | | | | | | | | * Translate assert_return invokes to asm * Translate assert_trap tests to JS * Enable wasm2asm tests * Fix wasm2asm translation of store * Update ubuntu nodejs in Travis * Free JSPrinter buffer * Use unique_ptr for Functions to prevent leaks * Add tests for assert translation | |||||
* | Emit optimal-size LEBs in section/subsection/function body sizes (#1128) | Alon Zakai | 2017-08-15 | 2 | -12/+42 | |
| | | | | * emit optimal-size LEBs in section/subsection/function body sizes, instead of preallocating 5 bytes | |||||
* | New fuzzer (#1126) | Alon Zakai | 2017-08-11 | 7 | -83/+1448 | |
| | | | | | | This adds a new method of fuzzing, "translate to fuzz" which means we consider the input to be a stream of data that we translate into a valid wasm module. It's sort of like a random seed for a process that creates a random wasm module. By using the input that way, we can explore the space of valid wasm modules quickly, and it makes afl-fuzz integration easy. Also adds a "fuzz binary" option which is similar to "fuzz execution". It makes wasm-opt not only execute the code before and after opts, but also write to binary and read from it, helping to fuzz the binary format. | |||||
* | when inlining, we must zero out non-param locals, as their initial zero ↵ | Alon Zakai | 2017-08-10 | 1 | -5/+11 | |
| | | | | value may be depended on (#1127) | |||||
* | Improve and enable inlining pass (#966) | Alon Zakai | 2017-08-07 | 6 | -52/+154 | |
| | | | | | | | | * improve inlining pass to inline single-use functions that are fairly small, which makes it useful for removing unnecessary global constructors from clang. add an inlining-optimizing pass that also optimizes where it inlined, as new opportunities arise. enable that it by default in O2+ * fix a bug where we didn't run all passes properly - refactor addDefaultGlobalOptimizationPasses() into a pre and post version. we can only run the post version in incremental optimizing builds (functions appear one by one, we optimize them first, and do global stuff when all are done), but can run both when doing a full optimize * copy in inlining, allowing multiple inlinings of the same function in the future | |||||
* | Merge pull request #1123 from WebAssembly/fuzz-2 | Alon Zakai | 2017-08-07 | 5 | -35/+86 | |
|\ | | | | | Yet more fuzz fixes | |||||
| * | properly handle merging of blocks with concrete unreachable elements in the ↵ | Alon Zakai | 2017-08-06 | 1 | -6/+10 | |
| | | | | | | | | middle | |||||
| * | handle merging blocks with items after an unreachable, that if merged would ↵ | Alon Zakai | 2017-08-06 | 1 | -9/+6 | |
| | | | | | | | | be invalid. stop on the unreachable, it is easier and better | |||||
| * | fix merge-blocks bug with replacing an unreachable block with a concrete ↵ | Alon Zakai | 2017-08-05 | 1 | -4/+5 | |
| | | | | | | | | final element (which is never reached) | |||||
| * | don't turn untaken br_ifs into ifs in remove-unused-brs | Alon Zakai | 2017-08-05 | 1 | -1/+3 | |
| | | ||||||
| * | fix merge-blocks logic: ensure that optimize() does not change the outside type | Alon Zakai (kripken) | 2017-08-05 | 1 | -36/+67 | |
| | | ||||||
| * | merge blocks in remove-unused-names only when their type is identical, so ↵ | Alon Zakai (kripken) | 2017-08-05 | 1 | -1/+1 | |
| | | | | | | | | branches to them are interchangeable | |||||
| * | emit an unreachable if an unreachable block context does not end in an ↵ | Alon Zakai | 2017-08-05 | 1 | -0/+5 | |
| | | | | | | | | unreachable | |||||
| * | fix reading of stacky unreadable code with elements we need to drop | Alon Zakai (kripken) | 2017-08-05 | 2 | -16/+17 | |
| | | ||||||
| * | don't move code around a drop-block when the block contains unreachables, ↵ | Alon Zakai | 2017-08-05 | 1 | -22/+32 | |
| | | | | | | | | which can cause type changes in the outside. dce should be run on that anyhow | |||||
* | | wasm2asm i32 arithmetic support (#1120) | Thomas Lively | 2017-08-07 | 6 | -35/+243 | |
|/ | | | * Rotations, popcnt, ctz, etc | |||||
* | Get wasm2asm building again (#1107) | Thomas Lively | 2017-08-02 | 8 | -109/+916 | |
| | | | | | | | | | | | | | | | | | | * Get wasm2asm building again Updates CMakeLists.txt to have wasm2asm built by default, updates wasm2asm.h to account for recent interface changes, and restores JSPrinter functionality. * Implement splice for array values * Clean up wasm2asm testing * Print semicolons after statements in blocks * Cleanups and semicolons for condition arms * Prettify semicolon emission | |||||
* | fix off-by-one error in clz/ctz/popcount used bits computation | Alon Zakai | 2017-08-01 | 1 | -2/+2 | |
| | ||||||
* | fix proper wasm emitting of untaken br_tables | Alon Zakai | 2017-08-01 | 1 | -1/+9 | |
| | ||||||
* | use effective shifts in more places in optimize-instructions | Alon Zakai (kripken) | 2017-08-01 | 3 | -7/+8 | |
| | ||||||
* | Merge remote-tracking branch 'origin/master' into fuzz | Alon Zakai (kripken) | 2017-07-31 | 1 | -1/+33 | |
|\ | ||||||
| * | Polymophic stack support (#1117) | Alon Zakai | 2017-07-31 | 1 | -1/+33 | |
| | | | | | | | | | | | | | | Emit valid wasm binaries even for corner cases of unreachable code. * emit an unreachable after a node that pushes a value that has unreachable type (where wasm type checking would have pushed a concrete type) * conversely, as a hack, emulate the wasm polymorphic stack mode by not emptying the stack when it has one element and that element is unreachable. this lets further pops work (all returning an unreachable element) | |||||
* | | review comments | Alon Zakai (kripken) | 2017-07-31 | 3 | -11/+11 | |
| | | ||||||
* | | handle squared shifts of an unreachable | Alon Zakai (kripken) | 2017-07-31 | 1 | -2/+2 | |
| | | ||||||
* | | don't remove values from breaks if the values have side effects | Alon Zakai (kripken) | 2017-07-30 | 1 | -11/+23 | |
| | | ||||||
* | | fix optimizing two shifts into one; if the number of effective shifts ↵ | Alon Zakai (kripken) | 2017-07-30 | 3 | -14/+41 | |
| | | | | | | | | overflows, it is not vali to just add them | |||||
* | | do not swap elements in conditionalizeExpensiveOnBitwise if they invalidate ↵ | Alon Zakai (kripken) | 2017-07-29 | 1 | -6/+9 | |
| | | | | | | | | each other - it is not enough to check side effects, we must check the interaction as well | |||||
* | | fix binary emitting of untaken branches, and also handle reading of ↵ | Alon Zakai (kripken) | 2017-07-29 | 1 | -3/+10 | |
| | | | | | | | | unreachable stacky code which may introduce concrete elements in non-final block positoins | |||||
* | | refactor effective shift size computation | Alon Zakai | 2017-07-29 | 2 | -3/+14 | |
| | | ||||||
* | | fix shl shift computation in getMaxBits | Alon Zakai | 2017-07-29 | 1 | -1/+1 | |
| | | ||||||
* | | fix shift computation in getMaxBits - in wasm only the lower 5 bits matter ↵ | Alon Zakai | 2017-07-29 | 1 | -2/+2 | |
| | | | | | | | | for a 32-bit shift | |||||
* | | do not combine a load/store offset with a constant pointer if it would wrap ↵ | Alon Zakai (kripken) | 2017-07-29 | 1 | -2/+9 | |
|/ | | | | a negative value to a positive one, as trapping is tricky | |||||
* | fix import type detection of calls in comma operators; when the parent is a ↵ | Alon Zakai | 2017-07-27 | 1 | -7/+11 | |
| | | | | comma, it can't be a coersion (or that would have been the parent), so there is no coercion, so the result type is none (#1115) | |||||
* | Merge pull request #1114 from WebAssembly/fuzz | Alon Zakai | 2017-07-27 | 2 | -2/+4 | |
|\ | | | | | Fuzz fixes | |||||
| * | when finalizing a block in MergeBlocks, use its type, so that we don't need ↵ | Alon Zakai | 2017-07-24 | 1 | -1/+1 | |
| | | | | | | | | to consider type changes for its parent (changing it from a forced i32 to an unreachable might mean the parent needs to become unreachable too) | |||||
| * | ignore untaken branches in determining block type | Alon Zakai | 2017-07-22 | 1 | -1/+3 | |
| | | ||||||
* | | fix asm2wasm wasm-only i64 switches with a large (>32 bit) offset #1109 (#1111) | Alon Zakai | 2017-07-26 | 1 | -1/+31 | |
|/ | ||||||
* | Optimizer support for atomic instructions (#1094) | Derek Schuff | 2017-07-21 | 9 | -75/+155 | |
| | | | | | | * Teach EffectAnalyzer not to reorder atomics wrt other memory operations. * Teach EffectAnalyzer not to reorder host operations with memory operations * Teach various passes about the operands of AtomicRMW and AtomicCmpxchg * Factor out some functions in DeadCodeElimination and MergeBlocks | |||||
* | fix f32 frem in asm2wasm #1105 (#1106) | Alon Zakai | 2017-07-20 | 1 | -33/+20 | |
| | ||||||
* | improve WasmValidator::validateMemBytes, check for unreasonable sizes even ↵ | Alon Zakai | 2017-07-19 | 1 | -6/+6 | |
| | | | | type is unreachable (#1102) | |||||
* | Merge pull request #1100 from WebAssembly/fuzz-4 | Alon Zakai | 2017-07-18 | 4 | -25/+38 | |
|\ | | | | | Yet more fuzz fixes | |||||
| * | fix off-by-one in assertion in optimize-instructions | Alon Zakai | 2017-07-17 | 1 | -1/+1 | |
| | | ||||||
| * | fix vacuum bug on nop'ing an if whose body has brs that cause type changes ↵ | Alon Zakai | 2017-07-17 | 1 | -0/+1 | |
| | | | | | | | | when removed | |||||
| * | add missing finalizations in removeUnusedBrs, when we change an if side and ↵ | Alon Zakai | 2017-07-17 | 1 | -0/+6 | |
| | | | | | | | | its outer block, we need to finalize the if first and then the block containing it | |||||
| * | fix blockifyMerge logic - it needs to not skip code in the block we merge ↵ | Alon Zakai | 2017-07-17 | 2 | -24/+30 | |
| | | | | | | | | to. since that's a fairly specific functionality needed in removeUnusedBrs, move it to there | |||||
* | | Fix wasm::read_file() to read correctly sized input strings in text mode. ↵ | juj | 2017-07-18 | 1 | -0/+6 | |
| | | | | | | | | (#1088) | |||||
* | | Merge pull request #1095 from WebAssembly/fuzz-3 | Alon Zakai | 2017-07-18 | 9 | -23/+87 | |
|\| | | | | | More fuzz fixes | |||||
| * | fix merge-blocks logic in call, call_indirect, select, we need to avoid any ↵ | Alon Zakai (kripken) | 2017-07-14 | 2 | -7/+21 | |
| | | | | | | | | danger of moving something past a side effect ; also fix an asm2wasm bug with call_indirect fixups; the call target may be a block, which we need to look through | |||||
| * | handle an unreachable block with a reachable final element in merge-blocks | Alon Zakai (kripken) | 2017-07-14 | 1 | -0/+9 | |
| | |