Skip to content

Commit

Permalink
cmd/compile: remove types.Sym.lsym
Browse files Browse the repository at this point in the history
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 <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Brad Fitzpatrick <[email protected]>
  • Loading branch information
josharian committed Apr 23, 2017
1 parent 90bd5ec commit d40bb73
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/cmd/compile/internal/types/sizeof_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
6 changes: 1 addition & 5 deletions src/cmd/compile/internal/types/sym.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ type Sym struct {
flags bitset8
Label *Node // corresponding label (ephemeral)
Origpkg *Pkg // original package for . import
lsym *obj.LSym
}

const (
Expand Down Expand Up @@ -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())
}

0 comments on commit d40bb73

Please sign in to comment.