]> Cypherpunks.ru repositories - gostls13.git/commitdiff
cmd/compile,cmd/internal/obj: replace Ctxt.FixedFrameSize method with Arch field
authorAustin Clements <austin@google.com>
Mon, 18 Apr 2022 17:41:08 +0000 (13:41 -0400)
committerAustin Clements <austin@google.com>
Tue, 19 Apr 2022 15:59:22 +0000 (15:59 +0000)
And delete now-unused FixedFrameSize methods.

Change-Id: Id257e1647dbeb4eb4ab866c53744010c4efeb953
Reviewed-on: https://go-review.googlesource.com/c/go/+/400819
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

31 files changed:
src/cmd/compile/internal/abi/abiutils.go
src/cmd/compile/internal/amd64/ssa.go
src/cmd/compile/internal/arm/ssa.go
src/cmd/compile/internal/arm64/ssa.go
src/cmd/compile/internal/dwarfgen/dwarf.go
src/cmd/compile/internal/escape/desugar.go
src/cmd/compile/internal/mips/ggen.go
src/cmd/compile/internal/mips/ssa.go
src/cmd/compile/internal/mips64/ssa.go
src/cmd/compile/internal/ppc64/ggen.go
src/cmd/compile/internal/ppc64/ssa.go
src/cmd/compile/internal/riscv64/ggen.go
src/cmd/compile/internal/riscv64/ssa.go
src/cmd/compile/internal/s390x/ggen.go
src/cmd/compile/internal/s390x/ssa.go
src/cmd/compile/internal/ssa/config.go
src/cmd/compile/internal/ssa/expand_calls.go
src/cmd/compile/internal/ssa/writebarrier.go
src/cmd/compile/internal/ssagen/pgen.go
src/cmd/compile/internal/ssagen/ssa.go
src/cmd/compile/internal/x86/ssa.go
src/cmd/internal/obj/link.go
src/cmd/internal/obj/mips/asm0.go
src/cmd/internal/obj/mips/obj0.go
src/cmd/internal/obj/ppc64/asm9.go
src/cmd/internal/obj/ppc64/obj9.go
src/cmd/internal/obj/riscv/obj.go
src/cmd/internal/obj/s390x/asmz.go
src/cmd/internal/obj/s390x/objz.go
src/cmd/link/internal/ld/lib.go
src/cmd/link/internal/ld/link.go

index 07ece87c411f1cc19879f74236f0a95467eff05b..aa5063f741d615ddde50946458d76d827aaec9a7 100644 (file)
@@ -258,7 +258,7 @@ type RegAmounts struct {
 // by the ABI rules for parameter passing and result returning.
 type ABIConfig struct {
        // Do we need anything more than this?
-       offsetForLocals  int64 // e.g., obj.(*Link).FixedFrameSize() -- extra linkage information on some architectures.
+       offsetForLocals  int64 // e.g., obj.(*Link).Arch.FixedFrameSize -- extra linkage information on some architectures.
        regAmounts       RegAmounts
        regsForTypeCache map[*types.Type]int
 }
index 7049d4e163befb42470e146171a33ba498230646..c9667bd04ae7c8d4a9d3ebbb589daeaa122b8c8c 100644 (file)
@@ -1100,7 +1100,7 @@ func ssaGenValue(s *ssagen.State, v *ssa.Value) {
                }
                p := s.Prog(mov)
                p.From.Type = obj.TYPE_ADDR
-               p.From.Offset = -base.Ctxt.FixedFrameSize() // 0 on amd64, just to be consistent with other architectures
+               p.From.Offset = -base.Ctxt.Arch.FixedFrameSize // 0 on amd64, just to be consistent with other architectures
                p.From.Name = obj.NAME_PARAM
                p.To.Type = obj.TYPE_REG
                p.To.Reg = v.Reg()
index 063fb65b33ab90bf7e56f5f681a1a32ec959487e..a53f51bd1373bb320d635db02ed8e1771b367c2c 100644 (file)
@@ -854,7 +854,7 @@ func ssaGenValue(s *ssagen.State, v *ssa.Value) {
                // caller's SP is FixedFrameSize below the address of the first arg
                p := s.Prog(arm.AMOVW)
                p.From.Type = obj.TYPE_ADDR
-               p.From.Offset = -base.Ctxt.FixedFrameSize()
+               p.From.Offset = -base.Ctxt.Arch.FixedFrameSize
                p.From.Name = obj.NAME_PARAM
                p.To.Type = obj.TYPE_REG
                p.To.Reg = v.Reg()
index 48eb2190b2572141691cbd274c789b02f62697cd..3b6e6f672309d3d67a8c3289ed7e4debe305de4c 100644 (file)
@@ -171,7 +171,7 @@ func ssaGenValue(s *ssagen.State, v *ssa.Value) {
                for _, a := range v.Block.Func.RegArgs {
                        // Pass the spill/unspill information along to the assembler, offset by size of
                        // the saved LR slot.
-                       addr := ssagen.SpillSlotAddr(a, arm64.REGSP, base.Ctxt.FixedFrameSize())
+                       addr := ssagen.SpillSlotAddr(a, arm64.REGSP, base.Ctxt.Arch.FixedFrameSize)
                        s.FuncInfo().AddSpill(
                                obj.RegSpill{Reg: a.Reg, Addr: addr, Unspill: loadByType(a.Type), Spill: storeByType(a.Type)})
                }
@@ -1128,7 +1128,7 @@ func ssaGenValue(s *ssagen.State, v *ssa.Value) {
                // caller's SP is FixedFrameSize below the address of the first arg
                p := s.Prog(arm64.AMOVD)
                p.From.Type = obj.TYPE_ADDR
-               p.From.Offset = -base.Ctxt.FixedFrameSize()
+               p.From.Offset = -base.Ctxt.Arch.FixedFrameSize
                p.From.Name = obj.NAME_PARAM
                p.To.Type = obj.TYPE_REG
                p.To.Reg = v.Reg()
index ba73976504e1654d05e028e5d50783dc235281d5..f84368ece3421154914806b1aa3484687e3602ed 100644 (file)
@@ -339,7 +339,7 @@ func createSimpleVar(fnsym *obj.LSym, n *ir.Name) *dwarf.Var {
 
        localAutoOffset := func() int64 {
                offs = n.FrameOffset()
-               if base.Ctxt.FixedFrameSize() == 0 {
+               if base.Ctxt.Arch.FixedFrameSize == 0 {
                        offs -= int64(types.PtrSize)
                }
                if buildcfg.FramePointerEnabled {
@@ -357,7 +357,7 @@ func createSimpleVar(fnsym *obj.LSym, n *ir.Name) *dwarf.Var {
                if n.IsOutputParamInRegisters() {
                        offs = localAutoOffset()
                } else {
-                       offs = n.FrameOffset() + base.Ctxt.FixedFrameSize()
+                       offs = n.FrameOffset() + base.Ctxt.Arch.FixedFrameSize
                }
 
        default:
index 8b3cc25cf9a4a684810107e1124546d6e9b3b187..6c21981acad09a0feae68b9b49388479f68c7e50 100644 (file)
@@ -24,9 +24,9 @@ func fixRecoverCall(call *ir.CallExpr) {
 
        pos := call.Pos()
 
-       // FP is equal to caller's SP plus FixedFrameSize().
+       // FP is equal to caller's SP plus FixedFrameSize.
        var fp ir.Node = ir.NewCallExpr(pos, ir.OGETCALLERSP, nil, nil)
-       if off := base.Ctxt.FixedFrameSize(); off != 0 {
+       if off := base.Ctxt.Arch.FixedFrameSize; off != 0 {
                fp = ir.NewBinaryExpr(fp.Pos(), ir.OADD, fp, ir.NewInt(off))
        }
        // TODO(mdempsky): Replace *int32 with unsafe.Pointer, without upsetting checkptr.
index 1a5125207dd0ea3b2fd10f582f1f81ba5e80f813..a18440e7b3c405aacb82e3efc7fd440d1978d2d7 100644 (file)
@@ -20,7 +20,7 @@ func zerorange(pp *objw.Progs, p *obj.Prog, off, cnt int64, _ *uint32) *obj.Prog
        }
        if cnt < int64(4*types.PtrSize) {
                for i := int64(0); i < cnt; i += int64(types.PtrSize) {
-                       p = pp.Append(p, mips.AMOVW, obj.TYPE_REG, mips.REGZERO, 0, obj.TYPE_MEM, mips.REGSP, base.Ctxt.FixedFrameSize()+off+i)
+                       p = pp.Append(p, mips.AMOVW, obj.TYPE_REG, mips.REGZERO, 0, obj.TYPE_MEM, mips.REGSP, base.Ctxt.Arch.FixedFrameSize+off+i)
                }
        } else {
                //fmt.Printf("zerorange frame:%v, lo: %v, hi:%v \n", frame ,lo, hi)
@@ -30,7 +30,7 @@ func zerorange(pp *objw.Progs, p *obj.Prog, off, cnt int64, _ *uint32) *obj.Prog
                //      MOVW    R0, (Widthptr)r1
                //      ADD     $Widthptr, r1
                //      BNE             r1, r2, loop
-               p = pp.Append(p, mips.AADD, obj.TYPE_CONST, 0, base.Ctxt.FixedFrameSize()+off-4, obj.TYPE_REG, mips.REGRT1, 0)
+               p = pp.Append(p, mips.AADD, obj.TYPE_CONST, 0, base.Ctxt.Arch.FixedFrameSize+off-4, obj.TYPE_REG, mips.REGRT1, 0)
                p.Reg = mips.REGSP
                p = pp.Append(p, mips.AADD, obj.TYPE_CONST, 0, cnt, obj.TYPE_REG, mips.REGRT2, 0)
                p.Reg = mips.REGRT1
index 6326f966bf2158807d6bdab361a19393c884f831..0411756c8d71c66a211a98684e72946dd10064b2 100644 (file)
@@ -792,7 +792,7 @@ func ssaGenValue(s *ssagen.State, v *ssa.Value) {
                // caller's SP is FixedFrameSize below the address of the first arg
                p := s.Prog(mips.AMOVW)
                p.From.Type = obj.TYPE_ADDR
-               p.From.Offset = -base.Ctxt.FixedFrameSize()
+               p.From.Offset = -base.Ctxt.Arch.FixedFrameSize
                p.From.Name = obj.NAME_PARAM
                p.To.Type = obj.TYPE_REG
                p.To.Reg = v.Reg()
index 6e12c6cb942d6873d61f43aeba4efed0f20183cd..f3e372c3bcb8f42b2f63bba101a19397c0daa82f 100644 (file)
@@ -762,7 +762,7 @@ func ssaGenValue(s *ssagen.State, v *ssa.Value) {
                // caller's SP is FixedFrameSize below the address of the first arg
                p := s.Prog(mips.AMOVV)
                p.From.Type = obj.TYPE_ADDR
-               p.From.Offset = -base.Ctxt.FixedFrameSize()
+               p.From.Offset = -base.Ctxt.Arch.FixedFrameSize
                p.From.Name = obj.NAME_PARAM
                p.To.Type = obj.TYPE_REG
                p.To.Reg = v.Reg()
index 7877be3336b43a2b27ad3cb2c4a8957153e45c7f..4c935cfc71f8d36b7c3b13b0041d9f624e930ecb 100644 (file)
@@ -19,17 +19,17 @@ func zerorange(pp *objw.Progs, p *obj.Prog, off, cnt int64, _ *uint32) *obj.Prog
        }
        if cnt < int64(4*types.PtrSize) {
                for i := int64(0); i < cnt; i += int64(types.PtrSize) {
-                       p = pp.Append(p, ppc64.AMOVD, obj.TYPE_REG, ppc64.REGZERO, 0, obj.TYPE_MEM, ppc64.REGSP, base.Ctxt.FixedFrameSize()+off+i)
+                       p = pp.Append(p, ppc64.AMOVD, obj.TYPE_REG, ppc64.REGZERO, 0, obj.TYPE_MEM, ppc64.REGSP, base.Ctxt.Arch.FixedFrameSize+off+i)
                }
        } else if cnt <= int64(128*types.PtrSize) {
-               p = pp.Append(p, ppc64.AADD, obj.TYPE_CONST, 0, base.Ctxt.FixedFrameSize()+off-8, obj.TYPE_REG, ppc64.REGRT1, 0)
+               p = pp.Append(p, ppc64.AADD, obj.TYPE_CONST, 0, base.Ctxt.Arch.FixedFrameSize+off-8, obj.TYPE_REG, ppc64.REGRT1, 0)
                p.Reg = ppc64.REGSP
                p = pp.Append(p, obj.ADUFFZERO, obj.TYPE_NONE, 0, 0, obj.TYPE_MEM, 0, 0)
                p.To.Name = obj.NAME_EXTERN
                p.To.Sym = ir.Syms.Duffzero
                p.To.Offset = 4 * (128 - cnt/int64(types.PtrSize))
        } else {
-               p = pp.Append(p, ppc64.AMOVD, obj.TYPE_CONST, 0, base.Ctxt.FixedFrameSize()+off-8, obj.TYPE_REG, ppc64.REGTMP, 0)
+               p = pp.Append(p, ppc64.AMOVD, obj.TYPE_CONST, 0, base.Ctxt.Arch.FixedFrameSize+off-8, obj.TYPE_REG, ppc64.REGTMP, 0)
                p = pp.Append(p, ppc64.AADD, obj.TYPE_REG, ppc64.REGTMP, 0, obj.TYPE_REG, ppc64.REGRT1, 0)
                p.Reg = ppc64.REGSP
                p = pp.Append(p, ppc64.AMOVD, obj.TYPE_CONST, 0, cnt, obj.TYPE_REG, ppc64.REGTMP, 0)
index da74cacd95f275bd6f671dab7ae9f26c4c7885d8..8689bd8b27ea3c09ac060971232e9e60d7bc9cdf 100644 (file)
@@ -476,7 +476,7 @@ func ssaGenValue(s *ssagen.State, v *ssa.Value) {
                // caller's SP is FixedFrameSize below the address of the first arg
                p := s.Prog(ppc64.AMOVD)
                p.From.Type = obj.TYPE_ADDR
-               p.From.Offset = -base.Ctxt.FixedFrameSize()
+               p.From.Offset = -base.Ctxt.Arch.FixedFrameSize
                p.From.Name = obj.NAME_PARAM
                p.To.Type = obj.TYPE_REG
                p.To.Reg = v.Reg()
@@ -509,7 +509,7 @@ func ssaGenValue(s *ssagen.State, v *ssa.Value) {
                for _, a := range v.Block.Func.RegArgs {
                        // Pass the spill/unspill information along to the assembler, offset by size of
                        // the saved LR slot.
-                       addr := ssagen.SpillSlotAddr(a, ppc64.REGSP, base.Ctxt.FixedFrameSize())
+                       addr := ssagen.SpillSlotAddr(a, ppc64.REGSP, base.Ctxt.Arch.FixedFrameSize)
                        s.FuncInfo().AddSpill(
                                obj.RegSpill{Reg: a.Reg, Addr: addr, Unspill: loadByType(a.Type), Spill: storeByType(a.Type)})
                }
index 0f37f65fcf306e01c754e4b0fe4907770e1220e1..44488e43276bc24a5dece2337f8f93ecdfc9ae25 100644 (file)
@@ -19,7 +19,7 @@ func zeroRange(pp *objw.Progs, p *obj.Prog, off, cnt int64, _ *uint32) *obj.Prog
        }
 
        // Adjust the frame to account for LR.
-       off += base.Ctxt.FixedFrameSize()
+       off += base.Ctxt.Arch.FixedFrameSize
 
        if cnt < int64(4*types.PtrSize) {
                for i := int64(0); i < cnt; i += int64(types.PtrSize) {
index b6e6dc1a03d3bcf79667cb39f055e79b19fd2b06..5f74fd876cf6ccecbb31e5fd3af19310c629dcac 100644 (file)
@@ -237,7 +237,7 @@ func ssaGenValue(s *ssagen.State, v *ssa.Value) {
                for _, a := range v.Block.Func.RegArgs {
                        // Pass the spill/unspill information along to the assembler, offset by size of
                        // the saved LR slot.
-                       addr := ssagen.SpillSlotAddr(a, riscv.REG_SP, base.Ctxt.FixedFrameSize())
+                       addr := ssagen.SpillSlotAddr(a, riscv.REG_SP, base.Ctxt.Arch.FixedFrameSize)
                        s.FuncInfo().AddSpill(
                                obj.RegSpill{Reg: a.Reg, Addr: addr, Unspill: loadByType(a.Type), Spill: storeByType(a.Type)})
                }
@@ -669,7 +669,7 @@ func ssaGenValue(s *ssagen.State, v *ssa.Value) {
                // caller's SP is FixedFrameSize below the address of the first arg
                p := s.Prog(riscv.AMOV)
                p.From.Type = obj.TYPE_ADDR
-               p.From.Offset = -base.Ctxt.FixedFrameSize()
+               p.From.Offset = -base.Ctxt.Arch.FixedFrameSize
                p.From.Name = obj.NAME_PARAM
                p.To.Type = obj.TYPE_REG
                p.To.Reg = v.Reg()
index 488a080c468886db6d769269ff5387c93dc33447..70e403122481e27ac676ddac656ad564ae75a063 100644 (file)
@@ -24,7 +24,7 @@ func zerorange(pp *objw.Progs, p *obj.Prog, off, cnt int64, _ *uint32) *obj.Prog
        }
 
        // Adjust the frame to account for LR.
-       off += base.Ctxt.FixedFrameSize()
+       off += base.Ctxt.Arch.FixedFrameSize
        reg := int16(s390x.REGSP)
 
        // If the off cannot fit in a 12-bit unsigned displacement then we
index 8f9c157d9a96e372d08c64224feffc7b829c2e7e..7d9b31de4c2896f6b115ba6a9ef4b01f77c3356b 100644 (file)
@@ -550,7 +550,7 @@ func ssaGenValue(s *ssagen.State, v *ssa.Value) {
                // caller's SP is FixedFrameSize below the address of the first arg
                p := s.Prog(s390x.AMOVD)
                p.From.Type = obj.TYPE_ADDR
-               p.From.Offset = -base.Ctxt.FixedFrameSize()
+               p.From.Offset = -base.Ctxt.Arch.FixedFrameSize
                p.From.Name = obj.NAME_PARAM
                p.To.Type = obj.TYPE_REG
                p.To.Reg = v.Reg()
index ddf2190e527be1c1b736c4dab6bff0ea8e29691f..931ef454fca35cbc05445e49a68e45ed30b3492b 100644 (file)
@@ -332,8 +332,8 @@ func NewConfig(arch string, types Types, ctxt *obj.Link, optimize, softfloat boo
                c.floatParamRegs = nil // no FP registers in softfloat mode
        }
 
-       c.ABI0 = abi.NewABIConfig(0, 0, ctxt.FixedFrameSize())
-       c.ABI1 = abi.NewABIConfig(len(c.intParamRegs), len(c.floatParamRegs), ctxt.FixedFrameSize())
+       c.ABI0 = abi.NewABIConfig(0, 0, ctxt.Arch.FixedFrameSize)
+       c.ABI1 = abi.NewABIConfig(len(c.intParamRegs), len(c.floatParamRegs), ctxt.Arch.FixedFrameSize)
 
        // On Plan 9, floating point operations are not allowed in note handler.
        if buildcfg.GOOS == "plan9" {
index b774ea78b1a3a188d67d0988ba1351948d5877f1..90ea2d50403fdb9e8dec321f58c9760c8bc10a19 100644 (file)
@@ -1108,7 +1108,7 @@ func (x *expandState) rewriteArgs(v *Value, firstArg int) {
                                a0 := a.Args[0]
                                if a0.Op == OpLocalAddr {
                                        n := a0.Aux.(*ir.Name)
-                                       if n.Class == ir.PPARAM && n.FrameOffset()+x.f.Config.ctxt.FixedFrameSize() == aOffset {
+                                       if n.Class == ir.PPARAM && n.FrameOffset()+x.f.Config.ctxt.Arch.FixedFrameSize == aOffset {
                                                continue
                                        }
                                }
@@ -1129,7 +1129,7 @@ func (x *expandState) rewriteArgs(v *Value, firstArg int) {
                                // It's common for a tail call passing the same arguments (e.g. method wrapper),
                                // so this would be a self copy. Detect this and optimize it out.
                                n := a.Aux.(*ir.Name)
-                               if n.Class == ir.PPARAM && n.FrameOffset()+x.f.Config.ctxt.FixedFrameSize() == aOffset {
+                               if n.Class == ir.PPARAM && n.FrameOffset()+x.f.Config.ctxt.Arch.FixedFrameSize == aOffset {
                                        continue
                                }
                        }
index 21eee12c8532536e709c984ca01fedb66c07a79e..65ff960c84721b7f86d8768ed856d1fd3c797bc9 100644 (file)
@@ -486,7 +486,7 @@ func wbcall(pos src.XPos, b *Block, fn, typ *obj.LSym, ptr, val, mem, sp, sb *Va
        inRegs := b.Func.ABIDefault == b.Func.ABI1 && len(config.intParamRegs) >= 3
 
        // put arguments on stack
-       off := config.ctxt.FixedFrameSize()
+       off := config.ctxt.Arch.FixedFrameSize
 
        var argTypes []*types.Type
        if typ != nil { // for typedmemmove
@@ -529,7 +529,7 @@ func wbcall(pos src.XPos, b *Block, fn, typ *obj.LSym, ptr, val, mem, sp, sb *Va
        // issue call
        call := b.NewValue0A(pos, OpStaticCall, types.TypeResultMem, StaticAuxCall(fn, b.Func.ABIDefault.ABIAnalyzeTypes(nil, argTypes, nil)))
        call.AddArgs(wbargs...)
-       call.AuxInt = off - config.ctxt.FixedFrameSize()
+       call.AuxInt = off - config.ctxt.Arch.FixedFrameSize
        return b.NewValue1I(pos, OpSelectN, types.TypeMem, 0, call)
 }
 
@@ -629,7 +629,7 @@ func IsNewObject(v *Value) (mem *Value, ok bool) {
        if v.Args[0].Args[0].Op != OpSP {
                return nil, false
        }
-       if v.Args[0].AuxInt != c.ctxt.FixedFrameSize()+c.RegSize { // offset of return value
+       if v.Args[0].AuxInt != c.ctxt.Arch.FixedFrameSize+c.RegSize { // offset of return value
                return nil, false
        }
        return mem, true
index 86d40e239d67a11816fc109bd90ab1504fa72e66..825b32aa8082497ba7527397585fb9c32719d416 100644 (file)
@@ -225,13 +225,13 @@ func StackOffset(slot ssa.LocalSlot) int32 {
        switch n.Class {
        case ir.PPARAM, ir.PPARAMOUT:
                if !n.IsOutputParamInRegisters() {
-                       off = n.FrameOffset() + base.Ctxt.FixedFrameSize()
+                       off = n.FrameOffset() + base.Ctxt.Arch.FixedFrameSize
                        break
                }
                fallthrough // PPARAMOUT in registers allocates like an AUTO
        case ir.PAUTO:
                off = n.FrameOffset()
-               if base.Ctxt.FixedFrameSize() == 0 {
+               if base.Ctxt.Arch.FixedFrameSize == 0 {
                        off -= int64(types.PtrSize)
                }
                if buildcfg.FramePointerEnabled {
index 7b6b69ffc572d44b0789d43161530af9baa536f4..adb95445c43969a6f8fd282217398f6ee89f6802 100644 (file)
@@ -5102,7 +5102,7 @@ func (s *state) call(n *ir.CallExpr, k callKind, returnResultAddr bool) *ssa.Val
        } else {
                // Store arguments to stack, including defer/go arguments and receiver for method calls.
                // These are written in SP-offset order.
-               argStart := base.Ctxt.FixedFrameSize()
+               argStart := base.Ctxt.Arch.FixedFrameSize
                // Defer/go args.
                if k != callNormal && k != callTail {
                        // Write closure (arg to newproc/deferproc).
@@ -5606,7 +5606,7 @@ func (s *state) intDivide(n ir.Node, a, b *ssa.Value) *ssa.Value {
 func (s *state) rtcall(fn *obj.LSym, returns bool, results []*types.Type, args ...*ssa.Value) []*ssa.Value {
        s.prevCall = nil
        // Write args to the stack
-       off := base.Ctxt.FixedFrameSize()
+       off := base.Ctxt.Arch.FixedFrameSize
        var callArgs []*ssa.Value
        var callArgTypes []*types.Type
 
@@ -5633,7 +5633,7 @@ func (s *state) rtcall(fn *obj.LSym, returns bool, results []*types.Type, args .
                b := s.endBlock()
                b.Kind = ssa.BlockExit
                b.SetControl(call)
-               call.AuxInt = off - base.Ctxt.FixedFrameSize()
+               call.AuxInt = off - base.Ctxt.Arch.FixedFrameSize
                if len(results) > 0 {
                        s.Fatalf("panic call can't have results")
                }
index 12d9d0f365e1c2f4cc11795c427a748ce785ab4e..378100b1627d9df4dee8c12e7bfcfa1f4579f63c 100644 (file)
@@ -727,7 +727,7 @@ func ssaGenValue(s *ssagen.State, v *ssa.Value) {
                // caller's SP is the address of the first arg
                p := s.Prog(x86.AMOVL)
                p.From.Type = obj.TYPE_ADDR
-               p.From.Offset = -base.Ctxt.FixedFrameSize() // 0 on 386, just to be consistent with other architectures
+               p.From.Offset = -base.Ctxt.Arch.FixedFrameSize // 0 on 386, just to be consistent with other architectures
                p.From.Name = obj.NAME_PARAM
                p.To.Type = obj.TYPE_REG
                p.To.Reg = v.Reg()
index 12a4c94e2496a6907f4c2edb4521afc10a55a103..5f6c135f8c4001f1f56c7e17d18bbdbdc4a550ba 100644 (file)
@@ -984,14 +984,6 @@ func (fi *FuncInfo) UnspillRegisterArgs(last *Prog, pa ProgAlloc) *Prog {
        return last
 }
 
-// The smallest possible offset from the hardware stack pointer to a local
-// variable on the stack. Architectures that use a link register save its value
-// on the stack in the function prologue and so always have a pointer between
-// the hardware stack pointer and the local variable area.
-func (ctxt *Link) FixedFrameSize() int64 {
-       return ctxt.Arch.FixedFrameSize
-}
-
 // LinkArch is the definition of a single architecture.
 type LinkArch struct {
        *sys.Arch
index e475ffdc146ae7947edc4cd1d6dba2b59aa628ab..ab8d37b1bee07b37ebffbdfb6cc8a9993565eb31 100644 (file)
@@ -415,7 +415,7 @@ func span0(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
                return
        }
 
-       c := ctxt0{ctxt: ctxt, newprog: newprog, cursym: cursym, autosize: int32(p.To.Offset + ctxt.FixedFrameSize())}
+       c := ctxt0{ctxt: ctxt, newprog: newprog, cursym: cursym, autosize: int32(p.To.Offset + ctxt.Arch.FixedFrameSize)}
 
        if oprange[AOR&obj.AMask] == nil {
                c.ctxt.Diag("mips ops not initialized, call mips.buildop first")
@@ -627,7 +627,7 @@ func (c *ctxt0) aclass(a *obj.Addr) int {
                                // a.Offset is still relative to pseudo-FP.
                                a.Reg = obj.REG_NONE
                        }
-                       c.instoffset = int64(c.autosize) + a.Offset + c.ctxt.FixedFrameSize()
+                       c.instoffset = int64(c.autosize) + a.Offset + c.ctxt.Arch.FixedFrameSize
                        if c.instoffset >= -BIG && c.instoffset < BIG {
                                return C_SAUTO
                        }
@@ -695,7 +695,7 @@ func (c *ctxt0) aclass(a *obj.Addr) int {
                                // a.Offset is still relative to pseudo-FP.
                                a.Reg = obj.REG_NONE
                        }
-                       c.instoffset = int64(c.autosize) + a.Offset + c.ctxt.FixedFrameSize()
+                       c.instoffset = int64(c.autosize) + a.Offset + c.ctxt.Arch.FixedFrameSize
                        if c.instoffset >= -BIG && c.instoffset < BIG {
                                return C_SACON
                        }
index b96a28a94423b8ff9cd8875e95daba89cf890d64..2a2c8ecb75cee94b47aa89ebefad0e29c21a4f31 100644 (file)
@@ -140,7 +140,7 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
 
        p := c.cursym.Func().Text
        textstksiz := p.To.Offset
-       if textstksiz == -ctxt.FixedFrameSize() {
+       if textstksiz == -ctxt.Arch.FixedFrameSize {
                // Historical way to mark NOFRAME.
                p.From.Sym.Set(obj.AttrNoFrame, true)
                textstksiz = 0
@@ -282,7 +282,7 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
                        if !p.From.Sym.NoFrame() {
                                // If there is a stack frame at all, it includes
                                // space to save the LR.
-                               autosize += int32(c.ctxt.FixedFrameSize())
+                               autosize += int32(c.ctxt.Arch.FixedFrameSize)
                        }
 
                        if autosize&4 != 0 && c.ctxt.Arch.Family == sys.MIPS64 {
@@ -299,7 +299,7 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
                                }
                        }
 
-                       p.To.Offset = int64(autosize) - ctxt.FixedFrameSize()
+                       p.To.Offset = int64(autosize) - ctxt.Arch.FixedFrameSize
 
                        if c.cursym.Func().Text.Mark&LEAF != 0 {
                                c.cursym.Set(obj.AttrLeaf, true)
@@ -392,7 +392,7 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
                                q = obj.Appendp(q, newprog)
                                q.As = add
                                q.From.Type = obj.TYPE_CONST
-                               q.From.Offset = int64(autosize) + ctxt.FixedFrameSize()
+                               q.From.Offset = int64(autosize) + ctxt.Arch.FixedFrameSize
                                q.Reg = REGSP
                                q.To.Type = obj.TYPE_REG
                                q.To.Reg = REG_R3
@@ -409,7 +409,7 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
                                q = obj.Appendp(q, newprog)
                                q.As = add
                                q.From.Type = obj.TYPE_CONST
-                               q.From.Offset = ctxt.FixedFrameSize()
+                               q.From.Offset = ctxt.Arch.FixedFrameSize
                                q.Reg = REGSP
                                q.To.Type = obj.TYPE_REG
                                q.To.Reg = REG_R2
index 50c9b37f02fa262669a8c901c99ca57dd0c7659a..9ee469c6f226e2a1bd3835b7284dd6f5d1b59fd0 100644 (file)
@@ -917,7 +917,7 @@ func (c *ctxt9) aclass(a *obj.Addr) int {
                        return C_LOREG
 
                case obj.NAME_PARAM:
-                       c.instoffset = int64(c.autosize) + a.Offset + c.ctxt.FixedFrameSize()
+                       c.instoffset = int64(c.autosize) + a.Offset + c.ctxt.Arch.FixedFrameSize
                        if c.instoffset >= -BIG && c.instoffset < BIG {
                                return C_SOREG
                        }
@@ -983,7 +983,7 @@ func (c *ctxt9) aclass(a *obj.Addr) int {
                        return C_LACON
 
                case obj.NAME_PARAM:
-                       c.instoffset = int64(c.autosize) + a.Offset + c.ctxt.FixedFrameSize()
+                       c.instoffset = int64(c.autosize) + a.Offset + c.ctxt.Arch.FixedFrameSize
                        if c.instoffset >= -BIG && c.instoffset < BIG {
                                return C_SACON
                        }
index 0a938d7a13783e4d076e42f15accd839fd1d500d..098f1cd7fece4cd28e865b6037cd771e178fd269 100644 (file)
@@ -614,7 +614,7 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
                        if !p.From.Sym.NoFrame() {
                                // If there is a stack frame at all, it includes
                                // space to save the LR.
-                               autosize += int32(c.ctxt.FixedFrameSize())
+                               autosize += int32(c.ctxt.Arch.FixedFrameSize)
                        }
 
                        if p.Mark&LEAF != 0 && autosize < objabi.StackSmall {
@@ -811,7 +811,7 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
                                q = obj.Appendp(q, c.newprog)
                                q.As = AADD
                                q.From.Type = obj.TYPE_CONST
-                               q.From.Offset = int64(autosize) + c.ctxt.FixedFrameSize()
+                               q.From.Offset = int64(autosize) + c.ctxt.Arch.FixedFrameSize
                                q.Reg = REGSP
                                q.To.Type = obj.TYPE_REG
                                q.To.Reg = REG_R24
@@ -831,7 +831,7 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
                                q = obj.Appendp(q, c.newprog)
                                q.As = AADD
                                q.From.Type = obj.TYPE_CONST
-                               q.From.Offset = c.ctxt.FixedFrameSize()
+                               q.From.Offset = c.ctxt.Arch.FixedFrameSize
                                q.Reg = REGSP
                                q.To.Type = obj.TYPE_REG
                                q.To.Reg = REG_R25
@@ -1066,7 +1066,7 @@ func (c *ctxt9) stacksplit(p *obj.Prog, framesize int32) *obj.Prog {
                p = c.cursym.Func().SpillRegisterArgs(p, c.newprog)
 
                // Save LR and REGCTXT
-               frameSize := 8 + c.ctxt.FixedFrameSize()
+               frameSize := 8 + c.ctxt.Arch.FixedFrameSize
 
                // MOVD LR, REGTMP
                p = obj.Appendp(p, c.newprog)
index 0f52f6677944b4c8cf37a5e0f3a7b37ea2fb6af1..b30958cb38550e9850f5d4259765bcbbadfce238 100644 (file)
@@ -380,7 +380,7 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
 
        // Save LR unless there is no frame.
        if !text.From.Sym.NoFrame() {
-               stacksize += ctxt.FixedFrameSize()
+               stacksize += ctxt.Arch.FixedFrameSize
        }
 
        cursym.Func().Args = text.To.Val.(int32)
@@ -461,7 +461,7 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
 
                calcargp := obj.Appendp(getargp, newprog)
                calcargp.As = AADDI
-               calcargp.From = obj.Addr{Type: obj.TYPE_CONST, Offset: stacksize + ctxt.FixedFrameSize()}
+               calcargp.From = obj.Addr{Type: obj.TYPE_CONST, Offset: stacksize + ctxt.Arch.FixedFrameSize}
                calcargp.Reg = REG_SP
                calcargp.To = obj.Addr{Type: obj.TYPE_REG, Reg: REG_X7}
 
index 06921085c9584ff3a3c6f4bd4170bb105ce1bb83..5760847bcd4dbdb3ed4db7fa123e1755ab7b2096 100644 (file)
@@ -586,7 +586,7 @@ func (c *ctxtz) aclass(a *obj.Addr) int {
                                // a.Offset is still relative to pseudo-FP.
                                a.Reg = obj.REG_NONE
                        }
-                       c.instoffset = int64(c.autosize) + a.Offset + c.ctxt.FixedFrameSize()
+                       c.instoffset = int64(c.autosize) + a.Offset + c.ctxt.Arch.FixedFrameSize
                        if c.instoffset >= -BIG && c.instoffset < BIG {
                                return C_SAUTO
                        }
@@ -657,7 +657,7 @@ func (c *ctxtz) aclass(a *obj.Addr) int {
                                // a.Offset is still relative to pseudo-FP.
                                a.Reg = obj.REG_NONE
                        }
-                       c.instoffset = int64(c.autosize) + a.Offset + c.ctxt.FixedFrameSize()
+                       c.instoffset = int64(c.autosize) + a.Offset + c.ctxt.Arch.FixedFrameSize
                        if c.instoffset >= -BIG && c.instoffset < BIG {
                                return C_SACON
                        }
index aebbf8dbc55f1a02a2fd9155f6802bcc16b6b34c..fed770375920eeef1f8fe2667a66ac855627e938 100644 (file)
@@ -310,7 +310,7 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
                        if !p.From.Sym.NoFrame() {
                                // If there is a stack frame at all, it includes
                                // space to save the LR.
-                               autosize += int32(c.ctxt.FixedFrameSize())
+                               autosize += int32(c.ctxt.Arch.FixedFrameSize)
                        }
 
                        if p.Mark&LEAF != 0 && autosize < objabi.StackSmall {
@@ -420,7 +420,7 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
                                q = obj.Appendp(q, c.newprog)
                                q.As = AADD
                                q.From.Type = obj.TYPE_CONST
-                               q.From.Offset = int64(autosize) + c.ctxt.FixedFrameSize()
+                               q.From.Offset = int64(autosize) + c.ctxt.Arch.FixedFrameSize
                                q.Reg = REGSP
                                q.To.Type = obj.TYPE_REG
                                q.To.Reg = REG_R5
@@ -440,7 +440,7 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
                                q = obj.Appendp(q, c.newprog)
                                q.As = AADD
                                q.From.Type = obj.TYPE_CONST
-                               q.From.Offset = c.ctxt.FixedFrameSize()
+                               q.From.Offset = c.ctxt.Arch.FixedFrameSize
                                q.Reg = REGSP
                                q.To.Type = obj.TYPE_REG
                                q.To.Reg = REG_R6
index 7104a3c8b6b121d9b4fd6f5e3dec513ee5ef9e2c..e26b1e56ddd283c3d2254c5bf31acf6c8125168e 100644 (file)
@@ -2471,7 +2471,7 @@ func (sc *stkChk) check(up *chain, depth int) int {
                }
                // Raise limit to allow frame.
                locals := info.Locals()
-               limit = objabi.StackLimit + int(locals) + int(ctxt.FixedFrameSize())
+               limit = objabi.StackLimit + int(locals) + int(ctxt.Arch.FixedFrameSize)
        }
 
        // Walk through sp adjustments in function, consuming relocs.
index f1b5f4d223b93d3e2bf180e91fa3d433c2abbdfa..34221dfa8a764d30642307335d4f1df591562c07 100644 (file)
@@ -102,14 +102,6 @@ type cgodata struct {
        directives [][]string
 }
 
-// The smallest possible offset from the hardware stack pointer to a local
-// variable on the stack. Architectures that use a link register save its value
-// on the stack in the function prologue and so always have a pointer between
-// the hardware stack pointer and the local variable area.
-func (ctxt *Link) FixedFrameSize() int64 {
-       return ctxt.Arch.FixedFrameSize
-}
-
 func (ctxt *Link) Logf(format string, args ...interface{}) {
        fmt.Fprintf(ctxt.Bso, format, args...)
        ctxt.Bso.Flush()