Commit Graph

9 Commits

Author SHA1 Message Date
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 f4e7200b1d runtime: inline and remove eqtype
Now that type equality is just a pointer equality, write it
    inlined and remove the eqtype function.
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/182978

From-SVN: r272578
2019-06-21 22:21:40 +00:00
Ian Lance Taylor 0514cb3374 compiler: open code some type assertions
Now that type equality is just simple pointer equality, we can
    open code some type assertions instead of making runtime calls.
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/182977

From-SVN: r272577
2019-06-21 22:00:57 +00:00
Ian Lance Taylor 5e87c2806f compiler,runtime: do more direct interfaces
A direct interface is an interface whose data word contains the
    actual data value, instead of a pointer to it. The gc toolchain
    creates a direct interface if the value is pointer shaped, that
    includes pointers (including unsafe.Pointer), functions, channels,
    maps, and structs and arrays containing a single pointer-shaped
    field. In gccgo, we only do this for pointers. This CL unifies
    direct interface types with gc. This reduces allocations when
    converting such types to interfaces.
    
    Our method functions used to always take pointer receivers, to
    make interface calls easy. Now for direct interface types, their
    value methods will take value receivers. For a pointer to those
    types, when converted to interface, the interface data contains
    the pointer. For that interface to call a value method, it will
    need a wrapper method that dereference the pointer and invokes
    the value method. The wrapper method, instead of the actual one,
    is put into the itable of the pointer type.
    
    In the runtime, adjust funcPC for the new layout of interfaces of
    functions.
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/168409

From-SVN: r270779
2019-05-01 21:34:16 +00:00
Ian Lance Taylor 1da37f43b2 runtime: persistentalloc and cache itabs
Previously, each time we do an interface conversion for which the
    method table is not known at compile time, we allocate a new
    method table.
    
    This CL ports the mechanism of itab caching from the gc runtime,
    adapted to our itab representation and method finding mechanism.
    With the cache, we reuse the same itab for the same (interface,
    concrete) type pair. This reduces allocations in interface
    conversions.
    
    Unlike the gc runtime, we don't prepopulate the cache with
    statically allocated itabs, as currently we don't have a way to
    find them. This means we don't deduplicate run-time allocated
    itabs with compile-time allocated ones. But that is not too bad
    -- it is just a cache anyway.
    
    As now itabs are never freed, it is also possible to drop the
    write barrier for writing the first word of an interface header.
    I'll leave this optimization for the future.
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/171617

From-SVN: r270778
2019-05-01 20:27: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
Ian Lance Taylor c2047754c3 libgo: update to Go 1.8 release candidate 1
Compiler changes:
      * Change map assignment to use mapassign and assign value directly.
      * Change string iteration to use decoderune, faster for ASCII strings.
      * Change makeslice to take int, and use makeslice64 for larger values.
      * Add new noverflow field to hmap struct used for maps.
    
    Unresolved problems, to be fixed later:
      * Commented out test in go/types/sizes_test.go that doesn't compile.
      * Commented out reflect.TestStructOf test for padding after zero-sized field.
    
    Reviewed-on: https://go-review.googlesource.com/35231

gotools/:
	Updates for Go 1.8rc1.
	* Makefile.am (go_cmd_go_files): Add bug.go.
	(s-zdefaultcc): Write defaultPkgConfig.
	* Makefile.in: Rebuild.

From-SVN: r244456
2017-01-14 00:05:42 +00:00
Ian Lance Taylor 6b752cfac4 runtime: rewrite interface code into Go
I started to copy the Go 1.7 interface code, but the gc and gccgo
    representations of interfaces are too different.  So instead I rewrote
    the gccgo interface code from C to Go.  The code is largely the same as
    it was, but the names are more like those used in the gc runtime.
    
    I also copied over the string comparison functions, and tweaked the
    compiler to use eqstring when comparing strings for equality.
    
    Reviewed-on: https://go-review.googlesource.com/31591

From-SVN: r241384
2016-10-20 18:51:35 +00:00