aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/internal/obj/arm64
diff options
context:
space:
mode:
authorMichael Munday <munday@ca.ibm.com>2017-03-28 15:10:20 -0400
committerMichael Munday <munday@ca.ibm.com>2017-03-29 20:35:46 +0000
commit41fd8d6401b6702b801678a493001ec9e08d6f2d (patch)
tree0d1c3b54af049135a376fbc5523ca14a3ea37891 /src/cmd/internal/obj/arm64
parentfbe6723903cc7ec06d0158d4909c6cb15c1ff977 (diff)
downloadgo-41fd8d6401b6702b801678a493001ec9e08d6f2d.tar.xz
cmd/internal/obj: make morestack cutoff the same on all architectures
There is always 128 bytes available below the stackguard. Allow functions with medium-sized stack frames to use this, potentially allowing them to avoid growing the stack. This change makes all architectures use the same calculation as x86. Change-Id: I2afb1a7c686ae5a933e50903b31ea4106e4cd0a0 Reviewed-on: https://go-review.googlesource.com/38734 Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/cmd/internal/obj/arm64')
-rw-r--r--src/cmd/internal/obj/arm64/obj7.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/internal/obj/arm64/obj7.go b/src/cmd/internal/obj/arm64/obj7.go
index 2d195b19de..020b6e05c1 100644
--- a/src/cmd/internal/obj/arm64/obj7.go
+++ b/src/cmd/internal/obj/arm64/obj7.go
@@ -82,13 +82,13 @@ func stacksplit(ctxt *obj.Link, p *obj.Prog, framesize int32) *obj.Prog {
p.Reg = REG_R2
} else if framesize <= obj.StackBig {
// large stack: SP-framesize < stackguard-StackSmall
- // SUB $framesize, SP, R2
+ // SUB $(framesize-StackSmall), SP, R2
// CMP stackguard, R2
p = obj.Appendp(ctxt, p)
p.As = ASUB
p.From.Type = obj.TYPE_CONST
- p.From.Offset = int64(framesize)
+ p.From.Offset = int64(framesize) - obj.StackSmall
p.Reg = REGSP
p.To.Type = obj.TYPE_REG
p.To.Reg = REG_R2