]> Cypherpunks repositories - gostls13.git/commit
cmd/compile,runtime: pass only ptr and len to some runtime calls
authorJosh Bleecher Snyder <josharian@gmail.com>
Sat, 1 Feb 2020 05:01:55 +0000 (21:01 -0800)
committerJosh Bleecher Snyder <josharian@gmail.com>
Wed, 8 Apr 2020 22:19:53 +0000 (22:19 +0000)
commitb6feb03b24a75164438c3419c0bc01fef62825a0
treefca94723ac770660d74137f13b825ebad914449d
parentade0811dc8b7a57091019e148c094c4da9689184
cmd/compile,runtime: pass only ptr and len to some runtime calls

Some runtime calls accept a slice, but only use ptr and len.
This change modifies most such routines to accept only ptr and len.

After this change, the only runtime calls that accept an unnecessary
cap arg are concatstrings and slicerunetostring.
Neither is particularly common, and both are complicated to modify.

Negligible compiler performance impact. Shrinks binaries a little.
There are only a few regressions; the one I investigated was
due to register allocation fluctuation.

Passes 'go test -race std cmd', modulo #38265 and #38266.
Wow, does that take a long time to run.

Updates #36890

file      before    after     Δ       %
compile   19655024  19655152  +128    +0.001%
cover     5244840   5236648   -8192   -0.156%
dist      3662376   3658280   -4096   -0.112%
link      6680056   6675960   -4096   -0.061%
pprof     14789844  14777556  -12288  -0.083%
test2json 2824744   2820648   -4096   -0.145%
trace     11647876  11639684  -8192   -0.070%
vet       8260472   8256376   -4096   -0.050%
total     115163736 115118808 -44928  -0.039%

Change-Id: Idb29fa6a81d6a82bfd3b65740b98cf3275ca0a78
Reviewed-on: https://go-review.googlesource.com/c/go/+/227163
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/gc/builtin.go
src/cmd/compile/internal/gc/builtin/runtime.go
src/cmd/compile/internal/gc/ssa.go
src/cmd/compile/internal/gc/subr.go
src/cmd/compile/internal/gc/walk.go
src/runtime/cgocheck.go
src/runtime/mbarrier.go
src/runtime/os_linux.go
src/runtime/slice.go
src/runtime/string.go