aoffset = 0
autosize = int32(textstksiz)
- if p.Mark&LEAF != 0 && autosize == 0 && p.From3.Offset&obj.NOFRAME == 0 {
+ if p.Mark&LEAF != 0 && autosize == 0 {
// A leaf function with no locals has no frame.
p.From3.Offset |= obj.NOFRAME
}
autosize += int32(ctxt.FixedFrameSize())
}
+ if p.Mark&LEAF != 0 && autosize < obj.StackSmall {
+ // A leaf function with a small stack can be marked
+ // NOSPLIT, avoiding a stack check.
+ p.From3.Offset |= obj.NOSPLIT
+ }
+
p.To.Offset = int64(autosize)
q = p
case obj.ATEXT:
autosize = int32(textstksiz)
- if p.Mark&LEAF != 0 && autosize == 0 && p.From3.Offset&obj.NOFRAME == 0 {
+ if p.Mark&LEAF != 0 && autosize == 0 {
// A leaf function with no locals has no frame.
p.From3.Offset |= obj.NOFRAME
}
autosize += int32(ctxt.FixedFrameSize())
}
+ if p.Mark&LEAF != 0 && autosize < obj.StackSmall {
+ // A leaf function with a small stack can be marked
+ // NOSPLIT, avoiding a stack check.
+ p.From3.Offset |= obj.NOSPLIT
+ }
+
p.To.Offset = int64(autosize)
q = p
- if p.From3.Offset&obj.NOSPLIT == 0 && p.From3.Offset&obj.NOFRAME == 0 {
+ if p.From3.Offset&obj.NOSPLIT == 0 {
p, pPreempt = stacksplitPre(ctxt, p, autosize) // emit pre part of split check
pPre = p
wasSplit = true //need post part of split