summaryrefslogtreecommitdiff
path: root/src/js
Commit message (Collapse)AuthorAgeFilesLines
* Improvements to build-js.sh and JS API (#679)Rasmus2016-09-024-1/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Adds command-line argument to build-js.sh for specifying the location of Emscripten. Also spreads out program arguments on separate lines * Exposes WasmBinaryWriter and BufferWithRandomAccess in the JS API to allow writing WASM modules and access the produced bytes via the JS API * Updates bin/binaryen.js and bin/wasm.js from changes to build-js.sh * Adds exclude patterns to .gitignore for some files generated by build-js.sh and .DS_Store for macOS * Changes build-js.sh to use EMSCRIPTEN env var instead of a command-line argument to provide the path to emscripten * Improvements to JS builds - Adds -g flag to build-js.sh that will build unoptimized and unmangled versions of binaryen.js and wasm.js (output has a "-g.js" suffix to allow co-existence with regular optimized builds). - Enables closure compiler for non-debug builds - Adds browser test for s-expression parser + WASM code gen (requires wasm to be enabled in the browser.) - Adds iterator interface to BufferWithRandomAccess (when Symbol.iterator is available) - Adds toArrayBuffer to BufferWithRandomAccess (when TypedArray is available) - Adds compileWast(sourceText :string) :ArrayBuffer to the module, parsing & compiling s-expression code to a WASM module - Changes the way binaryen.js is exported to allow usage in CommonJS, AMD and UMD envionments. * Expose "Binaryen" global in a better way to work with a.js generated by check.py * Fix to binaryen.js to only export a global variable when running the test (a.js) while inside a module (avoids polluting global in e.g. nodejs). Also fixes a spelling mistake. * Better "no WASM detected" message in test/binaryen.js/browser.html * Small change to error message in build-js.sh where $EMSCRIPTEN does not point to a directory * Changes emcc args in build-js.sh after investingating a large number of argument combinations. Also adds a browser benchmark. The result of emcc arguments and the effect on performance is summarized in this doc: https://gist.github.com/rsms/e33c61a25a31c08260161a087be03169 * Enable inferring emscripten path by looking in PATH when EMSCRIPTEN is not set in env
* emit safe calls for i32 div/rem when in precise mode in asm2wasm, as they ↵Alon Zakai2016-07-141-0/+12
| | | | can trap (#637)
* make wasm.js safe in closure compiler (#438)Alon Zakai2016-05-051-1/+1
|
* fall back from wasm compilation errors, and add loggingAlon Zakai2016-04-281-3/+12
|
* refactor js/wasm glue to defer the wasm/wasm-polyfill/asmjs-fallback as late ↵Alon Zakai2016-04-281-96/+100
| | | | as possible. this lets us recover from wasm compilation failures and still do a fallback method
* Use Module instead of AllocatingModule in binaryen.js tests (#391)Jan Wolski2016-04-251-0/+1
| | | | | | * Use Module instead of AllocatingModule in binaryen.js tests * include compiled binaryen.js, too
* Removes wasm-s-parser debug logging from binaryen.idl. (#373)Yury Delendik2016-04-211-1/+1
| | | | | | | Continuation of #345 (see https://github.com/WebAssembly/binaryen/commit/2887883029de293458344a5d564039074d93246e#diff-499c4e70c8aadb9837261ebcc4725f78R262) Currently building of binaryen.js fails with "src/../glue.cpp:102:14: error: no matching constructor for initialization of 'wasm::SExpressionWasmBuilder'"
* remove the AllocatingModule class, and just make Module have allocations. ↵Alon Zakai2016-04-181-7/+1
| | | | 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)
* more idl additions fix idl testAlon Zakai2016-04-041-0/+3
|
* more idlAlon Zakai2016-04-041-0/+16
|
* add necessary idl constructorsAlon Zakai2016-04-041-0/+4
|
* add simpler constructor for SExpressionWasmBuilderAlon Zakai2016-04-041-0/+51
|
* fix reallocBuffer to send growWasmMemory a size in pagesAlon Zakai2016-04-011-1/+4
|
* if Module.asm is already set, use thatAlon Zakai2016-03-241-1/+4
|
* note when we are using wasmAlon Zakai2016-03-231-0/+2
|
* quote strings for closure compilerAlon Zakai2016-03-231-4/+4
|
* fix memory growth #270Alon Zakai2016-03-221-10/+9
|
* improve method namesAlon Zakai2016-03-181-15/+15
|
* finish wasm-binary method and update emscriptenAlon Zakai2016-03-121-3/+8
|
* refactor wasm.js and prepare for loading and interpreting binariesAlon Zakai2016-03-121-22/+37
|
* log failures in wasm/js integrationAlon Zakai2016-03-111-4/+16
|
* check for WasmJS in polyfill glueAlon Zakai2016-03-111-0/+2
|
* support a comma-separated list of methods in wasm/js integrationAlon Zakai2016-03-111-49/+83
|
* fix imports when arriving from wasm backend, which does not prefixAlon Zakai2016-03-091-0/+17
|
* use .exportsAlon Zakai2016-03-091-2/+2
|
* move to a cleaner way of emcc.py integrating with wasm.js-post.jsAlon Zakai2016-03-081-5/+9
|
* assume wasm binaries were preloaded on the web, where we lack sync binary readsAlon Zakai2016-03-061-1/+8
|
* warn when we should grow wasm memory in mergeMemoryAlon Zakai2016-03-051-1/+3
|
* fix global.Math importsAlon Zakai2016-03-051-1/+1
|
* place NaN and Infinity on globalAlon Zakai2016-03-041-1/+5
|
* send a typed array to instantiateMemoryAlon Zakai2016-03-041-1/+1
|
* move WasmTypes in integrateWasmJS to the right placeAlon Zakai2016-03-041-8/+8
|
* pass buffer to instantiateModuleAlon Zakai2016-03-041-1/+1
|
* WASM => WasmAlon Zakai2016-03-041-8/+2
|
* use lookupImport directlyAlon Zakai2016-03-041-1/+1
|
* move to more unification of import handling in interpreter and native pathsAlon Zakai2016-03-041-38/+28
|
* support memory segments in wasm modules, which we get if the wasm backend ↵Alon Zakai2016-03-041-2/+4
| | | | was used
* fix providedTotalMemory setting, must be before it is usedAlon Zakai2016-03-041-2/+2
|
* fix mergeMemoryAlon Zakai2016-03-041-4/+6
|
* send flattened output to v8 and structed to sm. send only functions to bothAlon Zakai2016-02-151-4/+6
|
* add sm code to parallel v8 code in integrateWasmJSAlon Zakai2016-02-151-5/+11
|
* refactor memory merging codeAlon Zakai2015-12-231-31/+31
|
* Fix the license headersJF Bastien2015-12-211-1/+15
| | | | This applies Apache 2.0 properly (as far as our lawyers have told me). We can do this early since all of the code was written by Alon Zakai.
* rename post.js as we will have other js componentsAlon Zakai2015-12-211-0/+0
|
* wasm.js imports refactoring, and temporary flattening of imports for native wasmAlon Zakai2015-12-011-14/+28
|
* refactor wasm.js method and add testingAlon Zakai2015-11-291-2/+12
|
* use wasm-s-parser method by efaultAlon Zakai2015-11-291-1/+1
|
* apply mapped globals in wasm.js on all asm2wasm output, whether done on the ↵Alon Zakai2015-11-291-13/+23
| | | | client or ahead of time
* fix wasm.js/s-expression-parsing global mappingAlon Zakai2015-11-281-1/+22
|
* optionally emit mappedGlobals in asm2wasm, and use that to help when parsing ↵Alon Zakai2015-11-281-5/+4
| | | | s-expressions