aboutsummaryrefslogtreecommitdiffhomepage
path: root/targets/wasm_exec.js
AgeCommit message (Collapse)Author
2024-08-09feat: add node: specifierKobayashi Shunta
2024-01-29Remove unused value=
2023-08-04all: Go 1.21 supportAyke van Laethem
2023-06-17wasm: remove i64 workaround, use BigInt insteadAyke van Laethem
Browsers previously didn't support the WebAssembly i64 type, so we had to work around that limitation by converting the LLVM i64 type to something else. Some people used a pair of i32 values, but we used a pointer to a stack allocated i64. Now however, all major browsers and Node.js do support WebAssembly BigInt integration so that i64 values can be passed back and forth between WebAssembly and JavaScript easily. Therefore, I think the time has come to drop support for this workaround. For more information: https://v8.dev/features/wasm-bigint (note that TinyGo has used a slightly different way of passing i64 values between JS and Wasm). For information on browser support: https://webassembly.org/roadmap/
2022-03-07syscall/js: allow copyBytesTo(Go|JS) to use Uint8ClampedArraySamuel Stauffer
From https://github.com/golang/go/commit/f0e8b81aa34120e21642c569912bde00ccd33393 Fixes https://github.com/tinygo-org/tinygo/issues/1941
2021-10-26cgo: add support for stdio in picolibc and wasi-libcAyke van Laethem
This adds support for stdio in picolibc and fixes wasm_exec.js so that it can also support C puts. With this, C stdout works on all supported platforms.
2021-08-05wasm: add support for the crypto/rand packageAyke van Laethem
This is done via wasi-libc and the WASI interface, for ease of maintenance (only one implementation for both WASI and JS/browsers).
2021-04-15wasm: use WASI ABI for exit functionAyke van Laethem
This improves compatibility between the regular browser target (-target=wasm) and the WASI target (-target=wasi). Specifically, it allows running WASI tests like this: tinygo test -target=wasi encoding/base32
2021-03-15Upgrade WASI version to wasi_snapshot_preview1 (#1691)Federico G. Schwindt
wasm: Upgrade WASI version to wasi_snapshot_preview1 Addresses #1647.
2021-02-21Fix typo in wasm_exec.js, syscall/js.valueLoadString()Yongbin Kim
2020-10-18Add instanceof support for WebAssembly蒼時弦也
2020-09-24test: support non-host testsAyke van Laethem
For example, for running tests with -target=wasm or -target=cortex-m-qemu. It looks at the output to determine whether tests were successful in the absence of a status code.
2020-04-13wasm_exec: Implement syscall/js.valueDelete.Elliott Sales de Andrade
This is only useful on Go 1.14, and is a port of: https://github.com/golang/go/commit/60f271358f07647be0de9ee8225b50a391ea5def
2020-04-13wasm_exec: Add copyBytesToGo.Elliott Sales de Andrade
This is basically just a copy of copyBytesToJS, but with arguments reversed.
2020-04-13wasm_exec: Cross-port exit with code 1 change.Elliott Sales de Andrade
This cross-ports the following commit: https://github.com/golang/go/commit/9eef9648005c17681800fdb55ed2404ab769761e
2020-04-12wasm: backport "garbage collect references to JavaScript values"Ayke van Laethem
See commit: https://github.com/golang/go/commit/54e6ba6724dfde355070238f9abc16362cac2e3d Warning: this will drop support for Go 1.13 for WebAssembly targets! I have modified the integration tests to specifically blacklist Go 1.13 instead of whitelisting any other version, to avoid accidentally not testing WebAssembly.
2020-04-12wasm: remove _callbackShutdownAyke van Laethem
It doesn't seem to be used. This commit is somewhat related to this commit: https://github.com/golang/go/commit/6dd70fc5e391eb7a47be5eb6353107f38b73f161 Most of the things don't port over nicely.
2020-03-25wasm_exec: Sync polyfills with Go 1.14.1.Elliott Sales de Andrade
This ports over the following three commits: https://github.com/golang/go/commit/9627180f0f1f016307f4987cec6594baf90d64ae https://github.com/golang/go/commit/aff2f6ece896e0fe76a2c8853abf868f689006f0 https://github.com/golang/go/commit/42b79f08239216eeea3cc1b0febc992f91bd88de https://github.com/golang/go/commit/ecba83520d4c34870e0f5f0997d59d4496957240
2020-03-01wasm: add js.copyBytesToJS()Justin Clift
2020-02-23targets/wasm: update wasm_exec.js for go 1.13Johann Freymuth
This fixes the wasm examples for go 1.13, but breaks them for older go versions.
2020-01-28wasm: use wasi ABI for basic startup/stdoutAyke van Laethem
This allows TinyGo-built binaries to run under wasmtime, for example: tinygo build -o test.wasm -no-debug -target=wasm examples/test wasmtime run test.wasm 0
2019-09-16Add syscall/js.valueInvoke supportKonstantin Itskov
2019-09-16Add syscall/js.valueSetIndex supportKonstantin Itskov
2019-05-27wasm: add support for js.FuncOfAyke van Laethem
2019-03-07wasm: ignore arguments and environment variablesAyke van Laethem
The wasm_exec.js file copied from the main Go repository did write those values to address 4096 in linear memory, which led to memory corruption in linear memory. Remove these things for now, until they're actually supported, if support is ever added.
2019-03-04wasm: switch emulator to node.jsAyke van Laethem
Unfortunately, the olin/cwa emulator does not handle floats correctly. Node.js does, and because it is also supported by the Go WebAssembly implementation it has better support in general.
2019-01-21all: rewrite goroutine loweringAyke van Laethem
Before this commit, goroutine support was spread through the compiler. This commit changes this support, so that the compiler itself only generates simple intrinsics and leaves the real support to a compiler pass that runs as one of the TinyGo-specific optimization passes. The biggest change, that was done together with the rewrite, was support for goroutines in WebAssembly for JavaScript. The challenge in JavaScript is that in general no blocking operations are allowed, which means that programs that call time.Sleep() but do not start goroutines also have to be scheduled by the scheduler.
2019-01-18wasm: fix typo in wasm_exec.js preventing memory importSeth Junot
Seems to have been left over from the original copy. This correction should fix calls to the "memory" variable in syscall/js.
2018-11-25wasm: fix printing from Go codeAyke van Laethem
2018-11-24wasm: add glue JS codeAyke van Laethem
The file wasm_glue.js was copied from the Go wasm port and was modified, most importantly to match the TinyGo calling convention.