compiler: statically allocate constant interface data
When converting a constant to interface, such as interface{}(42)
or interface{}("hello"), if the interface escapes, we currently
generate a heap allocation to hold the constant value.
This CL changes it to generate a static allocation instead, as
the gc compiler does. This reduces allocations in such cases.
Change-Id: Ic53b202362917d1829f60f166ea50457e2fcb468
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/180277
Reviewed-by: Ian Lance Taylor <iant@golang.org>
1 file changed