]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/internal/gc: extend escape analysis to pointers in slices
authorDavid Chase <drchase@google.com>
Fri, 15 May 2015 16:19:07 +0000 (12:19 -0400)
committerDavid Chase <drchase@google.com>
Mon, 18 May 2015 15:34:39 +0000 (15:34 +0000)
commita21cf5b6a281df2c3506105cecfbeeda70afca1c
tree0f47567dddaaca8cbbf060a99eaa24c519fd5117
parentf0dd002895b48595f6c14f2bf606775289f59d5f
cmd/internal/gc: extend escape analysis to pointers in slices

Modified esc.go to allow slice literals (before append)
to be non-escaping.  Modified tests to account for changes
in escape behavior and to also test the two cases that
were previously not tested.

Also minor cleanups to debug-printing within esc.go

Allocation stats for running compiler
( cd src/html/template;
  for i in {1..5} ; do
     go tool 6g -memprofile=testzz.${i}.prof  -memprofilerate=1 *.go ;
     go tool pprof -alloc_objects -text  testzz.${i}.prof ;
     done ; )
before about 86k allocations
after  about 83k allocations

Fixes #8972

Change-Id: Ib61dd70dc74adb40d6f6fdda6eaa4bf7d83481de
Reviewed-on: https://go-review.googlesource.com/10118
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/internal/gc/esc.go
test/escape2.go
test/escape2n.go
test/escape_slice.go