]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: pass frame size to defframe
authorJosh Bleecher Snyder <josharian@gmail.com>
Fri, 17 Mar 2017 15:55:40 +0000 (08:55 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Fri, 17 Mar 2017 23:56:22 +0000 (23:56 +0000)
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>
src/cmd/compile/internal/amd64/ggen.go
src/cmd/compile/internal/arm/ggen.go
src/cmd/compile/internal/arm64/ggen.go
src/cmd/compile/internal/gc/go.go
src/cmd/compile/internal/gc/ssa.go
src/cmd/compile/internal/mips/ggen.go
src/cmd/compile/internal/mips64/ggen.go
src/cmd/compile/internal/ppc64/ggen.go
src/cmd/compile/internal/s390x/ggen.go
src/cmd/compile/internal/x86/ggen.go

index 2d968069dc15fa94a9369931a4109f8e191a1694..0772bb4e370181632c009926a98b15ee706faec7 100644 (file)
@@ -13,12 +13,12 @@ import (
 // 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
index 4bf13fb8704a03118ed981031bc71da959a443f6..bf7ad5e44e74749bdc3379c499d9d2c857ce3e08 100644 (file)
@@ -10,12 +10,12 @@ import (
        "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
index 814bc35b631f7245fe99da6f0f91e32266b2d40a..d3b2fbd92d6e3b5c3cc058c964c2c6da8080bb31 100644 (file)
@@ -10,12 +10,12 @@ import (
        "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.
index d7372e7bedb239b0f4f4f918700682a26276f3f2..fe9411066a66c542ba1f30f737a669cf6c041307 100644 (file)
@@ -365,7 +365,7 @@ type Arch struct {
        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
 
index 921d897b046067cbd1159cb2668ad5c7960f431b..dc8eb02c211976c9d6cb7d506a0d3f62dcef8983 100644 (file)
@@ -4355,7 +4355,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)
+       thearch.Defframe(ptxt, e.curfn, Stksize+Maxarg)
        if Debug['f'] != 0 {
                frame(0)
        }
index 73a28d5f31554872e5c33ad73d8bbf9240a68ad0..5d818a67061262781e6646cbcb47a54f080dda68 100644 (file)
@@ -10,12 +10,12 @@ import (
        "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
index da900697c41226faf0e526dbb84d74976bb70e37..2784ca3a7ef0a38ba54c6c791f60494ad1ce0910 100644 (file)
@@ -10,12 +10,12 @@ import (
        "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
index b503f3214f55b225dcd4562750fd53b0a0bec270..5d72e3080b2365b6b8d9ee4d9475a7db367965eb 100644 (file)
@@ -10,12 +10,12 @@ import (
        "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
index 563ded103561d4c389e516aa7a5ff5e83463fdb7..6e23d4e1a446f7186f39f30d3b3bebc4290e9a93 100644 (file)
@@ -16,12 +16,12 @@ import (
 // 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
index 27a92eb36c125d2833708187b2d926a2c116e8e8..a45d41fda17d8bbc5ab788ffae24369ada138274 100644 (file)
@@ -10,12 +10,12 @@ import (
        "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