1
0
mirror of https://github.com/golang/go synced 2024-11-05 17:26:11 -07:00

cmd/compile: remove types.Sym.lsym

It was just a cache, and the CL series yesterday
removed 40% of the calls to types.Linksym in make.bash.

Testing atop CL 40693 (backend concurrency)
indicates that removing it is actually a very minor
performance improvement.

Passes toolstash-check.

Change-Id: I97c2973036964acdd11b3cb842bc31f33ae60389
Reviewed-on: https://go-review.googlesource.com/41492
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Josh Bleecher Snyder 2017-04-22 17:35:28 -07:00
parent 90bd5eccb9
commit d40bb738ff
2 changed files with 2 additions and 6 deletions

View File

@ -22,7 +22,7 @@ func TestSizeof(t *testing.T) {
_32bit uintptr // size on 32bit platforms
_64bit uintptr // size on 64bit platforms
}{
{Sym{}, 56, 96},
{Sym{}, 52, 88},
{Type{}, 52, 88},
{Map{}, 20, 40},
{Forward{}, 20, 32},

View File

@ -31,7 +31,6 @@ type Sym struct {
flags bitset8
Label *Node // corresponding label (ephemeral)
Origpkg *Pkg // original package for . import
lsym *obj.LSym
}
const (
@ -78,8 +77,5 @@ func (sym *Sym) Linksym() *obj.LSym {
if sym == nil {
return nil
}
if sym.lsym == nil {
sym.lsym = Ctxt.Lookup(sym.LinksymName())
}
return sym.lsym
return Ctxt.Lookup(sym.LinksymName())
}