summaryrefslogtreecommitdiff
path: root/test/wasm2js/bulk-memory.2asm.js
Commit message (Collapse)AuthorAgeFilesLines
* wasm2js: Stop emitting nan and infinity (#5391)Will Cohen2023-01-041-10/+0
| | | | | | | As noted in #4739, legacy language emitting nan and infinity exists, with the observation that it can be removed once asm.js is no longer used and global NaN is available. This commit removes that asm.js-specific code accordingly.
* wasm2js: Support for flexible module import naming (#5114)Sam Clegg2022-10-051-12/+7
| | | | | | | | The previous code was making emscripten-specific assumptions about imports basically all coming from the `env` module. I can't find a way to make this backwards compatible so may do a combined roll with the emscripten-side change: https://github.com/emscripten-core/emscripten/pull/17806
* wasm2js: Don't assume that `env.abort` can always be impored. (#5049)Sam Clegg2022-09-161-35/+10
| | | | | | This import was being injected and then used to implement trapping. Rather than injecting an import that doesn't exist in the original module we instead use the existing mechanism to implement this as an internal helper.
* wasm2js: Have instantiate function take standard import object (#5018)Sam Clegg2022-09-141-5/+10
| | | | | | | | | | | Previously we were assuming asmLibraryArg which is what emscripten passes as the `env` import object but using this method is more flexible and should allow wasm2js to work with import that are not all form a single object. The slight size increase here is just temporary until emscripten gets updated. See https://github.com/emscripten-core/emscripten/pull/17737
* wasm2js: Declare data segments before calling asmFunc (#3337)Sam Clegg2020-11-111-43/+50
| | | | | | | | | This is because we maybe need to reference the segments during the start function. For example in the case of pthreads we conditionally load passive segments during start. Tested in emscripten with: tests/runner.py wasm2js1
* wasm2js: Support for exported memory (#3323)Sam Clegg2020-11-101-30/+26
| | | | | The asmFunc now sets the outer scope's `bufferView` variable as well as its own internal views.
* [wasm2js] Use native JavaScript Math.trunc (#3329)Max Graey2020-11-101-0/+5
|
* Canonicalize subtraction with constant on the right to addition (#3321)Max Graey2020-11-101-3/+3
| | | | | | | Using addition in more places is better for gzip, and helps simplify the optimizer as well. Add a FinalOptimizer phase to do optimizations like our signed LEB tweaks, to reduce binary size in the rare case when we do want a subtraction.
* wasm2js: Remove global dict arguments to asmFunc (#3325)Sam Clegg2020-11-051-189/+124
|
* wasm2js: Skip heap creation in the absence of wasm memory. NFC (#3167)Sam Clegg2020-09-241-15/+84
| | | | | Also, format the asmFunc call to make it more readable in the ES6 modules case.
* wasm2js: Support exported tables (#3152)Sam Clegg2020-09-211-5/+0
|
* wasm2js: Fix a bug with adjacent reinterprets (#2964)Alon Zakai2020-07-201-4/+4
| | | | | | | | | | | i64 reinterprets were lowered in the i64 pass, and i32s at the very end, in wasm2js itself. This could break since in between the i64 pass and wasm2js we run optimizations, and the optimizer was not aware of what we lower the i32 reinterprets to - calls to use scratch memory. Those calls have a side effect of altering scratch memory. The optimizer just saw an i32 reinterpret, and moved it across the i64 reinterpret's scratch memory calls. This makes 32-bit reinterprets use separate scratch memory from 64-bit ones, which means they can never interfere with each other.
* wasm2js: Bulk memory support (#2923)Alon Zakai2020-06-221-0/+420
Adds a special helper functions for data.drop etc., as unlike most wasm instructions these are too big to emit inline. Track passive segments at runtime in var memorySegments whose indexes are the segment indexes. Emit var bufferView even if the memory exists even without memory segments, as we do still need the view in order to operate on it. Also adds a few constants for atomics that will be useful in future PRs (as this PR updates the constant lists anyhow).