| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
That is the correct order in the text format, wabt errors otherwise.
See AssemblyScript/assemblyscript#310
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
(#1681)
|
|
|
| |
We can remove the memory/table (itself, or an import if imported) if they are not used. This is pretty minor on a large wasm file, but when reading small wasts it's very noticeable to have an unused memory and table all the time.
|
|
|
|
| |
Function type gets its own element rather than being a part of the call_indirect
(see WebAssembly/spec#599)
|
| |
|
|
|
|
| |
consistently handled regardless of whether we optimize in parallel or not (#1208)
|
|
|
|
|
|
|
| |
Implements #1172: this adds a variant of precompute, "precompute-propagate", which also does constant propagation. Precompute by itself just runs the interpreter on each expression and sees if it is in fact a constant; precompute-propagate also looks at the graph of connections between get and set locals, and propagates those constant values.
This helps with cases as noticed in #1168 - while in most cases LLVM will do this already, it's important when inlining, e.g. inlining of the clamping math functions. This new pass is run when inlining, and otherwise only in -O3/-Oz, as it does increase compilation time noticeably if run on everything (and for almost no benefit if LLVM has run).
Most of the code here is just refactoring out from the ssa pass the get/set graph computation, so it can now be used by both the ssa pass and precompute-propagate.
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
| |
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)
|
| |
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Support both syntax formats in input since the old spec
tests still need to be parsable.
|
| |
|
|
|
|
| |
happen, and autoDrop wasn't handling it (#1005)
|
| |
|
| |
|
|
|
|
| |
unruly (#928)
|
|
|
|
| |
out the spec (#932)
|
| |
|
| |
|
|
|
|
| |
their element/segment offsets
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
RelooperJumpThreading
|
|
|
|
|
|
|
|
| |
* fix fround of unsigned
* add testing for f32 ops, and remove a duplicate test (now that f32 is on by default in wasm, we don't need to check with and without PRECISE_F32)
* update wasm.js and binaryen.js
|
| |
|
|
|
|
|
|
| |
* asm.js corrections to unit.asm.js test
* optimize out bool&1
|
| |
|
|
|
|
|
|
|
|
| |
In wast files, the spec and WABT require imports to appear before any
non-import definitions (see also
https://github.com/WebAssembly/wabt/issues/152). This patch re-orders
visitModule in the wast printer to meet this requirement, and more or
less match the order of the binary sections. Also remove extraneous
whitespace around table definitions.
|
| |
|
|
|
|
| |
isn't a default (#734)
|
|
|
|
|
| |
Otherwise when we export it as "$0" it's an undefined name.
The spec interpreter actually rejects this, although I think it's
intended to work, given the tests in export.wast. wabt also accepts it.
|
|
|
|
|
|
| |
* type check using block/loop/if types provided in text and binary formats.
* print if and loop sigs which were missing.
* remove dsl from OptimizeInstructions as after those changes it needs rethinking.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|