]> Cypherpunks repositories - gostls13.git/commit
cmd/internal/obj: minor refactor of wasmimport code
authorCherry Mui <cherryyz@google.com>
Mon, 5 Aug 2024 17:40:18 +0000 (13:40 -0400)
committerCherry Mui <cherryyz@google.com>
Tue, 6 Aug 2024 15:56:16 +0000 (15:56 +0000)
commit03e5d83ca7323e354dfff6ba50720302ed835b7c
tree1c6e1d4c01f98fe6cee93bd03648e5dadcde49c0
parenta7c7ec5995b3901145f847c01f3e100b2b7e3421
cmd/internal/obj: minor refactor of wasmimport code

This CL does some minor refactoring of the code handling
wasmimport.
- Put the WasmImport aux reading and writing code together for
  symmetry.
- Define WasmFuncType, embedded in WasmImport. WasmFuncType could
  also be used (later) for wasmexport.
- Move code generation code to a separate function. The containing
  function is already pretty large.
- Simplify linker code a little bit. The loader convention is to
  return the 0 Sym for nonexistent symbol, instead of a separate
  boolean.

No change in generated code. Passes toolstash -cmp
(GOARCH=wasm GOOS=wasip1 go build -toolexec "toolstash -cmp" -a std cmd).

Change-Id: Idc2514f84a08621333841ae4034b81130e0ce411
Reviewed-on: https://go-review.googlesource.com/c/go/+/603135
Reviewed-by: Than McIntosh <thanm@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
src/cmd/internal/obj/link.go
src/cmd/internal/obj/objfile.go
src/cmd/internal/obj/sym.go
src/cmd/internal/obj/wasm/wasmobj.go
src/cmd/link/internal/loader/loader.go
src/cmd/link/internal/wasm/asm.go