mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
internal/abi: refactor (basic) type struct into one definition
This touches a lot of files, which is bad, but it is also good, since there's N copies of this information commoned into 1. The new files in internal/abi are copied from the end of the stack; ultimately this will all end up being used. Change-Id: Ia252c0055aaa72ca569411ef9f9e96e3d610889e Reviewed-on: https://go-review.googlesource.com/c/go/+/462995 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Carlos Amedee <carlos@golang.org> Run-TryBot: David Chase <drchase@google.com> Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
parent
dace96b9a1
commit
bdc6ae579a
46 changed files with 1479 additions and 711 deletions
|
|
@ -57,14 +57,14 @@ func FuncLayout(t Type, rcvr Type) (frametype Type, argSize, retOffset uintptr,
|
|||
inReg = append(inReg, bool2byte(abid.inRegPtrs.Get(i)))
|
||||
outReg = append(outReg, bool2byte(abid.outRegPtrs.Get(i)))
|
||||
}
|
||||
if ft.kind&kindGCProg != 0 {
|
||||
if ft.Kind_&kindGCProg != 0 {
|
||||
panic("can't handle gc programs")
|
||||
}
|
||||
|
||||
// Expand frame type's GC bitmap into byte-map.
|
||||
ptrs = ft.ptrdata != 0
|
||||
ptrs = ft.PtrBytes != 0
|
||||
if ptrs {
|
||||
nptrs := ft.ptrdata / goarch.PtrSize
|
||||
nptrs := ft.PtrBytes / goarch.PtrSize
|
||||
gcdata := ft.gcSlice(0, (nptrs+7)/8)
|
||||
for i := uintptr(0); i < nptrs; i++ {
|
||||
gc = append(gc, gcdata[i/8]>>(i%8)&1)
|
||||
|
|
@ -96,7 +96,7 @@ func MapBucketOf(x, y Type) Type {
|
|||
|
||||
func CachedBucketOf(m Type) Type {
|
||||
t := m.(*rtype)
|
||||
if Kind(t.kind&kindMask) != Map {
|
||||
if Kind(t.Kind_&kindMask) != Map {
|
||||
panic("not map")
|
||||
}
|
||||
tt := (*mapType)(unsafe.Pointer(t))
|
||||
|
|
@ -135,7 +135,7 @@ type OtherPkgFields struct {
|
|||
|
||||
func IsExported(t Type) bool {
|
||||
typ := t.(*rtype)
|
||||
n := typ.nameOff(typ.str)
|
||||
n := typ.nameOff(typ.Str)
|
||||
return n.isExported()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue