]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: remove t.indirectvalue handling in fast evacuation routines
authorJosh Bleecher Snyder <josharian@gmail.com>
Tue, 22 Aug 2017 13:27:48 +0000 (06:27 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Mon, 28 Aug 2017 18:56:40 +0000 (18:56 +0000)
Maps with indirect values use the generic map routines.

Change-Id: Ib211e93f1dacefb988ba3d279f92a13065168079
Reviewed-on: https://go-review.googlesource.com/59135
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Martin Möhrmann <moehrmann@google.com>
src/runtime/hashmap_fast.go

index a69b5316be416cbb7e12b411b3edc9e117973272..c3786478925ac9b82365890fc7e5b27cc2056663 100644 (file)
@@ -846,11 +846,7 @@ func evacuate_fast32(t *maptype, h *hmap, oldbucket uintptr) {
                                        *(*uint32)(dst.k) = *(*uint32)(k)
                                }
 
-                               if t.indirectvalue {
-                                       *(*unsafe.Pointer)(dst.v) = *(*unsafe.Pointer)(v)
-                               } else {
-                                       typedmemmove(t.elem, dst.v, v)
-                               }
+                               typedmemmove(t.elem, dst.v, v)
                                dst.i++
                                // These updates might push these pointers past the end of the
                                // key or value arrays.  That's ok, as we have the overflow pointer
@@ -956,11 +952,7 @@ func evacuate_fast64(t *maptype, h *hmap, oldbucket uintptr) {
                                        *(*uint64)(dst.k) = *(*uint64)(k)
                                }
 
-                               if t.indirectvalue {
-                                       *(*unsafe.Pointer)(dst.v) = *(*unsafe.Pointer)(v)
-                               } else {
-                                       typedmemmove(t.elem, dst.v, v)
-                               }
+                               typedmemmove(t.elem, dst.v, v)
                                dst.i++
                                // These updates might push these pointers past the end of the
                                // key or value arrays.  That's ok, as we have the overflow pointer
@@ -1056,11 +1048,7 @@ func evacuate_faststr(t *maptype, h *hmap, oldbucket uintptr) {
                                // Copy key.
                                *(*string)(dst.k) = *(*string)(k)
 
-                               if t.indirectvalue {
-                                       *(*unsafe.Pointer)(dst.v) = *(*unsafe.Pointer)(v)
-                               } else {
-                                       typedmemmove(t.elem, dst.v, v)
-                               }
+                               typedmemmove(t.elem, dst.v, v)
                                dst.i++
                                // These updates might push these pointers past the end of the
                                // key or value arrays.  That's ok, as we have the overflow pointer