aboutsummaryrefslogtreecommitdiff
path: root/src/syscall/syscall_linux.go
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2022-07-13 20:22:53 -0700
committerKeith Randall <khr@golang.org>2022-09-01 21:28:35 +0000
commitdd323fe205b04da837e12aabf0bebfbe171aa7c2 (patch)
treedb2ec355eb308c06a40d74f445f468d3f7031de3 /src/syscall/syscall_linux.go
parent1e7f535475febc247c9e27249ee35e3a00dfa769 (diff)
downloadgo-dd323fe205b04da837e12aabf0bebfbe171aa7c2.tar.xz
cmd/compile,runtime: redo growslice calling convention
Instead of passing the original length and the new length, pass the new length and the length increment. Also use the new length in all the post-growslice calculations so that the original length is dead and does not need to be spilled/restored around the growslice. old: growslice(typ, oldPtr, oldLen, oldCap, newLen) (newPtr, newLen, newCap) new: growslice(oldPtr, newLen, oldCap, inc, typ) (newPtr, newLen, newCap) where inc = # of elements added = newLen-oldLen Also move the element type to the end of the call. This makes register allocation more efficient, as oldPtr and newPtr can often be in the same register (e.g. AX on amd64) and thus the phi takes no instructions. Makes the go binary 0.3% smaller. Change-Id: I7295a60227dbbeecec2bf039eeef2950a72df760 Reviewed-on: https://go-review.googlesource.com/c/go/+/418554 Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: Heschi Kreinick <heschi@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Diffstat (limited to 'src/syscall/syscall_linux.go')
0 files changed, 0 insertions, 0 deletions