From b679665a182bd6ec2989ae759df6b11142921cfb Mon Sep 17 00:00:00 2001 From: Martin Möhrmann Date: Thu, 27 Oct 2016 23:31:38 +0200 Subject: cmd/compile: move stringtoslicebytetmp to the backend MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 Reviewed-by: Matthew Dempsky Reviewed-by: Josh Bleecher Snyder Run-TryBot: Martin Möhrmann TryBot-Result: Gobot Gobot --- src/runtime/string.go | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'src/runtime/string.go') 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. -- cgit v1.3-5-g9baa