runtime: CSE some function arguments in evacuate

Shrinks evacuate's machine code a little.

Change-Id: I08874c92abdc7e621bc0737e22f2a6be31542cab
Reviewed-on: https://go-review.googlesource.com/54652
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Martin Möhrmann <moehrmann@google.com>
This commit is contained in:
Josh Bleecher Snyder 2017-06-07 11:35:17 -07:00
parent a6136ded32
commit aca92f352d

View file

@ -1166,10 +1166,12 @@ func evacuate(t *maptype, h *hmap, oldbucket uintptr) {
b = (*bmap)(add(h.oldbuckets, oldbucket*uintptr(t.bucketsize))) b = (*bmap)(add(h.oldbuckets, oldbucket*uintptr(t.bucketsize)))
// Preserve b.tophash because the evacuation // Preserve b.tophash because the evacuation
// state is maintained there. // state is maintained there.
ptr := add(unsafe.Pointer(b), dataOffset)
n := uintptr(t.bucketsize) - dataOffset
if t.bucket.kind&kindNoPointers == 0 { if t.bucket.kind&kindNoPointers == 0 {
memclrHasPointers(add(unsafe.Pointer(b), dataOffset), uintptr(t.bucketsize)-dataOffset) memclrHasPointers(ptr, n)
} else { } else {
memclrNoHeapPointers(add(unsafe.Pointer(b), dataOffset), uintptr(t.bucketsize)-dataOffset) memclrNoHeapPointers(ptr, n)
} }
} }
} }