aboutsummaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
authorMartin Möhrmann <martisch@uos.de>2016-10-27 23:31:38 +0200
committerMartin Möhrmann <martisch@uos.de>2016-10-28 07:58:47 +0000
commitb679665a182bd6ec2989ae759df6b11142921cfb (patch)
tree95a7d3f23fb430c9cdcfe803c4feb648c1253987 /src/runtime
parentf595848e9a1e1d0f64a7018d847167d85f6e83a4 (diff)
downloadgo-b679665a182bd6ec2989ae759df6b11142921cfb.tar.xz
cmd/compile: move stringtoslicebytetmp to the backend
- removes the runtime function stringtoslicebytetmp - removes the generation of calls to stringtoslicebytetmp from the frontend - adds handling of OSTRARRAYBYTETMP in the backend This reduces binary sizes and avoids function call overhead. Change-Id: Ib9988d48549cee663b685b4897a483f94727b940 Reviewed-on: https://go-review.googlesource.com/32158 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com> Run-TryBot: Martin Möhrmann <martisch@uos.de> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/string.go12
1 files changed, 0 insertions, 12 deletions
diff --git a/src/runtime/string.go b/src/runtime/string.go
index c7a9d27711..4cf165bb87 100644
--- a/src/runtime/string.go
+++ b/src/runtime/string.go
@@ -147,18 +147,6 @@ func stringtoslicebyte(buf *tmpBuf, s string) []byte {
return b
}
-func stringtoslicebytetmp(s string) []byte {
- // Return a slice referring to the actual string bytes.
- // This is only for use by internal compiler optimizations
- // that know that the slice won't be mutated.
- // The only such case today is:
- // for i, c := range []byte(str)
-
- str := stringStructOf(&s)
- ret := slice{array: str.str, len: str.len, cap: str.len}
- return *(*[]byte)(unsafe.Pointer(&ret))
-}
-
func stringtoslicerune(buf *[tmpStringBufSize]rune, s string) []rune {
// two passes.
// unlike slicerunetostring, no race because strings are immutable.