| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
The current patch:
* Preserves the debug locations from function prolog and epilog
* Preserves the debug locations of the nested blocks
|
|
|
| |
From #1665 (a fuzz bug noticed they were not handled in stack.h).
|
|
|
|
|
| |
We need to check not to read past the length of the string.
From #1665
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
| |
These instances may simply be caught by reference instead.
|
|
|
|
| |
* rename WasmType to Type. it's in the wasm:: namespace anyhow, and without Wasm- it fits in better alongside Index, Address, Expression, Module, etc.
|
|
|
|
| |
Function type gets its own element rather than being a part of the call_indirect
(see WebAssembly/spec#599)
|
|
|
| |
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).
|
|
|
|
| |
Following WebAssembly/threads#58
e.g. (memory $0 23 256 shared) is now (memory $0 (shared 23 256))
|
| |
|
|
|
| |
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).
|
|
|
| |
According to spec at https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md#wait-and-wake-operators
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
| |
to make this practical
|
| |
|
|
|
|
|
| |
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 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.
|
|
|
|
|
| |
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 both syntax formats in input since the old spec
tests still need to be parsable.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
(#1017)
* Extends wasm-as, wasm-dis and s2wasm to consume debug locations.
* Exports source map from asm2wasm
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
| |
else (#915)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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)
|
|
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.
|