In the C calling convention, on AMD64, and probably a number of other architectures, a 3-word struct argument is passed on stack. This is less efficient than passing in three registers. Further, this may affect the code generation in other part of the program, even if the function is not actually called. Slices are common in Go and append is a common slice operation, which calls growslice in the growing path. To improve the code generation, pass the slice header's three fields as separate values, instead of a struct, to growslice. The drawback is that this makes the runtime implementation slightly diverges from the gc runtime. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/168277 From-SVN: r269811
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
config | Loading commit data... | |
go | Loading commit data... | |
misc/cgo | Loading commit data... | |
runtime | Loading commit data... | |
testsuite | Loading commit data... | |
LICENSE | Loading commit data... | |
MERGE | Loading commit data... | |
Makefile.am | Loading commit data... | |
Makefile.in | Loading commit data... | |
PATENTS | Loading commit data... | |
README | Loading commit data... | |
README.gcc | Loading commit data... | |
VERSION | Loading commit data... | |
aclocal.m4 | Loading commit data... | |
check-packages.txt | Loading commit data... | |
config.h.in | Loading commit data... | |
configure | Loading commit data... | |
configure.ac | Loading commit data... | |
goarch.sh | Loading commit data... | |
godeps.sh | Loading commit data... | |
gotool-packages.txt | Loading commit data... | |
libgo-packages.txt | Loading commit data... | |
libgo.imp | Loading commit data... | |
match.sh | Loading commit data... | |
merge.sh | Loading commit data... | |
mkrsysinfo.sh | Loading commit data... | |
mkruntimeinc.sh | Loading commit data... | |
mksigtab.sh | Loading commit data... | |
mksysinfo.sh | Loading commit data... | |
mvifdiff.sh | Loading commit data... | |
sysinfo.c | Loading commit data... |