aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/stack.go
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2022-02-10 16:40:18 -0800
committerKeith Randall <khr@golang.org>2022-03-26 20:36:23 +0000
commit7fc38802e15be1a221290b0a9da1f587ace19488 (patch)
tree19d67fd38d8772ced4ec24e15bec63f56794d744 /src/runtime/stack.go
parent0652274c10f8f2a520c30bf43bb968dac91bf9f5 (diff)
downloadgo-7fc38802e15be1a221290b0a9da1f587ace19488.tar.xz
cmd/compile: implement generic method expressions with closures in dictionary
Currently we do quite a dance for method expressions on generic types. We write a new closure, and in that closure convert the receiver to an interface with the required method, then call the target using an interface call. Instead in this CL, we just allocate a (captureless) closure in the dictionary which implements that method expression. This CL makes method expressions faster and simpler. But the real win is some followon CLs, where we can use the same closure to implement bound method calls using the same closure, instead of converting to interface and having wrappers convert back. Much faster and simpler. Still thinking about how to do method values. The receiver still needs to be captured, so there must be some closure involved, I think. Update #50182 Change-Id: I1fbd57e7105663f8b049955b8f4111649a5f4aa8 Reviewed-on: https://go-review.googlesource.com/c/go/+/385254 Trust: Keith Randall <khr@golang.org> Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/runtime/stack.go')
0 files changed, 0 insertions, 0 deletions