]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.typeparams] cmd/compile: cache mapped types during irgen
authorMatthew Dempsky <mdempsky@google.com>
Tue, 19 Jan 2021 18:38:33 +0000 (10:38 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Tue, 19 Jan 2021 21:14:44 +0000 (21:14 +0000)
commit90bfc7307175c2f58d4efb48003670dba23385ed
treeb4fbd0254d4546880c7694b9422e4f05022849bc
parent3c0a39c964bb149f0a272c396ae3e7b3c4d36e30
[dev.typeparams] cmd/compile: cache mapped types during irgen

If we see the exact same types2.Type a second time, we can map it to
the same *types.Type instance. Not strictly necessary, but reduces
memory usage and plays better with the rest of the compiler given the
current state of things.

Change-Id: I53686d072c7c7834b0c97417bc8d5f2cd24572b2
Reviewed-on: https://go-review.googlesource.com/c/go/+/284692
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/cmd/compile/internal/noder/irgen.go
src/cmd/compile/internal/noder/types.go