]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: generate makeslice calls with int arguments
authorMartin Möhrmann <martisch@uos.de>
Thu, 25 Aug 2016 12:17:52 +0000 (14:17 +0200)
committerMartin Möhrmann <martisch@uos.de>
Mon, 29 Aug 2016 18:25:33 +0000 (18:25 +0000)
commite6f9f39ce52e880b54e4cb08bf0cde73cf6c7dc2
tree4b5c8de52c77c387944225e056c0890f3eaede52
parent595cebb055d327e52bd447985b53dcca869cea1d
cmd/compile: generate makeslice calls with int arguments

Where possible generate calls to runtime makeslice with int arguments
during compile time instead of makeslice with int64 arguments.

This eliminates converting arguments for calls to makeslice with
int64 arguments for platforms where int64 values do not fit into
arguments of type int.

godoc 386 binary shrinks by approximately 12 kilobyte.

amd64:
name         old time/op  new time/op  delta
MakeSlice-2  29.8ns ± 1%  29.8ns ± 1%   ~     (p=1.000 n=24+24)

386:
name         old time/op  new time/op  delta
MakeSlice-2  52.3ns ± 0%  45.9ns ± 0%  -12.17%  (p=0.000 n=25+22)

Fixes  #15357

Change-Id: Icb8701bb63c5a83877d26c8a4b78e782ba76de7c
Reviewed-on: https://go-review.googlesource.com/27851
Run-TryBot: Martin Möhrmann <martisch@uos.de>
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/walk.go
src/runtime/slice.go
test/fixedbugs/issue4085b.go