diff options
author | David Chase <drchase@google.com> | 2021-03-23 15:51:29 -0400 |
---|---|---|
committer | David Chase <drchase@google.com> | 2021-03-24 03:16:14 +0000 |
commit | 4357f71ca7ecd3869e2e0805ee4d6cd275a71a7c (patch) | |
tree | 79a8f96275e2551fa7fdb09d06aac1e2d605e70c /src/cmd/compile/internal/abi/abiutils.go | |
parent | 14ef2d8c0155b725226516bd2eeb804a70a95462 (diff) | |
download | go-4357f71ca7ecd3869e2e0805ee4d6cd275a71a7c.tar.gz go-4357f71ca7ecd3869e2e0805ee4d6cd275a71a7c.zip |
cmd/compile: remove more dead code and data structures
Remove more now-redundant code, methods, and types
associated with transition to register ABI.
Repaired some broken comments.
Tested on link-register architectures (arm64, ppc64le)
Updates #40724.
Change-Id: Ie8433f6d38ec4a1d9705f22dcb596f267d81f203
Reviewed-on: https://go-review.googlesource.com/c/go/+/304189
Trust: David Chase <drchase@google.com>
Run-TryBot: David Chase <drchase@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/cmd/compile/internal/abi/abiutils.go')
-rw-r--r-- | src/cmd/compile/internal/abi/abiutils.go | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/cmd/compile/internal/abi/abiutils.go b/src/cmd/compile/internal/abi/abiutils.go index 549c11306a..feda2153f7 100644 --- a/src/cmd/compile/internal/abi/abiutils.go +++ b/src/cmd/compile/internal/abi/abiutils.go @@ -225,27 +225,16 @@ func appendParamOffsets(offsets []int64, at int64, t *types.Type) ([]int64, int6 return offsets, at } -// SpillOffset returns the offset *within the spill area* for the parameter that "a" describes. -// Registers will be spilled here; if a memory home is needed (for a pointer method e.g.) -// then that will be the address. -// This will panic if "a" describes a stack-allocated parameter. -func (a *ABIParamAssignment) SpillOffset() int32 { - if len(a.Registers) == 0 { - panic("Stack-allocated parameters have no spill offset") - } - return a.offset -} - // FrameOffset returns the frame-pointer-relative location that a function // would spill its input or output parameter to, if such a spill slot exists. +// If there is none defined (e.g., register-allocated outputs) it panics. // For register-allocated inputs that is their spill offset reserved for morestack; // for stack-allocated inputs and outputs, that is their location on the stack. -// For register-allocated outputs, there is no defined spill area, so return -1. // (In a future version of the ABI, register-resident inputs may lose their defined // spill area to help reduce stack sizes.) func (a *ABIParamAssignment) FrameOffset(i *ABIParamResultInfo) int64 { if a.offset == -1 { - return -1 + panic("Function parameter has no ABI-defined frame-pointer offset") } if len(a.Registers) == 0 { // passed on stack return int64(a.offset) - i.config.LocalsOffset() |