]> Cypherpunks.ru repositories - gostls13.git/commit
all: implement wasmimport directive
authorEvan Phoenix <evan@phx.io>
Sun, 22 Jan 2023 23:30:59 +0000 (15:30 -0800)
committerGopher Robot <gobot@golang.org>
Thu, 2 Mar 2023 05:28:55 +0000 (05:28 +0000)
commit02411bcd7c8eda9c694a5755aff0a516d4983952
tree71106b1c22a459f53d59f68751267a35c4ddf65a
parentaf9f21289fff0c513df3a785c97d8ca35e1829b2
all: implement wasmimport directive

Go programs can now use the //go:wasmimport module_name function_name
directive to import functions from the WebAssembly runtime.

For now, the directive is restricted to the runtime and syscall/js
packages.

* Derived from CL 350737
* Original work modified to work with changes to the IR conversion code.
* Modification of CL 350737 changes to fully exist in Unified IR path (emp)
* Original work modified to work with changes to the ABI configuration code.
* Fixes #38248

Co-authored-by: Vedant Roy <vroy101@gmail.com>
Co-authored-by: Richard Musiol <mail@richard-musiol.de>
Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
Change-Id: I740719735d91c306ac718a435a78e1ee9686bc16
Reviewed-on: https://go-review.googlesource.com/c/go/+/463018
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
Reviewed-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
29 files changed:
misc/wasm/wasm_exec.js
src/cmd/compile/internal/gc/compile.go
src/cmd/compile/internal/ir/func.go
src/cmd/compile/internal/ir/sizeof_test.go
src/cmd/compile/internal/noder/linker.go
src/cmd/compile/internal/noder/noder.go
src/cmd/compile/internal/noder/reader.go
src/cmd/compile/internal/noder/writer.go
src/cmd/compile/internal/ssagen/abi.go
src/cmd/internal/goobj/objfile.go
src/cmd/internal/obj/link.go
src/cmd/internal/obj/objfile.go
src/cmd/internal/obj/sym.go
src/cmd/internal/obj/wasm/a.out.go
src/cmd/internal/obj/wasm/anames.go
src/cmd/internal/obj/wasm/wasmobj.go
src/cmd/link/internal/loader/loader.go
src/cmd/link/internal/wasm/asm.go
src/runtime/lock_js.go
src/runtime/mem_js.go
src/runtime/os_js.go
src/runtime/rt0_js_wasm.s
src/runtime/stubs3.go
src/runtime/sys_wasm.go
src/runtime/sys_wasm.s
src/runtime/timestub2.go
src/syscall/js/js.go
src/syscall/js/js_js.s
src/syscall/js/js_test.go