summaryrefslogtreecommitdiff
path: root/src/binaryen-c.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* remove PageSize and HasFeature, which wasm removed a while back (#1667)Alon Zakai2018-09-121-2/+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-20/+19
| | | | | This allows using imports in the table. Fixes #1645
* Rename `wasm2asm` to `wasm2js`, emit ESM by default (#1642)Alex Crichton2018-08-301-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | * Rename the `wasm2asm` tool to `wasm2js` This commit performs a relatively simple rename of the `wasm2asm` tool to `wasm2js`. The functionality of the tool doesn't change just yet but it's intended that we'll start generating an ES module instead of just an `asm.js` function soon. * wasm2js: Support `*.wasm` input files Previously `wasm2js` only supported `*.wast` files but to make it a bit easier to use in tooling pipelines this commit adds support for reading in a `*.wasm` file directly. Determining which parser to use depends on the input filename, where the binary parser is used with `*.wasm` files and the wast parser is used for all other files. * wasm2js: Emit ESM imports/exports by default This commit alters the default behavior of `wasm2js` to emit an ESM by default, either importing items from the environment or exporting. Items like initialization of memory are also handled here.
* Proper error handling in add* and get* methods (#1570)Alon Zakai2018-07-101-0/+8
| | | | | | | 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.
* Add a way to remove function types to Binaryen-C/.js (#1536)Daniel Wirtz2018-05-081-0/+17
|
* Expose sign extension ops in Binaryen-C/.js (#1534)Daniel Wirtz2018-05-071-1/+6
|
* Rename WasmType => Type (#1398)Alon Zakai2018-02-021-31/+31
| | | | * rename WasmType to Type. it's in the wasm:: namespace anyhow, and without Wasm- it fits in better alongside Index, Address, Expression, Module, etc.
* Fix hard-wired buffer limit in the JS API (#1394)Daniel Wirtz2018-02-011-1/+28
|
* Sourcemap support for Binaryen C/JS (#1392)Daniel Wirtz2018-01-291-6/+65
| | | | | | * Initial source map support for C/JS * Also test getDebugInfoFileName
* Atomic wait/wake fixes (#1383)Alon Zakai2018-01-221-2/+2
| | | | | | | | * fix wait and wake binary format support, they have alignments and offsets * don't emit unreachable parts of atomic operations, for simplicity and to avoid special handling * don't emit atomic waits by default in the fuzzer, they hang in native vm support
* Also clear imports and exports maps in BinaryenModuleDispose (#1372)Daniel Wirtz2018-01-191-0/+2
| | | | | | fixes #1369 * Update binaries and kitchen-sink test
* Refactor optimization defaults (#1366)Alon Zakai2018-01-171-24/+14
| | | | | Followup to #1357. This moves the optimization settings into pass.h, and uses it from there in the various places. This also splits up huge lines from the tracing code, which put all block children (whose number can be arbitrarily large) on one line. This seems to have caused random errors on the bots, I suspect from overflowing a buffer. Anyhow, it's much more clear to split the lines at a reasonable length.
* Add optimize, shrink level and debug info options to C/JS (#1357)Daniel Wirtz2018-01-171-0/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* runFunction => runOnFunction (we run on the function, not run the function) ↵Alon Zakai2018-01-101-2/+2
| | | | (#1356)
* Add getters for various specific expression fields to C/JS (#1332)Daniel Wirtz2017-12-201-36/+944
|
* Provide AddImport/AddExport for each element in the C-API (#1292)Daniel Wirtz2017-11-221-5/+115
| | | | * 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-0/+60
| | | * Also other function utilities in C and JS APIs
* Add atomic load/store to binaryen-c/.js (#1298)Daniel Wirtz2017-11-201-1/+23
|
* Add const expression utilities to binaryen-c/.js (#1288)Daniel Wirtz2017-11-151-0/+54
|
* Fix yet another BinaryenAddGlobal tracing issue (#1283)Daniel Wirtz2017-11-131-1/+1
| | | Now also includes a test.
* Added expression utility functions to binaryen-c/.js (#1269)Daniel Wirtz2017-11-111-0/+47
|
* Fixed use of undefined 'types' array in BinaryenAddGlobal tracing (#1279)Daniel Wirtz2017-11-101-1/+1
| | | | | | * Fixed use of undefined 'types' array in BinaryenAddGlobal tracing * also fix use of 'expressions'
* Added BinaryenAtomic* incl. ops to binaryen-c (#1276)Daniel Wirtz2017-11-091-1/+47
| | | | | | * Added BinaryenAtomicRMW incl. ops to binaryen-c * AtomicCmpxchg, AtomicWait, AtomicWake
* Use 'BinaryenGlobalRef' instead of 'BinaryenImportRef' for globals in ↵Daniel Wirtz2017-11-071-1/+1
| | | | binaryen-c (#1270)
* Added the ability to run specific optimization passes to binaryen-c/.js (#1252)Daniel Wirtz2017-10-301-0/+21
|
* notation change: AST => IR (#1245)Alon Zakai2017-10-241-1/+1
| | | The IR is indeed a tree, but not an "abstract syntax tree" since there is no language for which it is the syntax (except in the most trivial and meaningless sense).
* Add missing finalize() call to C API for call_indirect (#1184)Sergey Pepyakin2017-09-141-0/+1
|
* Add missing prototypes for globals in binaryen-c.h (#1183)Sergey Pepyakin2017-09-131-2/+2
| | | | | | * Add missing prototypes for globals in binaryen-c.h * Use int8_t for mutable_
* Initial asm.js output for binaryen-c / binaryen.js (#1136)Daniel Wirtz2017-08-241-1/+17
| | | | * Added BinaryenModulePrintAsmjs (using wasm2asm) + Module#emitAsmjs JS binding
* refactor and improve break validation. breaks names are unique, so we don't ↵Alon Zakai (kripken)2017-07-111-0/+1
| | | | need a stack, and break targets must exist even if they are not actually taken
* Add atomic loads and stores (#1077)Derek Schuff2017-06-281-2/+2
| | | | | Add IR, wast and binary support for atomic loads and stores. Currently all IR generated by means other than parsing wast and binary files always generates non-atomic accesses, and optimizations have not yet been made aware of atomics, so they are certainly not ready to be used yet.
* S-expression parsing in C API and binaryen.js (#1050)Alon Zakai2017-06-131-0/+18
| | | | | | * add C API and binaryen.js support for parsing s-expressions * update js builds and tests
* C API fixes (#1042)Alon Zakai2017-06-071-16/+17
| | | | | | * fix mutex usage in C API, and some minor cleanup around it too * update testcase that was forgotten to be updated before
* Update binaryen-c/binaryen.js, fixes #1028, fixes #1029 (#1030)Daniel Wirtz2017-06-071-4/+102
| | | 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-241-1/+1
| | | 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.
* clean up raw pointer import->functionType, make it a Name like everything ↵Alon Zakai2017-02-171-1/+1
| | | | else (#915)
* Merge pull request #871 from WebAssembly/fix-c-api-unused-memAlon Zakai2017-01-051-0/+1
|\ | | | | Mark memory as existing when it is created in the C API
| * mark memory as existing when it is created in the C APIAlon Zakai (kripken)2017-01-041-0/+1
| |
* | Print long string in one call (#864)Loo Rong Jie2017-01-031-11/+11
|/
* More binary updates for 0xc (#733)Derek Schuff2016-10-031-0/+1
| | | | | | | | | | | | | | | Refine tables to explicitly exist or not. Previously they were printed or encoded if it had any segments, or an initial or max size. However tables can be defined but empty, so we had a special hack that defined an empty segment when we really just wanted an empty table. Now, just make the existence explicit. Update Function table encoding for 0xc (Table and Element sections) Add end opcodes after function bodies (these are consumed by getMaybeBlock with the same behavior that it had before when it reached the function end, so no explicit decode) Update call_indirect encoding for 0xc (no arity, call target is last)
* Refactor Import::Kind and Export::Kind into an ExternalKind enum class (#725)Alon Zakai2016-10-031-2/+2
|
* refactor wasm.h to remove numericIndex hacks, and move indexing to the parsersAlon Zakai2016-09-211-0/+1
|
* import type for globalsAlon Zakai2016-09-071-1/+1
|
* import kindsAlon Zakai2016-09-071-0/+1
|
* export kindsAlon Zakai2016-09-071-1/+7
|
* loops no longer have an out label and other upstream loop updatesAlon Zakai2016-09-071-6/+3
|
* add drop and tee expressionsAlon Zakai2016-09-071-2/+41
|
* offset support in tableAlon Zakai2016-08-151-2/+4
|
* support function table initial and max sizes, and new printing formatAlon Zakai2016-08-121-0/+1
|
* support expressions in segment offsetsAlon Zakai2016-08-121-4/+4
|