aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/hashmap.go
diff options
context:
space:
mode:
authorJosh Bleecher Snyder <josharian@gmail.com>2017-06-07 11:35:17 -0700
committerJosh Bleecher Snyder <josharian@gmail.com>2017-08-14 00:51:14 +0000
commitaca92f352d6a5bc0b17cd39d3b1bbe23ae0bb5ac (patch)
tree281c5a865726dddb09d27d8de6a16a73e95235f3 /src/runtime/hashmap.go
parenta6136ded32878f9225e26b03ce9d9e84b0198af8 (diff)
downloadgo-aca92f352d6a5bc0b17cd39d3b1bbe23ae0bb5ac.tar.xz
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>
Diffstat (limited to 'src/runtime/hashmap.go')
-rw-r--r--src/runtime/hashmap.go6
1 files changed, 4 insertions, 2 deletions
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)
}
}
}