summaryrefslogtreecommitdiff
path: root/src/wasm/wasm-validator.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Add Features enum to IR (#1250)Derek Schuff2017-10-271-1/+10
| | | | | | | | | | | | 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-241-2/+2
| | | 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).
* Atomics support in interpreter + optimizer + fuzz fixes for that (#1227)Alon Zakai2017-10-201-3/+4
|
* Refactor validator API to use enums (#1209)Alon Zakai2017-10-031-5/+5
| | | | * refactor validator API to use enums
* Fast validation (#1204)Alon Zakai2017-10-021-192/+476
| | | | | | | 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.
* Update text syntax for shared memory limits (#1197)Derek Schuff2017-09-221-0/+1
| | | | Following WebAssembly/threads#58 e.g. (memory $0 23 256 shared) is now (memory $0 (shared 23 256))
* Expressions should not appear twice in the ast (#1191)Alon Zakai2017-09-181-0/+18
|
* Add support for sign-extension operators from threading proposal (#1167)Derek Schuff2017-09-061-2/+11
| | | These are not atomic operations, but are added with the atomic operations to keep from having to define atomic versions of all the sign-extending loads (an atomic zero-extending load + signext operation can be used instead).
* clean up untaken => unreachable, as well as unnecessary named stuff in ↵Alon Zakai2017-09-061-6/+1
| | | | validation that was from when we differentiated reachable from unreachable breaks (#1166)
* Return to more structured type rules for block and if (#1148)Alon Zakai2017-09-051-9/+11
| | | | | | | | * if a block has a concrete final element (or a break with a value), then even if it has an unreachable child, keep it with that concrete type. this means we no longe allow the silly case of a block with an unreachable in the middle and a concrete as the final element while the block is unreachable - after this change, the block would have the type of the final element * if an if has a concrete element in one arm, make it have that type as a result, even if the if condition is unreachable, to parallel block * make type rules for brs and switches simpler, ignore whether they are reachable or not. whether they are dead code should not affect how they influence other types in our IR.
* wasm-reduce tool (#1139)Alon Zakai2017-09-011-7/+12
| | | Reduce an interesting wasm to a smaller still interesting wasm. This takes an arbitrary command to run, and reduces the wasm as much as it can while keeping the behavior of that command fixed. This can be used to reduce compiler bugs in an arbitrary VM, etc.
* Add support for atomic wait and wake operators (#1140)Derek Schuff2017-08-241-0/+14
| | | According to spec at https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md#wait-and-wake-operators
* improve WasmValidator::validateMemBytes, check for unreasonable sizes even ↵Alon Zakai2017-07-191-6/+6
| | | | type is unreachable (#1102)
* Merge pull request #1095 from WebAssembly/fuzz-3Alon Zakai2017-07-181-2/+5
|\ | | | | More fuzz fixes
| * fix validation of memBytes, if the load type is unreachable, we can't and ↵Alon Zakai (kripken)2017-07-131-2/+5
| | | | | | | | shouldn't try to validate
* | Validation for AtomicRMW and cmpxchg (#1092)Derek Schuff2017-07-141-1/+25
|/ | | | Also fix cases where fail() had the arguments backwards. Wasn't an error because lol templates. Also fix printModuleComponent template to SFINAE on Expression* so we properly get the specialized version.
* Merge pull request #1087 from WebAssembly/fuzz-2Alon Zakai2017-07-121-15/+19
|\ | | | | Fuzz fixes
| * refactor and improve break validation. breaks names are unique, so we don't ↵Alon Zakai (kripken)2017-07-111-15/+19
| | | | | | | | need a stack, and break targets must exist even if they are not actually taken
* | Refactor validation failure and printing, validate atomic memory (#1090)Derek Schuff2017-07-121-10/+42
| |
* | add docs and error hints when a Call should be a CallImport (#1081)Alon Zakai2017-07-111-1/+6
|/ | | | | | * add docs and error hints when a Call should be a CallImport * fix binaryen API docs in docs/
* Factor wasm validator into a cpp file (#1086)Derek Schuff2017-07-101-0/+639
Also small cleanup to CMake libraries