cmd/compile: initialize ACArgs and ACResults AuxCall fields for static and interface calls.

Extend use of AuxCall

Change-Id: I68b6d9bad09506532e1415fd70d44cf6c15b4b93
Reviewed-on: https://go-review.googlesource.com/c/go/+/239081
Trust: David Chase <drchase@google.com>
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
This commit is contained in:
David Chase 2020-06-19 15:29:51 -04:00
parent 3c85e995ef
commit acde81e0a9
7 changed files with 102 additions and 29 deletions

View file

@ -8479,11 +8479,12 @@ func rewriteValuegeneric_OpIMake(v *Value) bool {
func rewriteValuegeneric_OpInterCall(v *Value) bool {
v_1 := v.Args[1]
v_0 := v.Args[0]
// match: (InterCall [argsize] (Load (OffPtr [off] (ITab (IMake (Addr {itab} (SB)) _))) _) mem)
// cond: devirt(v, itab, off) != nil
// result: (StaticCall [int32(argsize)] {devirt(v, itab, off)} mem)
// match: (InterCall [argsize] {auxCall} (Load (OffPtr [off] (ITab (IMake (Addr {itab} (SB)) _))) _) mem)
// cond: devirt(v, auxCall, itab, off) != nil
// result: (StaticCall [int32(argsize)] {devirt(v, auxCall, itab, off)} mem)
for {
argsize := auxIntToInt32(v.AuxInt)
auxCall := auxToCall(v.Aux)
if v_0.Op != OpLoad {
break
}
@ -8510,12 +8511,12 @@ func rewriteValuegeneric_OpInterCall(v *Value) bool {
break
}
mem := v_1
if !(devirt(v, itab, off) != nil) {
if !(devirt(v, auxCall, itab, off) != nil) {
break
}
v.reset(OpStaticCall)
v.AuxInt = int32ToAuxInt(int32(argsize))
v.Aux = callToAux(devirt(v, itab, off))
v.Aux = callToAux(devirt(v, auxCall, itab, off))
v.AddArg(mem)
return true
}