aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCuong Manh Le <cuong.manhle.vn@gmail.com>2019-10-19 23:31:52 +0700
committerKeith Randall <khr@golang.org>2019-10-21 19:04:47 +0000
commitba97d0d84d4272c4b8497fa6af2eab1580b62d44 (patch)
treefda25b771e624555ba79a5fbda84421b968b5492 /src
parent3b2eb699a06eb2eb9afdf5fbf2326f87e9deca97 (diff)
downloadgo-ba97d0d84d4272c4b8497fa6af2eab1580b62d44.tar.xz
cmd/compile: remove overflow pointer padding for nacl
CL 200077 removed nacl bits in the toolchain, but it misses the code to add pointer overflow padding, which is specific for nacl. This CL removes that part. Passes toolstash-check. Updates #30439 Change-Id: I1e77cade9f31690e16cd13d3445a98b500671252 Reviewed-on: https://go-review.googlesource.com/c/go/+/202159 Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src')
-rw-r--r--src/cmd/compile/internal/gc/reflect.go23
1 files changed, 1 insertions, 22 deletions
diff --git a/src/cmd/compile/internal/gc/reflect.go b/src/cmd/compile/internal/gc/reflect.go
index 9e3dca25c8..e34ed7311c 100644
--- a/src/cmd/compile/internal/gc/reflect.go
+++ b/src/cmd/compile/internal/gc/reflect.go
@@ -112,27 +112,6 @@ func bmap(t *types.Type) *types.Type {
elems := makefield("elems", arr)
field = append(field, elems)
- // Make sure the overflow pointer is the last memory in the struct,
- // because the runtime assumes it can use size-ptrSize as the
- // offset of the overflow pointer. We double-check that property
- // below once the offsets and size are computed.
- //
- // BUCKETSIZE is 8, so the struct is aligned to 64 bits to this point.
- // On 32-bit systems, the max alignment is 32-bit, and the
- // overflow pointer will add another 32-bit field, and the struct
- // will end with no padding.
- // On 64-bit systems, the max alignment is 64-bit, and the
- // overflow pointer will add another 64-bit field, and the struct
- // will end with no padding.
- // On nacl/amd64p32, however, the max alignment is 64-bit,
- // but the overflow pointer will add only a 32-bit field,
- // so if the struct needs 64-bit padding (because a key or elem does)
- // then it would end with an extra 32-bit padding field.
- // Preempt that by emitting the padding here.
- if int(elemtype.Align) > Widthptr || int(keytype.Align) > Widthptr {
- field = append(field, makefield("pad", types.Types[TUINTPTR]))
- }
-
// If keys and elems have no pointers, the map implementation
// can keep a list of overflow pointers on the side so that
// buckets can be marked as having no pointers.
@@ -196,7 +175,7 @@ func bmap(t *types.Type) *types.Type {
}
// Double-check that overflow field is final memory in struct,
- // with no padding at end. See comment above.
+ // with no padding at end.
if overflow.Offset != bucket.Width-int64(Widthptr) {
Fatalf("bad offset of overflow in bmap for %v", t)
}