cmd/internal/obj: move STEXT-only LSym fields into new FuncInfo struct

Shrinks LSym somewhat for non-STEXT LSyms, which are much more common.

While here, switch to tracking Automs in a slice instead of a linked
list. (Previously, this would have made LSyms larger.)

Passes toolstash-check.

Change-Id: I082e50e1d1f1b544c9e06b6e412a186be6a4a2b5
Reviewed-on: https://go-review.googlesource.com/37872
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
This commit is contained in:
Matthew Dempsky 2017-03-03 16:45:21 -08:00
parent 7a98bdf1c2
commit 9cb2ee0ff2
6 changed files with 44 additions and 36 deletions

View file

@ -326,15 +326,22 @@ type LSym struct {
Attribute
RefIdx int // Index of this symbol in the symbol reference list.
Args int32
Locals int32
Size int64
Gotype *LSym
Autom *Auto
Text *Prog
Pcln *Pcln
P []byte
R []Reloc
// TODO(mdempsky): De-anonymize field.
*FuncInfo
}
// A FuncInfo contains extra fields for STEXT symbols.
type FuncInfo struct {
Args int32
Locals int32
Text *Prog
Autom []*Auto
Pcln Pcln
}
// Attribute is a set of symbol attributes.
@ -691,7 +698,6 @@ func (r RelocType) IsDirectJump() bool {
type Auto struct {
Asym *LSym
Link *Auto
Aoffset int32
Name AddrName
Gotype *LSym