summaryrefslogtreecommitdiff
path: root/src/js
Commit message (Collapse)AuthorAgeFilesLines
* Passive segments (#1976)Thomas Lively2019-04-051-2/+7
| | | | | Adds support for the bulk memory proposal's passive segments. Uses a new (data passive ...) s-expression syntax to mark sections as passive.
* Rename atomic wait/notify instructions (#1972)Heejin Ahn2019-03-301-6/+6
| | | | | | | | This renames the following: - `i32.wait` -> `i32.atomic.wait` - `i64.wait` -> `i64.atomic.wait` - `wake` -> `atomic.notify` to match the spec.
* Add BinaryenConstGetValueV128 to C/JS-API (#1931)Daniel Wirtz2019-03-131-32/+63
| | | | | | | This PR adds void BinaryenConstGetValueV128(BinaryenExpressionRef expr, uint8_t* out); to the C-API and uses it in Binaryen.getExpressionInfo in the JS-API.
* avoid the deprecated and removed Pointer_stringify (#1906)Alon Zakai2019-02-071-21/+21
|
* fix binaryen.js bindings handling of literals (#1896)Alon Zakai2019-02-061-2/+2
| | | The hardcoded 16 size was no longer valid. This was broken for a while, but happened to not overwrite important memory. Testing with the wasm backend did hit breakage.
* Bulk memory operations (#1892)Thomas Lively2019-02-051-0/+50
| | | | | | Bulk memory operations The only parts missing are the interpreter implementation and spec tests.
* Massive renaming (#1855)Thomas Lively2019-01-071-13/+27
| | | | | | Automated renaming according to https://github.com/WebAssembly/spec/issues/884#issuecomment-426433329.
* Rename `idx` to `index` in SIMD code for consistency (#1836)Thomas Lively2018-12-181-30/+30
|
* SIMD (#1820)Thomas Lively2018-12-131-0/+646
| | | | | | | | | Implement and test the following functionality for SIMD. - Parsing and printing - Assembling and disassembling - Interpretation - C API - JS API
* Implement nontrapping float-to-int instructions (#1780)Thomas Lively2018-12-041-0/+40
|
* Add v128 type (#1777)Thomas Lively2018-11-291-1/+1
|
* Relooper CFG optimizations (#1759)Alon Zakai2018-11-211-79/+96
| | | | | | | | | | | | | | | | Previously the relooper would do some optimizations when deciding when to use an if vs a switch, how to group blocks, etc. This PR adds an additional pre-optimization phase with some basic but useful simplify-cfg style passes, * Skip empty blocks when they have just one exit. * Merge exiting branches when they are equivalent. * Canonicalize block contents to make such comparisons more useful. * Turn a trivial one-target switch into a simple branch. This can help in noticeable ways when running the rereloop pass, e.g. on LLVM wasm backend output. Also: * Binaryen C API changes to the relooper, which now gets a Module for its constructor. It needs it for the optimizations, as it may construct new nodes. * Many relooper-fuzzer improvements. * Clean up HashType usage.
* Add Module#emitStackIR to the JS-API (#1717)Daniel Wirtz2018-10-311-0/+10
| | | Related to #1716 (comment)
* Shared memory support for add memory import and set memory functions. (#1686)Nidin Vinayakan2018-10-111-4/+5
|
* Add BinaryenRemoveGlobal / Module.removeGlobal to C/JS API (#1692)Daniel Wirtz2018-10-091-0/+5
|
* Add initial/maximum table size parameters to C/JS API (#1687)Daniel Wirtz2018-09-281-4/+5
|
* Unify imported and non-imported things (#1678)Alon Zakai2018-09-191-27/+8
| | | | | | | | | | | | | | 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.
* remove PageSize and HasFeature, which wasm removed a while back (#1667)Alon Zakai2018-09-121-5/+0
| | | From #1665 (a fuzz bug noticed they were not handled in stack.h).
* BinaryenSetFunctionTable now accepts array of func names not funcs. (#1650)Jay Phelps2018-09-011-2/+4
| | | | | This allows using imports in the table. Fixes #1645
* Proper error handling in add* and get* methods (#1570)Alon Zakai2018-07-101-0/+9
| | | | | | | See #1479 (comment) Also a one-line readme update, remove an obsolete compiler (mir2wasm) and add a new one (asterius). Also improve warning and error reporting in binaryen.js - show a stack trace when relevant (instead of node.js process.exit), and avoid atexit warning spam in debug builds.
* emscripten no longer allows modifying Module['print'] at runtime. Modify the ↵Alon Zakai2018-07-031-9/+9
| | | | internal out() method instead. see kripken/emscripten#6756 (#1614)
* Add a way to remove function types to Binaryen-C/.js (#1536)Daniel Wirtz2018-05-081-0/+5
|
* Expose sign extension ops in Binaryen-C/.js (#1534)Daniel Wirtz2018-05-071-0/+20
|
* Fix hard-wired buffer limit in the JS API (#1394)Daniel Wirtz2018-02-011-21/+16
|
* Sourcemap support for Binaryen C/JS (#1392)Daniel Wirtz2018-01-291-19/+45
| | | | | | * Initial source map support for C/JS * Also test getDebugInfoFileName
* Use Emscripten's MODULARIZE_INSTANCE when building binaryen.js (#1368)Daniel Wirtz2018-01-192-18/+0
|
* Add optimize, shrink level and debug info options to C/JS (#1357)Daniel Wirtz2018-01-172-4/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add optimize, shrink level and debug info options to C/JS * Add instantiate functionality for creating additional unique instances of the API * Use a workaround when running tests in node Tests misuse a module as a script by concatenating, so instead of catching this case in the library, catch it there * Update sieve test Seems optimized output changed due to running with optimize levels 2/1 now * Use the options with all pass runners * Update relooper-fuzz C-API test * Share defaults between tools and the C-API * Add a test for optimize levels * Unify node test support in check.by and auto_update_tests.py * Also add getters for optimize levels and test them * Also test debugInfo * Add debug info to C tests that used it as well * Fix missing NODEJS import in auto_update_tests * Detect node.js version (WASM support) * Update hello-world JS test (now also runs with node) * feature-test WebAssembly in node instead * Document that these options apply globally, and where * Make sure hello-world.js output doesn't differ between mozjs/node
* Fixes for #5998 (#1341)Alon Zakai2017-12-302-1467/+1449
| | | | | | | | | | | | | | * binaryen.js and wasm.js don't need filesystem support * newest emscripten no longer uses Runtime.* * build fixes for binaryen.js and wasm.js also move binaryen.js to use standard emscripten MODULARIZE * run binaryen.js in all possible engines ; update js builds * don't emit debug build to a different name, just emit binaryen.js. makes testing easier and safer * remove volatile things from binaryen.js info printing in tests
* Add getters for various specific expression fields to C/JS (#1332)Daniel Wirtz2017-12-201-48/+315
|
* binaryen.js improvements (#1324)Alon Zakai2017-12-071-13/+17
| | | | * binaryen.js improvements: block default value is none, not undefined, and add text-format style aliases for things like getLocal (so you can write get_local as in the text format)
* JS: Make 'segments' optional in setMemory (#1310)Daniel Wirtz2017-11-291-0/+1
| | | Currenty throws if omitted, see AssemblyScript/binaryen.js#2
* Provide AddImport/AddExport for each element in the C-API (#1292)Daniel Wirtz2017-11-221-4/+36
| | | | * Provide AddImport/AddExport for each element in the C-API
* Running passes on a single function in binaryen-c/.js (#1295)Daniel Wirtz2017-11-211-1/+27
| | | * Also other function utilities in C and JS APIs
* Add atomic load/store to binaryen-c/.js (#1298)Daniel Wirtz2017-11-201-0/+42
|
* Add const expression utilities to binaryen-c/.js (#1288)Daniel Wirtz2017-11-151-0/+19
|
* Add atomic ops to binaryen.js (#1280)Daniel Wirtz2017-11-131-0/+180
|
* Added expression utility functions to binaryen-c/.js (#1269)Daniel Wirtz2017-11-111-0/+37
|
* Added the ability to run specific optimization passes to binaryen-c/.js (#1252)Daniel Wirtz2017-10-301-0/+7
|
* Initial asm.js output for binaryen-c / binaryen.js (#1136)Daniel Wirtz2017-08-241-0/+8
| | | | * Added BinaryenModulePrintAsmjs (using wasm2asm) + Module#emitAsmjs JS binding
* Unified module loader support in binaryen.js (#1074)Daniel Wirtz2017-07-052-29/+15
| | | | | | * Unified module loader support in binaryen.js * Recompiled binaryen.js and wasm.js
* S-expression parsing in C API and binaryen.js (#1050)Alon Zakai2017-06-131-0/+8
| | | | | | * add C API and binaryen.js support for parsing s-expressions * update js builds and tests
* Update binaryen-c/binaryen.js, fixes #1028, fixes #1029 (#1030)Daniel Wirtz2017-06-071-3/+41
| | | 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.
* New binaryen.js (#922)Alon Zakai2017-03-244-139/+871
| | | 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.
* Optimize precise mode integer ops (#907)Alon Zakai2017-02-161-351/+0
| | | | | | * improve precise integer operations: call into a wasm function to do the possibly-trapping div/rem, which handles the corner cases, instead of an ffi. also fix a bug in the existing parallel 64-bit code for this * remove no longer needed wasm.js-post.js file (it moved into emscripten repo)
* Merge pull request #859 from WebAssembly/linkingAlon Zakai2016-12-271-1/+7
|\ | | | | Dynamic linking
| * export the wasm table on ModuleAlon Zakai2016-12-071-0/+1
| |
| * use wasmMaxTableSizeAlon Zakai2016-12-071-1/+6
| |
* | use exported static base and bump (#853)Alon Zakai2016-12-061-2/+2
|/
* Run wasm natively by default, no fallbacks to interpreting (#838)Alon Zakai2016-11-111-2/+2
| | | | | | * run wasm natively by default, no fallbacks to interpreting * improve error message, suggesting people add methods if they want more
* show a warning with guidance when a memory size incompatibility issue makes ↵Alon Zakai2016-11-101-0/+3
| | | | wasm compilation fail (#834)