| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
| |
That pass is very slow on unoptimized code (super-linear on the number of locals, which if unoptimized can be massive due to flatten).
|
|
|
| |
Applies the changes in #2065, and temprarily disables the hook since it's too slow to run on a change this large. We should re-enable it in a later commit.
|
|
|
| |
In particular, coalesce-locals is useful even if closure is run later (apparently it finds stuff closure can't).
|
|
|
|
| |
EmscriptenGlueGenerator::separateDataSegments (#2068)
|
|
|
|
|
| |
We flatten for the i64 lowering etc. passes, and it is worth optimizing afterwards, to clean up stuff they created. That is run if the user ran wasm2js with an optimization level (like wasm2js -O3).
Split the test files to check both optimized and unoptimized code.
|
| |
|
|
|
| |
If an i64 load/store that is being broken up has higher alignment, use that.
|
|
|
|
|
|
|
|
|
|
| |
Don't emit unneeded breaks in switch cases, instead do
case X:
case Y:
..
case W: break ..
for each group. Also, the group with the default doesn't need any cases but the default itself.
|
|
|
|
|
|
|
| |
SimplifyLocals (#2064)
Details in lengthy comment in the source.
Fixes #2063
|
|
|
| |
Mass change to apply clang-format to everything. We are applying this in a PR by me so the (git) blame is all mine ;) but @aheejin did all the work to get clang-format set up and all the manual work to tidy up some things to make the output nicer in #2048
|
|
|
|
|
|
|
| |
This adds a commit hook to Travis CI that errors out if incoming PRs'
diffs are not clang-formatted. Turns out clang-format is also capable of
formatting JavaScript, but we haven't agreed on a style for JS yet, this
PR disables JavaScript formatting for now. This also adds clang-format
exempt header/footer to a generated source file.
|
| |
|
|
|
| |
Don't use temp vars to reorder them unless we need to.
|
|
|
| |
Mostly what we need for dynamic linking, at least on the binaryen side.
|
| |
|
|
|
|
|
| |
As well as i64 splitting this pass was also converting f32 to f64
at the wasm boundry. However it appears this is not actually useful
and makes somethings (such as dynamic linking) harder.
|
|
|
|
|
|
| |
* Emit ints as signed, so -1 isn't a big unsigned number.
* x - -c (where c is a constant) is larger than x + c in js (but not wasm)
* +(+x) => +x
* Avoid unnecessary coercions on calls, return, load, etc. - we just need coercions when entering or exiting "wasm" (not internally), and on actual operations that need them.
|
|
|
|
| |
BinaryenGlobalImportGetModule (#2047)
|
|
|
| |
Removes redundant | 0s and similar things. (Apparently closure compiler doesn't do that, so makes sense to do here.)
|
|
|
|
| |
(#2043)
|
|
|
|
| |
(#2042)
|
|
|
| |
Also fix the fuzzer's handling of feature flags so that wasm2js can work.
|
|
|
| |
Also run remove-unused-names which became more noticeably necessary after this change.
|
|
|
|
|
|
|
| |
Implement interpretation of remaining bulk memory ops, add bulk memory
spec tests with light modifications, fix bugs preventing the fuzzer
from running correctly with bulk memory, and fix bugs found by the
fuzzer.
|
|
|
| |
We run flatten there, which lets us simplify things a lot. Turns out that for assertions we didn't run it, which is why we still needed the old non-flat code paths. This adds flatten there and removes that old code and assumptions.
|
|
|
| |
Also test in pass-debug mode, for better coverage.
|
|
|
|
|
|
|
|
|
| |
When replacing the first argument to an asm call, allow more complex
expressions for expressing the address.
This fixes the case where the first argument might be the result
of adding a constant to __memory_base.
|
|
|
| |
It is invalid to print --5, we need to add a space - -5 so that it is valid JS to parse.
|
|
|
|
|
| |
incorrectness (#2032)
The risk is that the children's type may be unreachable, in which case we may have forgotten the signing, and could get incorrect results.
|
|
|
|
|
|
|
| |
This replaces all uses of __tempMemory__, the old scratch space location, with calls to function imports for scratch memory access. This lets us then implement those in a way that does not use the same heap as main memory. This avoids possible bugs with scratch memory overwriting something, or just in general that it has observable side effects, which can confuse fuzzing etc.
The intrinsics are currently implemented in the glue. We could perhaps emit them inline instead (but that might limit asm.js optimizations, so I wanted to keep our options open for now - easy to change later).
Also fixes some places where we used 0 as the scratch space address.
|
|
|
|
|
|
| |
* Don't assume function types exist in legalize-js-interface.
* Properly handle (ignore) imports in RemoveNonJSOps - do not try to recurse into them.
* Run legalize-js-interface and remove-unused-module-elements in wasm2js, the first is necessary, the last is nice to have.
|
| |
|
|
|
|
|
|
| |
This reverts commit cb2d63586c08a3dd194d2b733ceb3f5051c081f8.
The issues with feature validation were mostly resolved in #1993, and
this PR finishes the job by adding feature flags to wasm-as to avoid
emitting the DataCount section when bulk-memory is not enabled.
|
|
|
|
|
|
|
|
|
|
| |
This corresponds to changes made to the initialization procedure in
the spec. It also removes all the heavy initialization work from the
external interface of the interpreter, which is a nice encapsulation
win.
Implementation of the interpretation of the remaining bulk memory
operations and more rigorous tests of that interpretation will come in
a follow-up PR.
|
|
|
|
|
| |
cases are tricky (#2026)
leave them for later optimizers/minifiers
|
|
|
| |
Also emit the memory growth code based on memory growth, and not whether we are "use asm" or not.
|
|
|
| |
Split them into two i32 globals.
|
|
|
| |
Should prevent surprises in the future.
|
|
|
| |
Fixes #1984
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before, we'd print
if (..) label: { .. }; else ..
But that is wrong, as it ends the if too early. After this, we print
if (..) label: { .. } else ..
The bug was we checked if the if body was a block, but not if it was a labelled block.
|
|
|
| |
We do not actually analyze scopes properly there, see comment in the commit. For now, just demote it to a warning. Not sure if it's worth fixing it or just removing it.
|
|
|
| |
We forgot to set them as unsigned, which meant that we were reading uninitialized memory when checking that field, which mostly worked, except if it previously contained something...
|
|
|
|
|
| |
In the absence of the target features section or command line flags. When there are command line flags, it is an error if they do not exactly match the target features section, except if --detect-features has been provided.
Also adds a --print-features pass to print the command line flags for all enabled options and uses it to make the feature tests more rigorous.
|
|
|
|
|
| |
* Make the memory instrumentation pass log both pointers and values.
* Use "env" as the import module - simpler to support and get working.
|
|
|
|
|
| |
* Emit an import statement for the memory.
* Update the imported memory's buffer when we grow.
|
|
|
|
|
|
|
|
| |
Previously we were searching for the function by name but this
doesn't work when the internal name for the function is different.
In order to repro such a case the shared.c test was converted to C++
since then binaryen's internal name is different since it comes from
the de-mangled name section.
|
|
|
| |
Fixes #2007 #2008
|
|
|
|
|
| |
Its presence was causing validation errors in the Emscripten test
suite. This should be reverted once the default feature set is no
longer All.
|