aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/link
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2022-11-01 16:46:43 -0700
committerKeith Randall <khr@golang.org>2023-02-24 00:21:13 +0000
commit21d82e6ac80fc2aea1eac9c8eec9afdd79cb5bdd (patch)
tree293b975ed4dc782a0d68ab64dc6167b6d6486066 /src/cmd/link
parentf684f3dc434f9199ceee175c07d28e8b2b0f28dc (diff)
downloadgo-21d82e6ac80fc2aea1eac9c8eec9afdd79cb5bdd.tar.xz
cmd/compile: batch write barrier calls
Have the write barrier call return a pointer to a buffer into which the generated code records pointers that need write barrier treatment. Change-Id: I7871764298e0aa1513de417010c8d46b296b199e Reviewed-on: https://go-review.googlesource.com/c/go/+/447781 Reviewed-by: Keith Randall <khr@google.com> Run-TryBot: Keith Randall <khr@golang.org> TryBot-Bypass: Keith Randall <khr@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com>
Diffstat (limited to 'src/cmd/link')
-rw-r--r--src/cmd/link/internal/wasm/asm.go34
1 files changed, 21 insertions, 13 deletions
diff --git a/src/cmd/link/internal/wasm/asm.go b/src/cmd/link/internal/wasm/asm.go
index 99018c8079..b5685701f2 100644
--- a/src/cmd/link/internal/wasm/asm.go
+++ b/src/cmd/link/internal/wasm/asm.go
@@ -55,19 +55,27 @@ type wasmFuncType struct {
}
var wasmFuncTypes = map[string]*wasmFuncType{
- "_rt0_wasm_js": {Params: []byte{}}, //
- "wasm_export_run": {Params: []byte{I32, I32}}, // argc, argv
- "wasm_export_resume": {Params: []byte{}}, //
- "wasm_export_getsp": {Results: []byte{I32}}, // sp
- "wasm_pc_f_loop": {Params: []byte{}}, //
- "runtime.wasmDiv": {Params: []byte{I64, I64}, Results: []byte{I64}}, // x, y -> x/y
- "runtime.wasmTruncS": {Params: []byte{F64}, Results: []byte{I64}}, // x -> int(x)
- "runtime.wasmTruncU": {Params: []byte{F64}, Results: []byte{I64}}, // x -> uint(x)
- "runtime.gcWriteBarrier": {Params: []byte{I64, I64}}, // ptr, val
- "cmpbody": {Params: []byte{I64, I64, I64, I64}, Results: []byte{I64}}, // a, alen, b, blen -> -1/0/1
- "memeqbody": {Params: []byte{I64, I64, I64}, Results: []byte{I64}}, // a, b, len -> 0/1
- "memcmp": {Params: []byte{I32, I32, I32}, Results: []byte{I32}}, // a, b, len -> <0/0/>0
- "memchr": {Params: []byte{I32, I32, I32}, Results: []byte{I32}}, // s, c, len -> index
+ "_rt0_wasm_js": {Params: []byte{}}, //
+ "wasm_export_run": {Params: []byte{I32, I32}}, // argc, argv
+ "wasm_export_resume": {Params: []byte{}}, //
+ "wasm_export_getsp": {Results: []byte{I32}}, // sp
+ "wasm_pc_f_loop": {Params: []byte{}}, //
+ "runtime.wasmDiv": {Params: []byte{I64, I64}, Results: []byte{I64}}, // x, y -> x/y
+ "runtime.wasmTruncS": {Params: []byte{F64}, Results: []byte{I64}}, // x -> int(x)
+ "runtime.wasmTruncU": {Params: []byte{F64}, Results: []byte{I64}}, // x -> uint(x)
+ "gcWriteBarrier": {Params: []byte{I64}, Results: []byte{I64}}, // #bytes -> bufptr
+ "runtime.gcWriteBarrier1": {Results: []byte{I64}}, // -> bufptr
+ "runtime.gcWriteBarrier2": {Results: []byte{I64}}, // -> bufptr
+ "runtime.gcWriteBarrier3": {Results: []byte{I64}}, // -> bufptr
+ "runtime.gcWriteBarrier4": {Results: []byte{I64}}, // -> bufptr
+ "runtime.gcWriteBarrier5": {Results: []byte{I64}}, // -> bufptr
+ "runtime.gcWriteBarrier6": {Results: []byte{I64}}, // -> bufptr
+ "runtime.gcWriteBarrier7": {Results: []byte{I64}}, // -> bufptr
+ "runtime.gcWriteBarrier8": {Results: []byte{I64}}, // -> bufptr
+ "cmpbody": {Params: []byte{I64, I64, I64, I64}, Results: []byte{I64}}, // a, alen, b, blen -> -1/0/1
+ "memeqbody": {Params: []byte{I64, I64, I64}, Results: []byte{I64}}, // a, b, len -> 0/1
+ "memcmp": {Params: []byte{I32, I32, I32}, Results: []byte{I32}}, // a, b, len -> <0/0/>0
+ "memchr": {Params: []byte{I32, I32, I32}, Results: []byte{I32}}, // s, c, len -> index
}
func assignAddress(ldr *loader.Loader, sect *sym.Section, n int, s loader.Sym, va uint64, isTramp bool) (*sym.Section, int, uint64) {