summaryrefslogtreecommitdiff
path: root/src/wasm/wasm-s-parser.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Bulk memory operations (#1892)Thomas Lively2019-02-051-0/+35
| | | | | | Bulk memory operations The only parts missing are the interpreter implementation and spec tests.
* More misc ASAN fixes (#1882)Alon Zakai2019-01-221-0/+3
| | | | | | | | | | * fix buffer overflow in simple_ast.h printing. * check wasm binary format reading of function export indexes for errors. * check if s-expr format imports have a non-empty module and base. Fixes #1876 Fixes #1877 Fixes #1879
* Misc minor ASAN fixes (#1869)Alon Zakai2019-01-161-4/+3
| | | | | | | | | | * handle end of input in skipWhitespace in s-parser. fixes #1863 * ignore debug locations when not in a function ; fixes #1867 * error properly on invalid user section sizes ; fixes #1866 * throw a proper error on invalid call offsets in binary reading ; fixes #1865
* Code style improvements (#1868)Alon Zakai2019-01-151-2/+2
| | | | * Use modern T p = v; notation to initialize class fields * Use modern X() = default; notation for empty class constructors
* Require unique_ptr to Module::addFunctionType() (#1672)Paweł Bylica2019-01-101-2/+2
| | | | | This fixes the memory leak in WasmBinaryBuilder::readSignatures() caused probably the exception thrown there before the FunctionType object is safe. This also makes it clear that the Module becomes the owner of the FunctionType objects.
* Massive renaming (#1855)Thomas Lively2019-01-071-5/+5
| | | | | | Automated renaming according to https://github.com/WebAssembly/spec/issues/884#issuecomment-426433329.
* Rename `idx` to `index` in SIMD code for consistency (#1836)Thomas Lively2018-12-181-4/+4
|
* SIMD (#1820)Thomas Lively2018-12-131-2/+125
| | | | | | | | | Implement and test the following functionality for SIMD. - Parsing and printing - Assembling and disassembling - Interpretation - C API - JS API
* Fuzzing: log values during execution (#1779)Alon Zakai2018-11-301-1/+1
| | | | | | | | Before we just looked at function return values when looking for differences before and after running some passes, while fuzzing. This adds logging of values during execution, which can represent control flow, monitor locals, etc., giving a lot more opportunities for the fuzzer to find problems. Also: * Clean up the sigToFunctionType function, which allocated a struct and returned it. This makes it safer by returning the struct by value, which is also easier to use in this PR. * Fix printing of imported function calls without a function type - turns out we always generate function types in loading, so we didn't notice this was broken, but this new fuzzer feature hit it.
* Add support for a mutable globals as a Feature (#1785)Sam Clegg2018-11-301-2/+4
| | | | | This picks up from #1644 and indeed borrows the test case from there.
* Generate sexp instruction parser (#1754)Thomas Lively2018-11-191-290/+12
| | | Also fix broken tests surfaced by the new parser.
* Fix alignment in MixedAllocator (#1740)Alon Zakai2018-11-131-1/+1
| | | Necessary for simd, as we add a type with alignment >8. We were just broken on that before this PR.
* add support for new call_indirect syntax ; fixes #1724 (#1725)Alon Zakai2018-11-051-8/+29
|
* Support 4GB Memories (#1702)Alon Zakai2018-10-151-2/+5
| | | This fixes asm2wasm parsing of the max to allow 4GB, and also changes the internal Memory::kMaxValue values to reflect that. We used to use kMaxValue to also represent "no limit", so I split that out into kUnlimitedValue.
* Unify imported and non-imported things (#1678)Alon Zakai2018-09-191-95/+71
| | | | | | | | | | | | | | Fixes #1649 This moves us to a single object for functions, which can be imported or nor, and likewise for globals (as a result, GetGlobals do not need to check if the global is imported or not, etc.). All imported things now inherit from Importable, which has the module and base of the import, and if they are set then it is an import. For convenient iteration, there are a few helpers like ModuleUtils::iterDefinedGlobals(wasm, [&](Global* global) { .. use global .. }); as often iteration only cares about imported or defined (non-imported) things.
* Add debug information locations to the function prolog/epilog (#1674)Yury Delendik2018-09-171-13/+27
| | | | | | | The current patch: * Preserves the debug locations from function prolog and epilog * Preserves the debug locations of the nested blocks
* remove PageSize and HasFeature, which wasm removed a while back (#1667)Alon Zakai2018-09-121-7/+1
| | | From #1665 (a fuzz bug noticed they were not handled in stack.h).
* Fix parsing of memory attributes in s-expression parser (#1666)Alon Zakai2018-09-111-13/+21
| | | | | We need to check not to read past the length of the string. From #1665
* 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