summaryrefslogtreecommitdiff
path: root/src/wasm/wasm-s-parser.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Some simple integer math opts (#1504)Alon Zakai2018-04-111-1/+1
| | | | | | | | | Stuff like x + 5 != 2 => x != -3. Also some cleanups of utility functions I noticed while writing this, isTypeFloat => isFloatType. Inspired by https://github.com/golang/go/blob/master/src/cmd/compile/internal/ssa/gen/generic.rules
* check for errors when parsing s-expression load/store immediates (#1475)Alon Zakai2018-03-161-2/+6
|
* Fix -Wcatch-value from GCC 8 (#1400)Josh Stone2018-02-051-2/+2
| | | These instances may simply be caught by reference instead.
* Rename WasmType => Type (#1398)Alon Zakai2018-02-021-43/+43
| | | | * rename WasmType to Type. it's in the wasm:: namespace anyhow, and without Wasm- it fits in better alongside Index, Address, Expression, Module, etc.
* Update call_indirect text syntax to match spec update (#1281)Derek Schuff2017-11-131-1/+3
| | | | Function type gets its own element rather than being a part of the call_indirect (see WebAssembly/spec#599)
* notation change: AST => IR (#1245)Alon Zakai2017-10-241-1/+1
| | | 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).
* Update text syntax for shared memory limits (#1197)Derek Schuff2017-09-221-13/+16
| | | | 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-201-0/+1
|
* Add support for sign-extension operators from threading proposal (#1167)Derek Schuff2017-09-061-1/+8
| | | 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).
* Add support for atomic wait and wake operators (#1140)Derek Schuff2017-08-241-0/+24
| | | According to spec at https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md#wait-and-wake-operators
* wasm2asm test generation (#1124)Thomas Lively2017-08-161-1/+1
| | | | | | | | | | | | | | | | | * 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
* add the option to seek named breaks, not just taken breaks; refactor headers ↵Alon Zakai (kripken)2017-07-111-2/+2
| | | | to make this practical
* Add IR, parsing, printing, and binary for atomic cmpxchg (#1083)Derek Schuff2017-07-101-5/+25
|
* Add IR, parsing and binary support for AtomicRMW instructions from wasm ↵Derek Schuff2017-07-061-60/+69
| | | | | threads proposal (#1082) Also leave a stub (but valid) visitAtomicRMW in the visitor template so that not all visitors need to implement this function yet.
* Add atomic loads and stores (#1077)Derek Schuff2017-06-281-5/+13
| | | | | Add IR, wast and binary support for atomic loads and stores. Currently all IR generated by means other than parsing wast and binary files always generates non-atomic accesses, and optimizations have not yet been made aware of atomics, so they are certainly not ready to be used yet.
* Add shared memories (#1069)Derek Schuff2017-06-271-14/+22
| | | | | Begin to implement wasm threading proposal in https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md This PR just has shared memory attribute with wast and binary support.
* Support new result syntax for if/loop/block (#1047)Sam Clegg2017-06-121-18/+28
| | | | | | Support both syntax formats in input since the old spec tests still need to be parsable.
* 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-011-33/+17
|
* 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
|
* host op parsing error handlingAlon Zakai (kripken)2017-06-011-0/+9
|
* handle duplicate functions in s-expr parsingAlon Zakai (kripken)2017-06-011-0/+1
|
* 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 s-expr parsingAlon Zakai (kripken)2017-06-011-25/+29
|
* Exporting/importing debug location information from .wast/.asm.js/.s formats ↵Yury Delendik2017-06-011-5/+55
| | | | | | | | (#1017) * Extends wasm-as, wasm-dis and s2wasm to consume debug locations. * Exports source map from asm2wasm
* Validate finalization (#1014)Alon Zakai2017-05-181-0/+2
| | | | | | | * 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.
* Unreachable typing fixes (#1004)Alon Zakai2017-05-091-0/+7
| | | | | | | | | | | | * fix type of drop, set_local, set_global, load, etc: when operand is unreachable, so is the node itself * support binary tests properly in test/passes * fix unreachable typing of blocks with no name and an unreachable child * fix continue emitting in asm2wasm * properly handle emitting of unreachable load
* text format parsing fixes (#1002)Alon Zakai2017-05-081-4/+5
|
* Parsing fixes (#990)Alon Zakai2017-05-021-2/+4
| | | | | | | | | | * properly catch a bunch of possible parse errors, found by afl-fuzz * clean up wasm-interpreter, use WASM_UNREACHABLE instead of abort * detect duplicate names in function names section * detect duplicate export names
* Wasm h to cpp (#926)jgravelle-google2017-03-101-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | * Move WasmType function implementations to wasm.cpp * Move Literal methods to wasm.cpp * Reorder wasm.cpp shared constants back to top * Move expression functions to wasm.cpp * Finish moving things to wasm.cpp * Split out Literal into its own .h/.cpp. Also factor out common wasm-type module * Remove unneeded/transitive includes from wasm.h * Add comment to try/check methods * Rename tryX/checkX methods to getXOrNull * Add missing include that should fix appveyor build breakage * More appveyor
* clean up raw pointer import->functionType, make it a Name like everything ↵Alon Zakai2017-02-171-4/+4
| | | | else (#915)
* fix table import size when no maximum is providedAlon Zakai2016-12-071-1/+1
|
* Binary 0xd changes (#803)Derek Schuff2016-10-261-3/+2
| | | | | | | | | | | | | | | | | | | | | * Renumber opcodes for 0xd * Unified type encoding * Add reserved flags fields to host instructions and call_indirect * Rename flags->reserved * Fix line numbers in wast parser Also don't throw if the memory is defined in the same Element as the export of memory (the validity is checked later anyway). * Skip spec binary.wast The spec testsuite is still on 0xc, so 0xd doesn't match. In order to update to 0xd we need to implement some additional functionality for the import test, namely (register)
* Move wasm.cpp and wasm-s-parser into a library (#796)Derek Schuff2016-10-201-0/+1776
Also moves the bulk of the code in wasm-s-parser into a cpp file. Allows namespace and #include cleanups, and improves j4 compile time by 20%. Should also make any future parser changes easier and more localized.