[mini] Handle magic interfaces in common_trampoline as if they were variant.
authorRodrigo Kumpera <kumpera@gmail.com>
Thu, 31 Aug 2017 23:06:58 +0000 (16:06 -0700)
committerRodrigo Kumpera <kumpera@gmail.com>
Fri, 1 Sep 2017 16:06:53 +0000 (09:06 -0700)
commite64e3dbaca04061854aa9b3764fd415d6e7119a9
tree4dba4cfa217bb7440cb605ab7cfe0d0474a30216
parent7b759ee9d39e98611dca9d900d89e157366704e4
[mini] Handle magic interfaces in common_trampoline as if they were variant.

With the introduction of magic array interfaces, they must be handled as if they
were variant if they are being dispatched against an array.

This was not being done in common_trampoline and resulted in the IMT thunk never
getting rebuilt and getting decent perf.

With this patch, dispatch to simple methods such as Array::Count over a magic interface
in a covariant case (such as IList<object> dispatch onto string[]) will accrue gvi's.

On a trivial benchmark of executing Count 1M times, perf goes from 760ms to 50ms.
mono/mini/mini-trampolines.c