]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.typeparams] cmd/compile: add dictionary argument to generic functions
authorKeith Randall <khr@golang.org>
Fri, 16 Apr 2021 21:06:50 +0000 (14:06 -0700)
committerKeith Randall <khr@golang.org>
Wed, 2 Jun 2021 20:23:12 +0000 (20:23 +0000)
commit7b876def6c4936cfae774d3007f8265876a9fbf7
tree74d0b022c50ea68dfe1dbe4dbded11161ebaedaa
parentaa9cfdf775692a9fa6cc4ea9768415d73323c0cc
[dev.typeparams] cmd/compile: add dictionary argument to generic functions

When converting from a generic function to a concrete implementation,
add a dictionary argument to the generic function (both an actual
argument at each callsite, and a formal argument of each
implementation).

The dictionary argument comes before all other arguments (including
any receiver).

The dictionary argument is checked for validity, but is otherwise unused.
Subsequent CLs will start using the dictionary for, e.g., converting a
value of generic type to interface{}.

Import/export required adding support for LINKSYMOFFSET, which is used
by the dictionary checking code.

Change-Id: I16a7a8d23c7bd6a897e0da87c69f273be9103bd7
Reviewed-on: https://go-review.googlesource.com/c/go/+/323272
Trust: Keith Randall <khr@golang.org>
Trust: Dan Scales <danscales@google.com>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dan Scales <danscales@google.com>
src/cmd/compile/internal/noder/irgen.go
src/cmd/compile/internal/noder/stencil.go
src/cmd/compile/internal/noder/transform.go
src/cmd/compile/internal/reflectdata/reflect.go
src/cmd/compile/internal/typecheck/iexport.go
src/cmd/compile/internal/typecheck/iimport.go
src/cmd/compile/internal/typecheck/subr.go
src/cmd/compile/internal/types/type.go
src/runtime/internal/atomic/atomic_arm64.go
test/typeparam/dictionaryCapture.go [new file with mode: 0644]