Skip to content

Commit 6ef2d07

Browse files
authored
[mono][jit] Don't try to do devirt for Delegate.Invoke (). (#83026)
The optimized delegate calling code in mini_emit_method_call_full () expects calls to Invoke to stay a virtual call.
1 parent a1d1a8d commit 6ef2d07

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/mono/mono/mini/method-to-ir.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5816,7 +5816,8 @@ try_prepare_objaddr_callvirt_optimization (MonoCompile *cfg, guchar *next_ip, gu
58165816
if (!iface_method ||
58175817
iface_method->is_generic ||
58185818
iface_method->dynamic || // Reflection.Emit-generated methods should have this flag
5819-
!strcmp (iface_method->name, "GetHashCode")) // the callvirt handler itself optimizes those
5819+
!strcmp (iface_method->name, "GetHashCode") || // the callvirt handler itself optimizes those
5820+
(iface_method->iflags & METHOD_IMPL_ATTRIBUTE_RUNTIME))
58205821
return NULL;
58215822

58225823
MonoMethodSignature* iface_method_sig;

0 commit comments

Comments
 (0)