This is the mail archive of the
gcc-cvs@gcc.gnu.org
mailing list for the GCC project.
r272476 - in /trunk: gcc/go/gofrontend/MERGE gc...
- From: ian at gcc dot gnu dot org
- To: gcc-cvs at gcc dot gnu dot org
- Date: Wed, 19 Jun 2019 15:13:53 -0000
- Subject: r272476 - in /trunk: gcc/go/gofrontend/MERGE gc...
Author: ian
Date: Wed Jun 19 15:13:53 2019
New Revision: 272476
URL: https://gcc.gnu.org/viewcvs?rev=272476&root=gcc&view=rev
Log:
compiler: optimize string concatenations
runtime.concatstring{2,3,4,5} are just wrappers of concatstrings.
These wrappers don't provide any benefit, at least in the C
calling convention we use, where passing arrays by value isn't an
efficient thing. Change it to always use concatstrings.
Also, the cap field of the slice passed to concatstrings is not
necessary. So change it to pass a pointer and a length directly,
which is more efficient than passing a slice header by value.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/182539
Modified:
trunk/gcc/go/gofrontend/MERGE
trunk/gcc/go/gofrontend/expressions.cc
trunk/gcc/go/gofrontend/runtime.def
trunk/libgo/go/runtime/string.go