Commit Graph

6 Commits

Author SHA1 Message Date
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
Ian Lance Taylor aa8901e9bb libgo: update to Go 1.13beta1 release
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/193497

From-SVN: r275473
2019-09-06 18:12:46 +00:00
Ian Lance Taylor c70ff9f9be compiler, runtime: support and use single argument go:linkname
The gc compiler has started permitting go:linkname comments with a
    single argument to mean that a function should be externally visible
    outside the package.  Implement this in the Go frontend.
    
    Change the libgo runtime package to use it, rather than repeating the
    name just to export a function.
    
    Remove a couple of unnecessary go:linkname comments on declarations.
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/192197

From-SVN: r275239
2019-08-31 03:01:15 +00:00
Ian Lance Taylor 269f05ff58 compiler: make use of specialized fast map routines
In the runtime there are specialized fast map routines for
    certain kep types. This CL lets the compiler make use of these
    functions, instead of always using the generic ones.
    
    As we now generate multiple versions of map delete calls, to make
    things easier we delay the expansion of the built-in delete
    function to flatten phase.
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/180858

From-SVN: r271983
2019-06-06 00:44:01 +00:00
Ian Lance Taylor 4f4a855d82 libgo: update to Go1.12beta2
Reviewed-on: https://go-review.googlesource.com/c/158019

gotools/:
	* Makefile.am (go_cmd_vet_files): Update for Go1.12beta2 release.
	(GOTOOLS_TEST_TIMEOUT): Increase to 600.
	(check-runtime): Export LD_LIBRARY_PATH before computing GOARCH
	and GOOS.
	(check-vet): Copy golang.org/x/tools into check-vet-dir.
	* Makefile.in: Regenerate.

gcc/testsuite/:
	* go.go-torture/execute/names-1.go: Stop using debug/xcoff, which
	is no longer externally visible.

From-SVN: r268084
2019-01-18 19:04:36 +00:00
Ian Lance Taylor dd931d9b48 libgo: update to Go 1.11
Reviewed-on: https://go-review.googlesource.com/136435

gotools/:
	* Makefile.am (mostlyclean-local): Run chmod on check-go-dir to
	make sure it is writable.
	(check-go-tools): Likewise.
	(check-vet): Copy internal/objabi to check-vet-dir.
	* Makefile.in: Rebuild.

From-SVN: r264546
2018-09-24 21:46:21 +00:00