]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile: constant-fold loads from constant dictionaries and types
authorKeith Randall <khr@golang.org>
Tue, 2 May 2023 17:37:00 +0000 (17:37 +0000)
committerKeith Randall <khr@google.com>
Fri, 19 May 2023 18:10:11 +0000 (18:10 +0000)
commitbd3f44e4ffe54e9cf841ebc8356e403bb38436bd
treefa91f127398bdf3fd9058b37bd7a228f4ad2ae96
parentb60db8f7d92fb2c87b6f416ebb38a6924978aa8c
cmd/compile: constant-fold loads from constant dictionaries and types

Retrying the original CL with a small modification. The original CL
did not handle the case of reading an itab out of a dictionary
correctly.  When we read an itab out of a dictionary, we must treat
the type inside that itab as maybe being put in an interface.

Original CL: 486895
Revert CL: 490156

Change-Id: Id2dc1699d184cd8c63dac83986a70b60b4e6cbd7
Reviewed-on: https://go-review.googlesource.com/c/go/+/491495
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/cmd/compile/internal/noder/reader.go
src/cmd/compile/internal/reflectdata/reflect.go
src/cmd/compile/internal/ssa/_gen/generic.rules
src/cmd/compile/internal/ssa/rewrite.go
src/cmd/compile/internal/ssa/rewritegeneric.go
src/cmd/internal/obj/link.go
src/cmd/internal/objabi/reloctype.go
src/cmd/link/internal/ld/deadcode.go
src/cmd/link/internal/ld/decodesym.go
test/typeparam/devirtualize1.go [new file with mode: 0644]
test/typeparam/devirtualize2.go [new file with mode: 0644]