]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: improve static map initialization
authorKeith Randall <khr@golang.org>
Mon, 25 Sep 2017 17:28:20 +0000 (10:28 -0700)
committerKeith Randall <khr@golang.org>
Mon, 25 Sep 2017 18:50:41 +0000 (18:50 +0000)
commit91cb9edd5e4d203c6f82332acdac73beb9936283
tree0ed996e482d3538e874f89a6dcc509364fba5fc4
parentc82ee79247e8e82a0699963e5b07ca7db8de5d51
cmd/compile: improve static map initialization

When static maps are large, we try to initialize them
by iterating over an array of key/value pairs.

Currently this optimization only works if the keys and values
are of primitive type.  This CL improves this optimization
by allowing any static composite literals as well.

Fixes #22010

Change-Id: Ie493e02ab8b8a228a3472b5c6025a33f7b92daf3
Reviewed-on: https://go-review.googlesource.com/66050
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/cmd/compile/internal/gc/sinit.go