Preparation for de-globalizing Stksize and MaxArg.
Passes toolstash -cmp. No compiler performance impact.
Updates #15756
Change-Id: I312f0bbd15587a6aebf472cd66c8e62b89e55c8a
Reviewed-on: https://go-review.googlesource.com/38328
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
// no floating point in note handlers on Plan 9
var isPlan9 = obj.GOOS == "plan9"
-func defframe(ptxt *obj.Prog, fn *gc.Node) {
+func defframe(ptxt *obj.Prog, fn *gc.Node, sz int64) {
// fill in argument size, stack size
ptxt.To.Type = obj.TYPE_TEXTSIZE
ptxt.To.Val = int32(gc.Rnd(fn.Type.ArgWidth(), int64(gc.Widthptr)))
- frame := uint32(gc.Rnd(gc.Stksize+gc.Maxarg, int64(gc.Widthreg)))
+ frame := uint32(gc.Rnd(sz, int64(gc.Widthreg)))
ptxt.To.Offset = int64(frame)
// insert code to zero ambiguously live variables
"cmd/internal/obj/arm"
)
-func defframe(ptxt *obj.Prog, fn *gc.Node) {
+func defframe(ptxt *obj.Prog, fn *gc.Node, sz int64) {
// fill in argument size, stack size
ptxt.To.Type = obj.TYPE_TEXTSIZE
ptxt.To.Val = int32(gc.Rnd(fn.Type.ArgWidth(), int64(gc.Widthptr)))
- frame := uint32(gc.Rnd(gc.Stksize+gc.Maxarg, int64(gc.Widthreg)))
+ frame := uint32(gc.Rnd(sz, int64(gc.Widthreg)))
ptxt.To.Offset = int64(frame)
// insert code to contain ambiguously live variables
"cmd/internal/obj/arm64"
)
-func defframe(ptxt *obj.Prog, fn *gc.Node) {
+func defframe(ptxt *obj.Prog, fn *gc.Node, sz int64) {
// fill in argument size, stack size
ptxt.To.Type = obj.TYPE_TEXTSIZE
ptxt.To.Val = int32(gc.Rnd(fn.Type.ArgWidth(), int64(gc.Widthptr)))
- frame := uint32(gc.Rnd(gc.Stksize+gc.Maxarg, int64(gc.Widthreg)))
+ frame := uint32(gc.Rnd(sz, int64(gc.Widthreg)))
// arm64 requires that the frame size (not counting saved LR)
// be empty or be 8 mod 16. If not, pad it.
MAXWIDTH int64
Use387 bool // should 386 backend use 387 FP instructions instead of sse2.
- Defframe func(*obj.Prog, *Node)
+ Defframe func(*obj.Prog, *Node, int64)
Ginsnop func()
Proginfo func(*obj.Prog) ProgInfo
liveness(e.curfn, ptxt, gcargs, gclocals)
// Add frame prologue. Zero ambiguously live variables.
- thearch.Defframe(ptxt, e.curfn)
+ thearch.Defframe(ptxt, e.curfn, Stksize+Maxarg)
if Debug['f'] != 0 {
frame(0)
}
"cmd/internal/obj/mips"
)
-func defframe(ptxt *obj.Prog, fn *gc.Node) {
+func defframe(ptxt *obj.Prog, fn *gc.Node, sz int64) {
// fill in argument size, stack size
ptxt.To.Type = obj.TYPE_TEXTSIZE
ptxt.To.Val = int32(gc.Rnd(fn.Type.ArgWidth(), int64(gc.Widthptr)))
- frame := uint32(gc.Rnd(gc.Stksize+gc.Maxarg, int64(gc.Widthreg)))
+ frame := uint32(gc.Rnd(sz, int64(gc.Widthreg)))
ptxt.To.Offset = int64(frame)
// insert code to zero ambiguously live variables
"cmd/internal/obj/mips"
)
-func defframe(ptxt *obj.Prog, fn *gc.Node) {
+func defframe(ptxt *obj.Prog, fn *gc.Node, sz int64) {
// fill in argument size, stack size
ptxt.To.Type = obj.TYPE_TEXTSIZE
ptxt.To.Val = int32(gc.Rnd(fn.Type.ArgWidth(), int64(gc.Widthptr)))
- frame := uint32(gc.Rnd(gc.Stksize+gc.Maxarg, int64(gc.Widthreg)))
+ frame := uint32(gc.Rnd(sz, int64(gc.Widthreg)))
ptxt.To.Offset = int64(frame)
// insert code to zero ambiguously live variables
"cmd/internal/obj/ppc64"
)
-func defframe(ptxt *obj.Prog, fn *gc.Node) {
+func defframe(ptxt *obj.Prog, fn *gc.Node, sz int64) {
// fill in argument size, stack size
ptxt.To.Type = obj.TYPE_TEXTSIZE
ptxt.To.Val = int32(gc.Rnd(fn.Type.ArgWidth(), int64(gc.Widthptr)))
- frame := uint32(gc.Rnd(gc.Stksize+gc.Maxarg, int64(gc.Widthreg)))
+ frame := uint32(gc.Rnd(sz, int64(gc.Widthreg)))
ptxt.To.Offset = int64(frame)
// insert code to zero ambiguously live variables
// Must be between 256 and 4096.
const clearLoopCutoff = 1024
-func defframe(ptxt *obj.Prog, fn *gc.Node) {
+func defframe(ptxt *obj.Prog, fn *gc.Node, sz int64) {
// fill in argument size, stack size
ptxt.To.Type = obj.TYPE_TEXTSIZE
ptxt.To.Val = int32(gc.Rnd(fn.Type.ArgWidth(), int64(gc.Widthptr)))
- frame := uint32(gc.Rnd(gc.Stksize+gc.Maxarg, int64(gc.Widthreg)))
+ frame := uint32(gc.Rnd(sz, int64(gc.Widthreg)))
ptxt.To.Offset = int64(frame)
// insert code to zero ambiguously live variables
"cmd/internal/obj/x86"
)
-func defframe(ptxt *obj.Prog, fn *gc.Node) {
+func defframe(ptxt *obj.Prog, fn *gc.Node, sz int64) {
// fill in argument size, stack size
ptxt.To.Type = obj.TYPE_TEXTSIZE
ptxt.To.Val = int32(gc.Rnd(fn.Type.ArgWidth(), int64(gc.Widthptr)))
- frame := uint32(gc.Rnd(gc.Stksize+gc.Maxarg, int64(gc.Widthreg)))
+ frame := uint32(gc.Rnd(sz, int64(gc.Widthreg)))
ptxt.To.Offset = int64(frame)
// insert code to zero ambiguously live variables