| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
the transformation, as the outside might care about that
|
|
|
|
| |
contents. make s2wasm avoid outputting that as well (#992)
|
|
|
|
|
|
|
|
|
|
| |
* improve dce to handle more cases of nested unreachable code, in particular, when the child is unreachable in type but not an actual Unreachable node, e.g. if it's a br. in that case, we just need to verify that the br is not to us where we are a block or loop
* handle unreachable switch conditions in dce
* handle dce of br condition which is unreachable, and host arguments
* handle dce of block i32 etc. which is actually unreachable
|
|
|
|
|
|
|
|
|
|
|
|
| |
* properly validate block endings
* blocks with a value must not have a last element that is none
* fully validate input types to binary expressions
* validate i32.eqz/i64.eqz more carefully
* if condition must be i32
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Always use scripts.test.shared for bin paths.
Update scripts/test/shared.py to add WASM_MERGE relative to build
directory. Update auto_update_tests.py to use scripts.test.shared
variables for all bin paths. Update check.py to use
scripts.test.shared for wasm-merge path (this was missing).
This allows check.py and auto_update_tests.py to be run from the
source directory using built binaries in a different location.
* --no-legalize-javascript-ffi disables JS FFI mangling.
For JS/Web platform, calls to JS imports are wrapped to convert i64 to
i32 and f32 to f64. Likewise calls from JS into exports do the inverse
wrapping. This change provides an option to disable that wrapping and
use the original types for the call.
Includes tests test/noffi_f32.asm.js and test/noffi_i64.asm.js to make
sure neither f32->f64 nor i64->i32 type mangling is happening when
--no-legalize-javascript-ffi is specified.
To fully disable JS FFI mangling when using emscripten, the fastcomp
FFI mangling must also be disabled using the
-emscripten-legalize-javascript-ffi=0 flag.
|
|
|
|
| |
wasm added if types, which mean the if can be i32 even if the arms are unreachable etc (#991)
|
|
|
|
|
|
|
|
| |
* Add pass to instrument loads / stores
* Simplify instrumentation.
* Document.
|
|
|
|
|
| |
Add wasm-ctor-eval, which evaluates functions at compile time - typically static constructor functions - and applies their effects into memory, saving work at startup. If we encounter something we can't evaluate at compile time in our interpreter, stop there.
This is similar to ctor_evaller.py in emscripten (which was for asm.js).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* add debugInfo option to passes, and use it to keep debug info alive through optimizations when we need it
* add fib testcase for debug info
* when preserving debug info, do not move code around call-imports, so debug info intrinsics remain stationary
* improve wasm-module-building handling of the single-threaded case: don't create workers, which is more efficient and also nicer for debugging
* process debug info in a more precise way, reordering it from being after the node (as it was a comment in JS) to before the node
* remove unreachable hack for debug info, which is no longer needed since we reorder them, and make sure to finalize blocks in which we reorder
|
| |
|
| |
|
|
|
|
|
|
| |
* support -g in wasm-opt, which makes it easier to upgrade binaries for bustage
* upgrade binaries in test/merge to new names section format
|
|
|
|
| |
wasm-merge tool: combines two wasm files into a larger one, handling collisions, and aware of the dynamic linking conventions. it does not do full static linking, but may eventually.
|
|
|
| |
Rather than storing debug info as text annotations, store explicit file and line information. This will make it easier to experiment with outputting other serializations or representations (e.g. source maps), and will allow outputting debug info for binaries as well.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
See https://github.com/WebAssembly/binaryen/issues/914.
* extensible name section support: read function names, too
* c-api-unused-mem.txt: change expected size to match new name section
* * check subsection size matches
* print warning for unknown name subsections (including the local
section)
|
|
|
|
|
|
| |
This option allows to import the linear memory from JS code instead of exporting it.
--emscripten-glue does this too but often the emscripten glue isn't needed, so this option only affects the memory.
All the code necessary for importing the memory basically already exists, so nothing except for the command line option itself had to be added.
|
| |
|
|
|
|
| |
1. Add a missing <functional> include
2. Put the // fallthrough comment after the closing bracket so the compiler does not emit a implicit fallthrough warning.
|
|
|
| |
New binaryen.js implementation, based on the C API underneath and with a JS-friendly API on top. See docs under docs/ for API details.
|
|
|
|
| |
* fix eq/ne of sign-ext with a constant, when the constant can never be equal to it as it has the effective sign bit but not the upper bits above it set, which the sign-ext would emit
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
| |
* optimize pow(x,2) => x*x
* optimize pow(x, 0.5) => sqrt(x)
|
|
|
|
|
|
| |
* fix a bug where compared sign-exts of different sizes were turned into zero-exts
* fix a bug where we consider an almost sign-ext as ok to change the sign of a load inside it, ignoring that the load has the extra shifting
|
|
|
|
| |
unruly (#928)
|
|
|
| |
Simple local common subexpression elimination. Useful mostly to reduce code size (as VMs do GVN etc.). Enabled by default in -Oz.
|
|
|
| |
* use 3 modes for potentially trapping ops in asm2wasm: allow (just emit a potentially trapping op), js (do exactly what js does, even if it takes a slow ffi to do it), and clamp (avoid the trap by clamping as necessary)
|
|
|
|
| |
out the spec (#932)
|
|
|
|
| |
if would be invalid (#927)
|
|
|
|
| |
* asm2wasm should not promote an overloaded import result to f64 if it is a single type and void
|
| |
|
|
|
|
|
| |
* fix BINARYEN_PASS_DEBUG option
* Add isNested property to passRunner
|
|
|
|
|
|
| |
* Refactor AsmConstWalker to use smaller subfunctions
* Replace cashew::IStrings with Names
|
|
|
|
| |
Most module walkers use PostWalker<T, Visitor<T>>, let that pattern be
expressed as simply PostWalker<T>
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fully handle EM_ASM in s2wasm
* Iterate with size_ts, remember to erase from importsMap as well
* Fix dot_s test EM_ASM signatures
* Move Name out to its own file, support/name.h
* Move removeImportsWithSubstring out of Module class
|
|
|
|
| |
* fix asm2wasm import type setting - set the type of used calls based on the context, early, so it's valid in the optimizer
|
| |
|
| |
|
|
|
|
| |
else (#915)
|
| |
|
| |
|
| |
|
|
|
|
| |
PickLoadSigns pass
|
| |
|
|
|
|
| |
zero-extend
|
| |
|