diff options
author | Zoltan Varga <vargaz@gmail.com> | 2013-03-25 01:54:57 +0400 |
---|---|---|
committer | Zoltan Varga <vargaz@gmail.com> | 2013-03-25 01:55:08 +0400 |
commit | b831ead5a9bec0d12cf8cf79dc76eed186092099 (patch) | |
tree | 43a4b3a3c33716f20d831b6fcb2ef89d7934ac8b | |
parent | 9dc360146f373e64b2b8801a4284938759bc5229 (diff) |
Avoid using an rgctx when making delegate invokes from shared code, the delegate trampoline code already handles this.
-rw-r--r-- | mono/mini/method-to-ir.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/mono/mini/method-to-ir.c b/mono/mini/method-to-ir.c index 2b8a72a7ff0..c57768c550e 100644 --- a/mono/mini/method-to-ir.c +++ b/mono/mini/method-to-ir.c @@ -7109,6 +7109,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b gboolean emit_widen = TRUE; gboolean push_res = TRUE; gboolean skip_ret = FALSE; + gboolean delegate_invoke = FALSE; CHECK_OPSIZE (5); token = read32 (ip + 1); @@ -7365,6 +7366,11 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b if (!calli && check_call_signature (cfg, fsig, sp)) UNVERIFIED; +#ifdef MONO_ARCH_HAVE_CREATE_DELEGATE_TRAMPOLINE + if (cmethod && (cmethod->klass->parent == mono_defaults.multicastdelegate_class) && !strcmp (cmethod->name, "Invoke")) + delegate_invoke = TRUE; +#endif + if (cmethod && (cfg->opt & MONO_OPT_INTRINS) && (ins = mini_emit_inst_for_sharable_method (cfg, cmethod, fsig, sp))) { bblock = cfg->cbb; if (!MONO_TYPE_IS_VOID (fsig->ret)) { @@ -7719,7 +7725,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b /* Generic sharing */ /* FIXME: only do this for generic methods if they are not shared! */ - if (context_used && !imt_arg && !array_rank && + if (context_used && !imt_arg && !array_rank && !delegate_invoke && (!mono_method_is_generic_sharable_impl (cmethod, TRUE) || !mono_class_generic_sharing_enabled (cmethod->klass)) && (!virtual || MONO_METHOD_IS_FINAL (cmethod) || |