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.

Change-Id: I068a5cc83f938d3fa936b8fa5a064aaa0a42d9d1
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/182539
Reviewed-by: Ian Lance Taylor <iant@golang.org>
3 files changed