gcc/libgo/go
Ian Lance Taylor 10172a64ce compiler, runtime, reflect: generate hash functions only for map keys
Right now we generate hash functions for all types, just in case they
    are used as map keys. That's a lot of wasted effort and binary size
    for types which will never be used as a map key. Instead, generate
    hash functions only for types that we know are map keys.
    
    Just doing that is a bit too simple, since maps with an interface type
    as a key might have to hash any concrete key type that implements that
    interface. So for that case, implement hashing of such types at
    runtime (instead of with generated code). It will be slower, but only
    for maps with interface types as keys, and maybe only a bit slower as
    the aeshash time probably dominates the dispatch time.
    
    Reorg where we keep the equals and hash functions. Move the hash function
    from the key type to the map type, saving a field in every non-map type.
    That leaves only one function in the alg structure, so get rid of that and
    just keep the equal function in the type descriptor itself.
    
    While we're here, reorganize the rtype struct to more closely match
    the gc version.
    
    This is the gofrontend version of https://golang.org/cl/191198.
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/212843

From-SVN: r279848
2020-01-02 21:55:32 +00:00
..
archive
bufio
builtin
bytes
cmd
compress
container
context
crypto
database/sql
debug
encoding
errors
expvar
flag
fmt
go
golang.org/x
hash
html
image
index/suffixarray
internal compiler, runtime, reflect: generate hash functions only for map keys 2020-01-02 21:55:32 +00:00
io
log
math
mime
net
os re PR go/93020 (Final patches to build gcc-10 on GNU/Hurd) 2019-12-24 05:05:32 +00:00
path
plugin
reflect compiler, runtime, reflect: generate hash functions only for map keys 2020-01-02 21:55:32 +00:00
regexp
runtime compiler, runtime, reflect: generate hash functions only for map keys 2020-01-02 21:55:32 +00:00
sort
strconv
strings
sync
syscall re PR go/93020 (Final patches to build gcc-10 on GNU/Hurd) 2019-12-24 05:05:32 +00:00
testdata
testing
text
time
unicode