mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
Revert "cmd/compile: de-virtualize interface calls"
This reverts commit 4e0c7c3f61.
Reason for revert: The presence-of-optimization test program is fragile, breaks under noopt, and might break if the Go libraries are tweaked. It needs to be (re)written without reference to other packages.
Change-Id: I3aaf1ab006a1a255f961a978e9c984341740e3c7
Reviewed-on: https://go-review.googlesource.com/38097
Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
parent
118b3fe7bb
commit
b59a405656
10 changed files with 17 additions and 259 deletions
|
|
@ -1684,6 +1684,7 @@ func structargs(tl *Type, mustname bool) []*Node {
|
|||
// rcvr - U
|
||||
// method - M func (t T)(), a TFIELD type struct
|
||||
// newnam - the eventual mangled name of this function
|
||||
|
||||
func genwrapper(rcvr *Type, method *Field, newnam *Sym, iface int) {
|
||||
if false && Debug['r'] != 0 {
|
||||
fmt.Printf("genwrapper rcvrtype=%v method=%v newnam=%v\n", rcvr, method, newnam)
|
||||
|
|
@ -1719,7 +1720,6 @@ func genwrapper(rcvr *Type, method *Field, newnam *Sym, iface int) {
|
|||
fn.Func.Nname = newname(newnam)
|
||||
fn.Func.Nname.Name.Defn = fn
|
||||
fn.Func.Nname.Name.Param.Ntype = t
|
||||
fn.Func.Nname.Sym.SetExported(true) // prevent export; see closure.go
|
||||
declare(fn.Func.Nname, PFUNC)
|
||||
funchdr(fn)
|
||||
|
||||
|
|
@ -1923,14 +1923,6 @@ func implements(t, iface *Type, m, samename **Field, ptr *int) bool {
|
|||
}
|
||||
}
|
||||
|
||||
// We're going to emit an OCONVIFACE.
|
||||
// Call itabname so that (t, iface)
|
||||
// gets added to itabs early, which allows
|
||||
// us to de-virtualize calls through this
|
||||
// type/interface pair later. See peekitabs in reflect.go
|
||||
if isdirectiface(t0) && !iface.IsEmptyInterface() {
|
||||
itabname(t0, iface)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue