summaryrefslogtreecommitdiff
path: root/src/wasm-js.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Some simple integer math opts (#1504)Alon Zakai2018-04-111-5/+5
| | | | | | | | | 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
* Rename WasmType => Type (#1398)Alon Zakai2018-02-021-9/+9
| | | | * rename WasmType to Type. it's in the wasm:: namespace anyhow, and without Wasm- it fits in better alongside Index, Address, Expression, Module, etc.
* Added the ability to run specific optimization passes to binaryen-c/.js (#1252)Daniel Wirtz2017-10-301-1/+1
|
* fix interpreted code from wasm.js (#1043)Alon Zakai2017-06-121-2/+2
| | | | | | * fix interpreted code from wasm.js, when the result is none, we must return an empty Literal (the interpreter now asserts on this, it didn't before) * update js builds
* Update binaryen-c/binaryen.js, fixes #1028, fixes #1029 (#1030)Daniel Wirtz2017-06-071-2/+2
| | | This PR adds global variable support (addGlobal, getGlobal, setGlobal), host operations (currentMemory, growMemory), a few utility functions (removeImport, removeExport, getFunctionTypeBySignature with the latter being scheduled for removal once a better alternative is in place) and it introduces an additional argument to specify the result type in BinaryenBlock (effectively breaking the C-API but retaining previous behaviour by introducing the BinaryenUndefined() type for this purpose). Additionally, it enables compilation with exception support in build-js.sh as exceptions are thrown and caught when optimizing endless loops, intentionally resulting in an unreachable opcode. Affected test cases have been updated accordingly.
* --no-js-ffi opt to disable JS FFI mangling. (#984)Joel Martin2017-05-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* New binaryen.js (#922)Alon Zakai2017-03-241-2/+5
| | | 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.
* Wasm h to cpp (#926)jgravelle-google2017-03-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | * 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
* asm2wasm debuginfo (#895)Alon Zakai2017-02-071-1/+2
| | | | | | | | | | | | * 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
* handle imports in tables in interpreterAlon Zakai2016-12-071-3/+12
|
* update wasm-js.cpp code for asm2wasm constructor change (#793)Alon Zakai2016-10-201-1/+1
|
* Add support for i64.store[N] (#789)jgravelle-google2016-10-191-4/+4
| | | | | | | | | | | | * Add support for i64.store[N] Previously storing i64 in the interpreter assumed an 8byte store. Stores like i64.store8 would then use the special-case i64 storing code, when they could just use the i32.store8 code. * Add printf test for interpreter * Update wasm.js
* Refactor Import::Kind and Export::Kind into an ExternalKind enum class (#725)Alon Zakai2016-10-031-4/+4
|
* asm2wasm i64 support (#723)Alon Zakai2016-09-301-1/+1
| | | | | | | | | | | | * 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
* import tableAlon Zakai2016-09-071-16/+35
|
* import memory #684Alon Zakai2016-09-071-5/+24
|
* use globals in asm2wasmAlon Zakai2016-09-071-20/+22
|
* call_indirect is now structural, so no need to pass the type name aroundAlon Zakai2016-09-071-3/+2
|
* add drop and tee expressionsAlon Zakai2016-09-071-2/+2
|
* offset support in tableAlon Zakai2016-08-151-8/+60
|
* support expressions in segment offsetsAlon Zakai2016-08-121-1/+1
|
* update wasm.js, and stop optimizing in asm2wasm in wasm.jsAlon Zakai2016-06-291-6/+3
|
* store locals in a vector in the interpreter and update wasm.js. also fix ↵Alon Zakai2016-05-181-4/+6
| | | | address usage in wasm.js
* Fixes wasm-js build after Address and SExpressionWasmBuilder refactoring. (#514)Yury Delendik2016-05-171-14/+11
|
* Fix the maximum memory size to be valid. (#492)Dan Gohman2016-05-131-2/+2
|
* Be more careful when loading i64 in wasm-js glue, we had a bug where the ↵Alon Zakai2016-05-081-10/+13
| | | | bits were trampled before we read them (#460)
* Fix zero-extension in i64.load32_u.Dan Gohman2016-04-271-4/+4
|
* update wasm.jsAlon Zakai2016-04-181-2/+2
|
* remove the AllocatingModule class, and just make Module have allocations. ↵Alon Zakai2016-04-181-4/+4
| | | | the distinction is not really that useful, and passes do need to allocate, so we would need to pass around AllocatingModules all around anyhow. (#361)
* add debug param for SExpressionWasmBuilderAlon Zakai2016-04-041-1/+1
|
* add apis for accessing module elementsAlon Zakai2016-04-041-9/+6
|
* handle unaligned i64 loads in wasm-js.cppAlon Zakai2016-04-041-1/+15
|
* verify imports are valid in wasm.js, do not wait to abort if/when they are ↵Alon Zakai2016-04-011-0/+12
| | | | called
* fix wasm.js loads of aligned i64sAlon Zakai2016-03-301-0/+4
|
* fix wasm.js loads of i64 that read <8 bytesAlon Zakai2016-03-301-8/+9
|
* add function stack printing in interpreterAlon Zakai2016-03-231-0/+12
|
* update wasm.jsAlon Zakai2016-03-211-1/+1
|
* finish wasm-binary method and update emscriptenAlon Zakai2016-03-121-2/+2
|
* refactor wasm.js and prepare for loading and interpreting binariesAlon Zakai2016-03-121-9/+32
|
* Make initial and max memory sizes be in pages instead of bytesDerek Schuff2016-03-091-3/+13
| | | | | | | The AST and everything that uses it treats the values as pages. Javascript continues to use bytes. This matches v8 and sexpr-wasm, and the consensus from live discussion and PR209 in the spec.
* remove optimization for interpreter memory generation, make it always return ↵Alon Zakai2016-03-041-12/+9
| | | | a memory like in the native code path
* fix unaligned wasm.js load/storeAlon Zakai2016-02-191-2/+3
|
* handle aligned and unaligned int64 store in wasm.jsAlon Zakai2016-02-191-14/+20
|
* make wasm.js tolerate wrong alignments, as per the wasm specAlon Zakai2016-02-191-4/+3
|
* support 64-bit stores in wasm.jsAlon Zakai2016-02-191-0/+5
|
* add unaligned memory accesses to wasm.jsAlon Zakai2016-02-191-3/+64
|
* update wasm.jsAlon Zakai2016-02-081-3/+3
|
* relax wasm.js assertions on alignment, and update wasm.js buildAlon Zakai2016-02-011-2/+2
|
* refactor FunctionType to always be accessed from the Module's central store, ↵Alon Zakai2016-01-111-1/+1
| | | | which is necessary for simple binary writing
* asm2wasm: use support's command-lineJF Bastien2016-01-111-1/+1
|