MINI_BEGIN_CODEGEN ();
if (has_target) {
- start = code = mono_global_codeman_reserve (12);
+ int size = 16;
+ start = code = mono_global_codeman_reserve (size);
/* Replace the this argument with the target */
+ arm_dmb (code, ARM_DMB_ISHLD);
arm_ldrx (code, ARMREG_IP0, ARMREG_R0, MONO_STRUCT_OFFSET (MonoDelegate, method_ptr));
arm_ldrx (code, ARMREG_R0, ARMREG_R0, MONO_STRUCT_OFFSET (MonoDelegate, target));
code = mono_arm_emit_brx (code, ARMREG_IP0);
- g_assert ((code - start) <= 12);
+ g_assert ((code - start) <= size);
} else {
int size, i;
code = (guint8 *)mini_add_method_trampoline (m, code, mono_method_needs_static_rgctx_invoke (m, FALSE), FALSE);
}
+ mono_memory_barrier ();
+
delegate->invoke_impl = mono_get_addr_from_ftnptr (code);
if (enable_caching && !callvirt && tramp_info->method) {
tramp_info->method_ptr = delegate->method_ptr;