]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: move slice construction to callers of makeslice
authorMartin Möhrmann <moehrmann@google.com>
Sun, 14 Oct 2018 20:28:58 +0000 (22:28 +0200)
committerMartin Möhrmann <martisch@uos.de>
Mon, 29 Oct 2018 19:23:00 +0000 (19:23 +0000)
commit020a18c545bf49ffc087ca93cd238195d8dcc411
tree0d9aba99dc40be4eb38f00a7a2a8c6cef93cee8f
parentc86d4647348b420f55d4ce7572c4cd93b20a1d4a
cmd/compile: move slice construction to callers of makeslice

Only return a pointer p to the new slices backing array from makeslice.
Makeslice callers then construct sliceheader{p, len, cap} explictly
instead of makeslice returning the slice.

Reduces go binary size by ~0.2%.
Removes 92 (~3.5%) panicindex calls from go binary.

Change-Id: I29b7c3b5fe8b9dcec96e2c43730575071cfe8a94
Reviewed-on: https://go-review.googlesource.com/c/141822
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
src/cmd/compile/internal/gc/builtin.go
src/cmd/compile/internal/gc/builtin/runtime.go
src/cmd/compile/internal/gc/op_string.go
src/cmd/compile/internal/gc/ssa.go
src/cmd/compile/internal/gc/syntax.go
src/cmd/compile/internal/gc/typecheck.go
src/cmd/compile/internal/gc/walk.go
src/runtime/runtime-gdb_test.go
src/runtime/slice.go