]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: use named fields in nodl
authorJosh Bleecher Snyder <josharian@gmail.com>
Wed, 17 Apr 2019 18:37:54 +0000 (11:37 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Wed, 17 Apr 2019 20:52:24 +0000 (20:52 +0000)
commite92853523d11d1e50d89a3c017c5d902aed0596a
tree93add9bf41929c578d583998102109d9fab11c06
parent9dce58d30d1005e0cbac40789429cd3543d80836
cmd/compile: use named fields in nodl

We use a struct to allocate two structs simultaneously.
Because we embed structs rather than using named fields,
the compiler generates forwarding method stubs for the
anonymous type.

In theory, the compiler could detect that these stubs are unnecessary:
The value in question has a very limited scope, the methods are not
called, and there are operations where an interface would need
to be satisfied.

This compiler optimization is unlikely to happen, though;
the ROI is likely to be low.

Instead, just give the fields names. Cuts 64k off the cmd/compile binary.

Change-Id: Id10ec69c23cd2dd33306f4c1bc75724e3c571b56
Reviewed-on: https://go-review.googlesource.com/c/go/+/172579
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/cmd/compile/internal/gc/subr.go