go/src
Keith Randall 60fd32a47f cmd/compile: change the way we handle large map values
mapaccess{1,2} returns a pointer to the value.  When the key
is not in the map, it returns a pointer to zeroed memory.
Currently, for large map values we have a complicated scheme which
dynamically allocates zeroed memory for this purpose.  It is ugly
code and requires an atomic.Load in a bunch of places we'd rather
not have it.

Switch to a scheme where callsites of mapaccess{1,2} which expect
large return values pass in a pointer to zeroed memory that
mapaccess can return if the key is not found.  This avoids the
atomic.Load on all map accesses with a few extra instructions only
for the large value acccesses, plus a bit of bss space.

There was a time (1.4 & 1.5?) where we did something like this but
all the tricks to make the right size zero value were done by the
linker.  That scheme broke in the presence of dyamic linking.
The scheme in this CL works even when dynamic linking.

Fixes #12337

Change-Id: Ic2d0319944af33bbb59785938d9ab80958d1b4b1
Reviewed-on: https://go-review.googlesource.com/22221
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Hudson-Doyle <michael.hudson@canonical.com>
2016-04-20 21:15:31 +00:00
..
archive archive/tar: style nit: s/nano_buf/nanoBuf/ 2016-04-15 21:29:18 +00:00
bufio all: replace magic 0x80 with named constant utf8.RuneSelf 2016-04-10 15:15:57 +00:00
builtin
bytes all: remove unnecessary type conversions 2016-04-15 07:31:45 +00:00
cmd cmd/compile: change the way we handle large map values 2016-04-20 21:15:31 +00:00
compress compress/flate: use uncompressed if dynamic encoding is larger 2016-04-18 02:30:46 +00:00
container container/heap: correct number of elements in BenchmarkDup 2016-04-20 15:26:05 +00:00
context context: attempt to deflake timing tests 2016-04-11 23:15:02 +00:00
crypto crypto/aes: add s390x assembly implementation 2016-04-20 17:02:14 +00:00
database/sql all: delete dead non-test code 2016-03-25 06:28:13 +00:00
debug debug/pe: move some code into section.go and symbol.go 2016-04-20 04:46:59 +00:00
encoding encoding/json: update docs to not use misuse the term "object" 2016-04-16 22:11:57 +00:00
errors all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
expvar expvar: Ensure strings are written as valid JSON. 2016-04-06 03:52:39 +00:00
flag all: single space after period. 2016-03-02 00:13:47 +00:00
fmt fmt: remove extra space in doc for compound objects 2016-04-17 20:07:32 +00:00
go go/types: trailing semis are ok after valid fallthrough 2016-04-19 21:44:44 +00:00
hash hash/adler32: Unroll loop for extra performance. 2016-04-15 10:17:17 +00:00
html html/template: add examples of loading templates from files 2016-04-13 02:28:28 +00:00
image image/draw: remove some bounds checks from DrawYCbCr 2016-04-17 06:25:28 +00:00
index/suffixarray
internal internal/trace: fix int overflow in timestamps 2016-04-12 07:25:11 +00:00
io io: document WriteString calls Write exactly once 2016-04-12 01:03:51 +00:00
log all: single space after period. 2016-03-02 00:13:47 +00:00
math math/big: implement GobDecode/Encode for big.Float 2016-04-20 17:51:01 +00:00
mime all: standardize RFC mention format 2016-04-12 21:07:52 +00:00
net net: add support for Zone of IPNet 2016-04-19 09:21:57 +00:00
os all: remove unnecessary type conversions 2016-04-15 07:31:45 +00:00
path all: use bytes.Equal, bytes.Contains and strings.Contains, again 2016-04-11 15:16:54 +00:00
reflect reflect: test that method name offset is valid 2016-04-18 19:13:36 +00:00
regexp all: remove unnecessary type conversions 2016-04-15 07:31:45 +00:00
runtime cmd/compile: change the way we handle large map values 2016-04-20 21:15:31 +00:00
sort all: delete dead non-test code 2016-03-25 06:28:13 +00:00
strconv strconv: fix ParseFloat for special forms of zero values 2016-04-19 22:39:43 +00:00
strings all: remove unnecessary type conversions 2016-04-15 07:31:45 +00:00
sync all: remove unnecessary type conversions 2016-04-15 07:31:45 +00:00
syscall syscall: fix epoll_event struct for ppc64le/ppc64 2016-04-13 20:58:46 +00:00
testing testing: removed flakey test 2016-04-14 14:00:43 +00:00
text text/template: emit field error over nil pointer error where appropriate 2016-04-10 23:29:29 +00:00
time all: remove unnecessary type conversions 2016-04-15 07:31:45 +00:00
unicode all: remove unnecessary type conversions 2016-04-15 07:31:45 +00:00
unsafe all: single space after period. 2016-03-02 00:13:47 +00:00
vendor/golang.org/x/net/http2/hpack all: fix spelling mistakes 2016-04-03 17:03:15 +00:00
Make.dist
all.bash
all.bat
all.rc
androidtest.bash
bootstrap.bash
buildall.bash
clean.bash
clean.bat
clean.rc
iostest.bash
make.bash cmd/dist: redo flag-passing for bootstrap 2016-03-18 19:00:03 +00:00
make.bat
make.rc
naclmake.bash src: split nacltest.bash into naclmake.bash and keep nacltest.bash 2016-04-12 02:03:34 +00:00
nacltest.bash src: split nacltest.bash into naclmake.bash and keep nacltest.bash 2016-04-12 02:03:34 +00:00
race.bash
race.bat
run.bash
run.bat
run.rc