Skip to content

Commit e0a5e69

Browse files
committed
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 <[email protected]> Reviewed-by: Matthew Dempsky <[email protected]>
1 parent 174b858 commit e0a5e69

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

src/cmd/compile/internal/gc/dcl.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1200,7 +1200,6 @@ func addmethod(msym *Sym, t *Type, local, nointerface bool) {
12001200

12011201
func funccompile(n *Node) {
12021202
Stksize = BADWIDTH
1203-
Maxarg = 0
12041203

12051204
if n.Type == nil {
12061205
if nerrors == 0 {

src/cmd/compile/internal/gc/go.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,6 @@ var dclcontext Class // PEXTERN/PAUTO
245245

246246
var statuniqgen int // name generator for static temps
247247

248-
var Maxarg int64
249-
250248
var Stksize int64 // stack size for current frame
251249

252250
var stkptrsize int64 // prefix of stack containing pointers

src/cmd/compile/internal/gc/init.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,6 @@ func fninit(n []*Node) {
9090
addvar(gatevar, Types[TUINT8], PEXTERN)
9191

9292
// (2)
93-
Maxarg = 0
94-
9593
fn := nod(ODCLFUNC, nil, nil)
9694
initsym := lookup("init")
9795
fn.Func.Nname = newname(initsym)

src/cmd/compile/internal/gc/ssa.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4204,6 +4204,8 @@ type SSAGenState struct {
42044204
SSEto387 map[int16]int16
42054205
// Some architectures require a 64-bit temporary for FP-related register shuffling. Examples include x86-387, PPC, and Sparc V8.
42064206
ScratchFpMem *Node
4207+
4208+
maxarg int64 // largest frame size for arguments to calls made by the function
42074209
}
42084210

42094211
// Pc returns the current Prog.
@@ -4355,7 +4357,7 @@ func genssa(f *ssa.Func, ptxt *obj.Prog, gcargs, gclocals *Sym) {
43554357
liveness(e.curfn, ptxt, gcargs, gclocals)
43564358

43574359
// Add frame prologue. Zero ambiguously live variables.
4358-
thearch.Defframe(ptxt, e.curfn, Stksize+Maxarg)
4360+
thearch.Defframe(ptxt, e.curfn, Stksize+s.maxarg)
43594361
if Debug['f'] != 0 {
43604362
frame(0)
43614363
}
@@ -4631,8 +4633,8 @@ func (s *SSAGenState) Call(v *ssa.Value) *obj.Prog {
46314633
}
46324634
p.To.Reg = v.Args[0].Reg()
46334635
}
4634-
if Maxarg < v.AuxInt {
4635-
Maxarg = v.AuxInt
4636+
if s.maxarg < v.AuxInt {
4637+
s.maxarg = v.AuxInt
46364638
}
46374639
return p
46384640
}

0 commit comments

Comments
 (0)