]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: use staticuint64s instead of staticbytes
authorDiogo Pinela <diogoid7400@gmail.com>
Tue, 3 Mar 2020 21:03:40 +0000 (21:03 +0000)
committerJosh Bleecher Snyder <josharian@gmail.com>
Wed, 4 Mar 2020 21:43:01 +0000 (21:43 +0000)
commit19ed0d993cf7b0df804c4c2e96dc674da4059e03
tree25002c41cab148480d0718696ad5cd2e7b3e73b2
parentc55a50edb9454dbdaca165be4b030a1e0cfbaa19
cmd/compile: use staticuint64s instead of staticbytes

There are still two places in src/runtime/string.go that use
staticbytes, so we cannot delete it just yet.

There is a new codegen test to verify that the index calculation
is constant-folded, at least on amd64. ppc64, mips[64] and s390x
cannot currently do that.

There is also a new runtime benchmark to ensure that this does not
slow down performance (tested against parent commit):

name                      old time/op  new time/op  delta
ConvT2EByteSized/bool-4   1.07ns ± 1%  1.07ns ± 1%   ~     (p=0.060 n=14+15)
ConvT2EByteSized/uint8-4  1.06ns ± 1%  1.07ns ± 1%   ~     (p=0.095 n=14+15)

Updates #37612

Change-Id: I5ec30738edaa48cda78dfab4a78e24a32fa7fd6a
Reviewed-on: https://go-review.googlesource.com/c/go/+/221957
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
src/cmd/compile/internal/gc/go.go
src/cmd/compile/internal/gc/walk.go
src/runtime/iface_test.go
test/codegen/smallintiface.go [new file with mode: 0644]