1
0
mirror of https://github.com/golang/go synced 2024-11-19 14:04:46 -07:00

cmd/internal/obj/arm64: omit stack check for no-frame leafs

For leaf functions with zero-sized frames, there's no point in doing a
stack check, so omit it.

This aligns arm64 with other architectures.

Change-Id: I1fb483d62f1736af10c5110815d3f5a875a46d7f
Reviewed-on: https://go-review.googlesource.com/92037
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
This commit is contained in:
Austin Clements 2018-01-25 13:31:03 -05:00
parent a7f73c436d
commit 495174302f

View File

@ -552,6 +552,13 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
c.cursym.Func.Text.Mark |= LEAF
}
if c.cursym.Func.Text.Mark&LEAF != 0 {
c.cursym.Set(obj.AttrLeaf, true)
if c.autosize == 0 {
break
}
}
if !p.From.Sym.NoSplit() {
p = c.stacksplit(p, c.autosize) // emit split check
}
@ -560,12 +567,6 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
if aoffset > 0xF0 {
aoffset = 0xF0
}
if c.cursym.Func.Text.Mark&LEAF != 0 {
c.cursym.Set(obj.AttrLeaf, true)
if c.autosize == 0 {
break
}
}
// Frame is non-empty. Make sure to save link register, even if
// it is a leaf function, so that traceback works.