Commit e0a5e69b authored by Josh Bleecher Snyder's avatar Josh Bleecher Snyder

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: default avatarMatthew Dempsky <mdempsky@google.com>
parent 174b858f
...@@ -1200,7 +1200,6 @@ func addmethod(msym *Sym, t *Type, local, nointerface bool) { ...@@ -1200,7 +1200,6 @@ func addmethod(msym *Sym, t *Type, local, nointerface bool) {
func funccompile(n *Node) { func funccompile(n *Node) {
Stksize = BADWIDTH Stksize = BADWIDTH
Maxarg = 0
if n.Type == nil { if n.Type == nil {
if nerrors == 0 { if nerrors == 0 {
......
...@@ -245,8 +245,6 @@ var dclcontext Class // PEXTERN/PAUTO ...@@ -245,8 +245,6 @@ var dclcontext Class // PEXTERN/PAUTO
var statuniqgen int // name generator for static temps var statuniqgen int // name generator for static temps
var Maxarg int64
var Stksize int64 // stack size for current frame var Stksize int64 // stack size for current frame
var stkptrsize int64 // prefix of stack containing pointers var stkptrsize int64 // prefix of stack containing pointers
......
...@@ -90,8 +90,6 @@ func fninit(n []*Node) { ...@@ -90,8 +90,6 @@ func fninit(n []*Node) {
addvar(gatevar, Types[TUINT8], PEXTERN) addvar(gatevar, Types[TUINT8], PEXTERN)
// (2) // (2)
Maxarg = 0
fn := nod(ODCLFUNC, nil, nil) fn := nod(ODCLFUNC, nil, nil)
initsym := lookup("init") initsym := lookup("init")
fn.Func.Nname = newname(initsym) fn.Func.Nname = newname(initsym)
......
...@@ -4204,6 +4204,8 @@ type SSAGenState struct { ...@@ -4204,6 +4204,8 @@ type SSAGenState struct {
SSEto387 map[int16]int16 SSEto387 map[int16]int16
// Some architectures require a 64-bit temporary for FP-related register shuffling. Examples include x86-387, PPC, and Sparc V8. // Some architectures require a 64-bit temporary for FP-related register shuffling. Examples include x86-387, PPC, and Sparc V8.
ScratchFpMem *Node ScratchFpMem *Node
maxarg int64 // largest frame size for arguments to calls made by the function
} }
// Pc returns the current Prog. // Pc returns the current Prog.
...@@ -4355,7 +4357,7 @@ func genssa(f *ssa.Func, ptxt *obj.Prog, gcargs, gclocals *Sym) { ...@@ -4355,7 +4357,7 @@ func genssa(f *ssa.Func, ptxt *obj.Prog, gcargs, gclocals *Sym) {
liveness(e.curfn, ptxt, gcargs, gclocals) liveness(e.curfn, ptxt, gcargs, gclocals)
// Add frame prologue. Zero ambiguously live variables. // 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 { if Debug['f'] != 0 {
frame(0) frame(0)
} }
...@@ -4631,8 +4633,8 @@ func (s *SSAGenState) Call(v *ssa.Value) *obj.Prog { ...@@ -4631,8 +4633,8 @@ func (s *SSAGenState) Call(v *ssa.Value) *obj.Prog {
} }
p.To.Reg = v.Args[0].Reg() p.To.Reg = v.Args[0].Reg()
} }
if Maxarg < v.AuxInt { if s.maxarg < v.AuxInt {
Maxarg = v.AuxInt s.maxarg = v.AuxInt
} }
return p return p
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment