internal/abi, runtime, cmd: merge StackSmall, StackBig consts into internal/abi

For #59670.

Change-Id: I91448363be2fc678964ce119d85cd5fae34a14da
Reviewed-on: https://go-review.googlesource.com/c/go/+/486975
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Austin Clements <austin@google.com>
Auto-Submit: Austin Clements <austin@google.com>
This commit is contained in:
Austin Clements 2023-04-19 13:21:02 -04:00 committed by Gopher Robot
parent 7843ca83e7
commit 03ad1f1a34
12 changed files with 66 additions and 53 deletions

View file

@ -31,7 +31,6 @@ package mips
import (
"cmd/internal/obj"
"cmd/internal/objabi"
"cmd/internal/sys"
"encoding/binary"
"fmt"
@ -775,7 +774,7 @@ func (c *ctxt0) stacksplit(p *obj.Prog, framesize int32) *obj.Prog {
p = c.ctxt.StartUnsafePoint(p, c.newprog)
var q *obj.Prog
if framesize <= objabi.StackSmall {
if framesize <= abi.StackSmall {
// small stack: SP < stackguard
// AGTU SP, stackguard, R1
p = obj.Appendp(p, c.newprog)
@ -788,8 +787,8 @@ func (c *ctxt0) stacksplit(p *obj.Prog, framesize int32) *obj.Prog {
p.To.Reg = REG_R1
} else {
// large stack: SP-framesize < stackguard-StackSmall
offset := int64(framesize) - objabi.StackSmall
if framesize > objabi.StackBig {
offset := int64(framesize) - abi.StackSmall
if framesize > abi.StackBig {
// Such a large stack we need to protect against underflow.
// The runtime guarantees SP > objabi.StackBig, but
// framesize is large enough that SP-framesize may