1
0
mirror of https://github.com/golang/go synced 2024-11-17 05:54:46 -07:00
The Go programming language
Go to file
Dan Scales 59a9a035ff cmd/compile: switch to computing dict format on instantiated functions
Change to computing the dictionary form on each shape-instantiated
function, rather than once on the underlying generic function/method.
The problem with computing the dictionary format on the generic function
is that we had to force early transformations to create all the
needed/implicit CONVIFACE nodes, since many of these nodes cause the
need for a dictionary entry. Also, the dictionary entries needed can
different with different instantiations of the same generic function,
especially depending on whether a type argument is a non-interface or
interface type, or a instantiated type vs. a non-instantiated type.

By computing the dictionary format on the instantiated function, we are
scanning a function where all the transformations have been done to
create implicit CONVFIFACE nodes, and we know the above relevant
information about the type params (which are shapes).

Much of the change is more mechanical changes from typeparams to shapes,
and generic functions/info to instantiated functions/info. Some of the
most important non-mechanical changes are:

 - Separated out the dictionary transformations to nodes into a separate
   dictPass, since we need to analyze instantiated functions after
   stenciling, but before the dictionary transformations.

 - Added type param index to shape types, since we need to be able
   distinguish type params of an instantiation which are different but
   happen to have the same shape.

 - Allow the type substituter to work with shapes again (since for the
   dictionary entries we need to substitute shape params to the concrete
   type args).

 - Support types.IdentityStrict() that does strict type comparison (no
   special case for shapes). This needed for type substitution,
   formatting and creating dictionaries, etc. We can maybe create better
   names for this function.

 - Add new information to instInfo to contain a mapping from the shape
   type params to their instantiated type bound. This is needed when
   doing the dictionary transformations related to type bounds.

Change-Id: I1c3ca312c5384f318c4dd7d0858dba9766396ff6
Reviewed-on: https://go-review.googlesource.com/c/go/+/349613
Trust: Dan Scales <danscales@google.com>
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2021-09-15 22:53:17 +00:00
.github
api net: reduce allocations for UDP send/recv on Windows 2021-08-16 23:57:10 +00:00
doc spec: fix prose about terminating statements 2021-09-13 22:57:34 +00:00
lib/time lib/time: fix RFC 6557 url 2021-08-15 02:18:46 +00:00
misc misc/wasm: enable ECMAScript strict mode 2021-09-03 19:56:09 +00:00
src cmd/compile: switch to computing dict format on instantiated functions 2021-09-15 22:53:17 +00:00
test cmd/compile: set IsShape based on type being in the Shapes pkg 2021-09-14 23:07:15 +00:00
.gitattributes
.gitignore internal/buildcfg: move build configuration out of cmd/internal/objabi 2021-04-16 19:20:53 +00:00
AUTHORS A+C: update name 2021-06-01 17:08:12 +00:00
codereview.cfg codereview.cfg: add codereview.cfg for master branch 2021-02-19 18:44:53 +00:00
CONTRIBUTING.md
CONTRIBUTORS CONTRIBUTORS: update for the Go 1.17 release 2021-08-12 17:43:16 +00:00
LICENSE
PATENTS
README.md
SECURITY.md

The Go Programming Language

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.

Gopher image Gopher image by Renee French, licensed under Creative Commons 3.0 Attributions license.

Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.

Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.

Download and Install

Binary Distributions

Official binary distributions are available at https://golang.org/dl/.

After downloading a binary release, visit https://golang.org/doc/install for installation instructions.

Install From Source

If a binary distribution is not available for your combination of operating system and architecture, visit https://golang.org/doc/install/source for source installation instructions.

Contributing

Go is the work of thousands of contributors. We appreciate your help!

To contribute, please read the contribution guidelines at https://golang.org/doc/contribute.html.

Note that the Go project uses the issue tracker for bug reports and proposals only. See https://golang.org/wiki/Questions for a list of places to ask questions about the Go language.