Commit 49517430 authored by Austin Clements's avatar Austin Clements

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: 's avatarCherry Zhang <cherryyz@google.com>
parent a7f73c43
......@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment