]> Cypherpunks repositories - gostls13.git/commit
runtime: refactor walking of bucket overflows
authorJosh Bleecher Snyder <josharian@gmail.com>
Wed, 23 Aug 2017 14:49:25 +0000 (07:49 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Thu, 24 Aug 2017 17:17:49 +0000 (17:17 +0000)
commit0b0cc4154e1defed07e73ca1304b9a68c7134577
tree3986794844433fa287c71cb306e0da2e718cfb01
parentcd5c10f040282b1c90109feb155527fe4a2ff4a0
runtime: refactor walking of bucket overflows

This eliminates a nil check of b while evaluating b.tophash,
which is in the inner loop of many hot map functions.
It also makes the code a bit clearer.

Also remove some gotos in favor of labeled breaks.

On non-x86 architectures, this change introduces a pointless reg-reg move,
although the cause is well-understood (#21572).

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