| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
|
|
|
|
|
|
|
|
| |
(#1017)
* Extends wasm-as, wasm-dis and s2wasm to consume debug locations.
* Exports source map from asm2wasm
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
| |
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).
|
|
|
|
| |
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.
|
|
|
| |
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.
|
|
|
| |
* 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)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* an unreachable block is one with an unreachable child, plus no breaks
* document new difference between binaryen IR and wasm
* fix relooper missing finalize
* add a bunch of tests
* don't assume that test/*.wast files print to themselves exactly; print to from.wast. this allows wast tests with comments in them
* emit unreachable blocks as (block .. unreachable) unreachable
* if without else and unreachable ifTrue is still not unreachable, it should be none
* update wasm.js
* cleanups
* empty blocks have none type
|
|
|
|
|
|
|
|
|
|
|
|
| |
* parse file/line comments in asm.js into debug intrinsics
* convert debug intrinsics into annotations, and print them
* ignore --debuginfo if not emitting text, as wasm binaries don't support that yet
* emit full debug info when -g and emitting text; when -g and emitting binary, all we can do is the Names section
* update wasm.js
|
|
|
|
|
|
|
|
| |
* add --ignore-implicit-traps option, and by default do not ignore them, to properly preserve semantics
* implicit traps can be reordered, but are side effects and should not be removed
* add testing for --ignore-implicit-traps
|
|
|
|
|
| |
* Added ModuleReader/Writer classes that support text and binary I/O
* Use them in wasm-opt and asm2wasm
|
|
|
|
| |
* handle stacky code in binaries, using a block+local
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Refactor check.py so that groups of tests can be split into separate files
- Move helper util functions into test/shared.py
- Move scripts/support.py to test/support.py
- Split s2wasm tests into its own file
* Fix flake8 warnings for shared.py and s2wasm.py
* Move test scripts from test/ to scripts/test/
* Replace 'from shared import *' with explicit imports
|
|
|
|
| |
depending on an import
|
| |
|
|
|
|
| |
And use them in wasm-opt and asm2wasm consistently and uniformly.
|
|
|
|
|
|
| |
* wasm-only loads and stores
* wasm-only 32-bit bitcasts
|
|
|
|
|
|
|
|
|
|
|
|
| |
* support i64 intrinsics from fastcomp, adding --wasm-only flag
* refactor callImport logic in asm2wasm to avoid recomputing wasm types again
* legalize illegal i64 params in exports and imports
* do safe i64 binary ops depending on precision
* fix addVar, only assert on names if we are using a name
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Several updates for s2wasm and its tests:
Add explicit drops where they are emitted by LLVM already
Convert loops (which are still modeled in the old way by LLVM) to wrap them in an explicit block (for the exit label). This also allows simplifying the loop creation (no need to post-process the implicit block which is the loop's body). After the engines update to 0xc we should update LLVM to model loops in the 0xc way, but for now it remains compatible with 0xb and 0xc.
Fix the order of the calls to setTee() when creating tee_locals
Add an explicit drop when creating the _start entry function wrapper if needed
Update dot_s and llvm_autogenerated tests to remove store-results optimization (and few other minor updates)
Fix the test auto-updater to fail if subprocesses fail
There still seems to be a validation failure when building libc (I think it's from the stricter drop rules, but it may be in the source rather than the compiler), but this at least makes Binaryen's tests pa
|
|
|
|
|
|
|
|
| |
apply memory segments only if there isn't a memory initializer (which we need for asmjs and asm2wasm modes)
use wasm-opt to check recreated wasts for validity, as wasm-shell would try to execute them
add testing for combined modes like asmjs,interpret-binary
|
| |
|
| |
|
| |
|
|
|
|
| |
tests
|
| |
|
|
|
|
| |
api calls
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* Factor passes and emscripten-optimizer into static libs
This removes the redundancies from the source sets in the main
CMakeLists.txt.
* Make passes an object lib
* Use static libs with --whole-archive because Travis has old cmake
|
|
|
|
|
|
|
|
| |
Use the -rpath linker flag to locate libbinaryen-c.so instead of
injecting paths into the user's LD_LIBRARY_PATH
Also Link libsupport and libasmjs into libbinaryen-c
Fixes #444
|
| |
|
|
|
| |
It needs to be concatenated, not overwritten.
|
|
|
|
| |
library, make it dynamic
|
|
|
|
|
|
| |
* harmonize the internal opcodes with the binary format, so they clearly parallel, and also this helps us avoid needing the type to disambiguate
* comment on GetLocal in C API
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* Generate emscripten dynCall thunks in s2wasm
Part of the usual emscripten glue for asm.js is thunks for calling
functions on the module given a function pointer; aka a dynCall. This is
implemented via thunks generated on the Module called
'dynCall_<signature>'. This gives support to s2wasm to generate these
thunks in the wasm module along with other emscripten glue. It also
introduces a flag to s2wasm to make generation of emscripten glue
optional.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Properly align the stack pointer
By default (if no global base is given) the global base is 1, which
seems wrong. In this case the stack pointer gets an address of 1, which
is unaligned and definitely wrong. So, start the global base at 0 instead of
1 by default and align the stack pointer. Also factor allocation of
statics into a function.
* unconditionally allocate stack pointer; explicitly reserve address 0
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
spec changes, and remove some unnecessarily big wasts
|
| |
|
| |
|