From: Josh Bleecher Snyder Date: Wed, 7 Jun 2017 18:35:17 +0000 (-0700) Subject: runtime: CSE some function arguments in evacuate X-Git-Tag: go1.10beta1~1622 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=aca92f352d6a5bc0b17cd39d3b1bbe23ae0bb5ac;p=gostls13.git 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 TryBot-Result: Gobot Gobot Reviewed-by: Martin Möhrmann --- diff --git a/src/runtime/hashmap.go b/src/runtime/hashmap.go index e8e61a7fd1..c36ff470d6 100644 --- a/src/runtime/hashmap.go +++ b/src/runtime/hashmap.go @@ -1166,10 +1166,12 @@ func evacuate(t *maptype, h *hmap, oldbucket uintptr) { b = (*bmap)(add(h.oldbuckets, oldbucket*uintptr(t.bucketsize))) // Preserve b.tophash because the evacuation // state is maintained there. + ptr := add(unsafe.Pointer(b), dataOffset) + n := uintptr(t.bucketsize) - dataOffset if t.bucket.kind&kindNoPointers == 0 { - memclrHasPointers(add(unsafe.Pointer(b), dataOffset), uintptr(t.bucketsize)-dataOffset) + memclrHasPointers(ptr, n) } else { - memclrNoHeapPointers(add(unsafe.Pointer(b), dataOffset), uintptr(t.bucketsize)-dataOffset) + memclrNoHeapPointers(ptr, n) } } }