summaryrefslogtreecommitdiff
path: root/test/wasm2js/br_table_hoisting.2asm.js.opt
Commit message (Collapse)AuthorAgeFilesLines
* Drop support for non-standard quoted function names (#6188)Thomas Lively2023-12-201-8/+8
| | | | | | | | | | | | | | | | | | We previously supported a non-standard `(func "name" ...` syntax for declaring functions exported with the quoted name. Since that is not part of the standard text format, drop support for it, replacing it with the standard `(func $name (export "name") ...` syntax instead. Also replace our other usage of the quoted form in our text output, which was where we quoted names containing characters that are not allowed to appear in standard names. To handle that case, adjust our output from `"$name"` to `$"name"`, which is the standards-track way of supporting such names. Also fix how we detect non-standard name characters to match the spec. Update the lit test output generation script to account for these changes, including by making the `$` prefix on names mandatory. This causes the script to stop interpreting declarative element segments with the `(elem declare ...` syntax as being named "declare", so prevent our generated output from regressing by counting "declare" as a name in the script.
* wasm2js: Stop emitting nan and infinity (#5391)Will Cohen2023-01-041-2/+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-2/+1
| | | | | | | | 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-3/+2
| | | | | | 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-1/+2
| | | | | | | | | | | 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] Use native JavaScript Math.trunc (#3329)Max Graey2020-11-101-0/+1
|
* wasm2js: Remove global dict arguments to asmFunc (#3325)Sam Clegg2020-11-051-26/+13
|
* wasm2js: Skip heap creation in the absence of wasm memory. NFC (#3167)Sam Clegg2020-09-241-11/+16
| | | | | Also, format the asmFunc call to make it more readable in the ES6 modules case.
* wasm2js: Support exported tables (#3152)Sam Clegg2020-09-211-1/+0
|
* wasm2js: Fix switch lowering, don't fall through after the hoisted parts (#2301)Alon Zakai2019-08-161-0/+2
| | | | | The switch lowering will "hoist" blocks of code into the JS switch when it can. If it can hoist some but not others, it must not fall through into those others (while it can fall through the hoisted ones - they began as nested blocks with falling-through between them). To fix this, after the hoisted ones issue a break out of the switch (which now contains all the hoisted code, so breaking out of it gets to the code right after the hoisted ones). fixes #2300
* Stop emitting "almost asm" in wasm2js output (#2221)Alon Zakai2019-07-121-1/+0
| | | We don't ever emit "use asm" anymore, so this similar annotation is not really useful, it just increases size.
* wasm2js: Switch optimizations (#2141)Alon Zakai2019-05-281-0/+182
This pattern-matches towers of blocks + a br_table into a JS switch. This is much smaller in code size and also avoids heavy nesting that can exceed the recursion limits of JS parsers. This is not enough yet, because it pattern-matches very specifically. In reality, switches can look slightly different. Followup PRs will extend this. For now, this passes the test suite (what passed before - not including the massive-switch tests) + fuzzing so it's a good start.