mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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:
parent
a6136ded32
commit
aca92f352d
1 changed files with 4 additions and 2 deletions
|
|
@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue