mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: make Maxarg local
Passes toolstash -cmp. No compiler performance impact. Updates #15756 Change-Id: I1294058716d83dd1be495d399ed7ab2277754dc6 Reviewed-on: https://go-review.googlesource.com/38329 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
parent
174b858f78
commit
e0a5e69be2
4 changed files with 5 additions and 8 deletions
|
|
@ -1200,7 +1200,6 @@ func addmethod(msym *Sym, t *Type, local, nointerface bool) {
|
|||
|
||||
func funccompile(n *Node) {
|
||||
Stksize = BADWIDTH
|
||||
Maxarg = 0
|
||||
|
||||
if n.Type == nil {
|
||||
if nerrors == 0 {
|
||||
|
|
|
|||
|
|
@ -245,8 +245,6 @@ var dclcontext Class // PEXTERN/PAUTO
|
|||
|
||||
var statuniqgen int // name generator for static temps
|
||||
|
||||
var Maxarg int64
|
||||
|
||||
var Stksize int64 // stack size for current frame
|
||||
|
||||
var stkptrsize int64 // prefix of stack containing pointers
|
||||
|
|
|
|||
|
|
@ -90,8 +90,6 @@ func fninit(n []*Node) {
|
|||
addvar(gatevar, Types[TUINT8], PEXTERN)
|
||||
|
||||
// (2)
|
||||
Maxarg = 0
|
||||
|
||||
fn := nod(ODCLFUNC, nil, nil)
|
||||
initsym := lookup("init")
|
||||
fn.Func.Nname = newname(initsym)
|
||||
|
|
|
|||
|
|
@ -4204,6 +4204,8 @@ type SSAGenState struct {
|
|||
SSEto387 map[int16]int16
|
||||
// Some architectures require a 64-bit temporary for FP-related register shuffling. Examples include x86-387, PPC, and Sparc V8.
|
||||
ScratchFpMem *Node
|
||||
|
||||
maxarg int64 // largest frame size for arguments to calls made by the function
|
||||
}
|
||||
|
||||
// Pc returns the current Prog.
|
||||
|
|
@ -4355,7 +4357,7 @@ func genssa(f *ssa.Func, ptxt *obj.Prog, gcargs, gclocals *Sym) {
|
|||
liveness(e.curfn, ptxt, gcargs, gclocals)
|
||||
|
||||
// Add frame prologue. Zero ambiguously live variables.
|
||||
thearch.Defframe(ptxt, e.curfn, Stksize+Maxarg)
|
||||
thearch.Defframe(ptxt, e.curfn, Stksize+s.maxarg)
|
||||
if Debug['f'] != 0 {
|
||||
frame(0)
|
||||
}
|
||||
|
|
@ -4631,8 +4633,8 @@ func (s *SSAGenState) Call(v *ssa.Value) *obj.Prog {
|
|||
}
|
||||
p.To.Reg = v.Args[0].Reg()
|
||||
}
|
||||
if Maxarg < v.AuxInt {
|
||||
Maxarg = v.AuxInt
|
||||
if s.maxarg < v.AuxInt {
|
||||
s.maxarg = v.AuxInt
|
||||
}
|
||||
return p
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue