summaryrefslogtreecommitdiff
path: root/misc/wasm/wasm_exec.js
Commit message (Collapse)AuthorAgeFilesLines
...
* runtime: add js/wasm architectureRichard Musiol2018-05-081-4/+4
| | | | | | | | | | | | | | | | | | This commit adds the js/wasm architecture to the runtime package. Currently WebAssembly has no support for threads yet, see https://github.com/WebAssembly/design/issues/1073. Because of that, there is no preemption of goroutines and no sysmon goroutine. Design doc: https://docs.google.com/document/d/131vjr4DH6JFnb-blm_uRdaC0_Nv3OUwjEY5qVCxCup4 About WebAssembly assembly files: https://docs.google.com/document/d/1GRmy3rA4DiYtBlX-I1Jr_iHykbX8EixC3Mq0TCYqbKc Updates #18892 Change-Id: I7f12d21b5180500d55ae9fd2f7e926a1731db391 Reviewed-on: https://go-review.googlesource.com/103877 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Austin Clements <austin@google.com>
* cmd/link: add wasm architectureRichard Musiol2018-05-071-1/+1
| | | | | | | | | | | | | | This commit adds the wasm architecture to the link command. Design doc: https://docs.google.com/document/d/131vjr4DH6JFnb-blm_uRdaC0_Nv3OUwjEY5qVCxCup4 Updates #18892 Change-Id: I5aef29954984537f2979679b5d393209e462f564 Reviewed-on: https://go-review.googlesource.com/103795 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
* syscall/js: add packageRichard Musiol2018-05-031-18/+18
| | | | | | | | | | | | | | | | | This commit adds the syscall/js package, which is used by the wasm architecture to access the WebAssembly host environment (and the operating system through it). Currently, web browsers and Node.js are supported hosts, which is why the API is based on JavaScript APIs. There is no common API standardized in the WebAssembly ecosystem yet. This package is experimental. Its current scope is only to allow tests to run, but not yet to provide a comprehensive API for users. Updates #18892 Change-Id: I236ea10a70d95cdd50562212f2c18c3db5009230 Reviewed-on: https://go-review.googlesource.com/109195 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* misc/wasm: wasm_exec: non-zero exit code on compile errorRichard Musiol2018-04-271-0/+1
| | | | | | | | | Return a non-zero exit code if the WebAssembly host fails to compile the WebAssmbly bytecode to machine code. Change-Id: I774309db2872b6a2de77a1b0392608058414160d Reviewed-on: https://go-review.googlesource.com/110097 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* misc/wasm: add scripts for running WebAssembly binariesRichard Musiol2018-03-301-0/+331
This commit adds scripts for running the WebAssembly binaries that the Go compiler will produce. The script go_js_wasm_exec uses Node.js to run the binaries. Adding it to PATH will enable "go run" and "go test" to work for js/wasm without having to manually provide the -exec flag. See https://golang.org/cmd/go/#hdr-Compile_and_run_Go_program for more information. The web page wasm_exec.html is an example on how to run the same binaries in a web browser. Both scripts use wasm_exec.js as a shared library. Updates #18892 Change-Id: Ia4d9bea025957750baa0d0651243dc88f156f85d Reviewed-on: https://go-review.googlesource.com/103255 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>