if (!obj)
return NULL;
- if (cfg->llvm_only) {
- MonoInst *args [16];
-
- /*
- * If the method to be called needs an rgctx, we can't fall back to mono_delegate_ctor (), since it might receive
- * the address of a gshared method. So use a JIT icall.
- * FIXME: Optimize this.
- */
- args [0] = obj;
- args [1] = target;
- args [2] = emit_get_rgctx_method (cfg, context_used, method, MONO_RGCTX_INFO_METHOD);
- mono_emit_jit_icall (cfg, virtual_ ? mono_llvmonly_init_delegate_virtual : mono_llvmonly_init_delegate, args);
-
- return obj;
- }
-
/* Inline the contents of mono_delegate_ctor */
/* Set target field */
MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STORE_MEMBASE_REG, obj->dreg, MONO_STRUCT_OFFSET (MonoDelegate, method_code), code_slot_ins->dreg);
}
+ if (cfg->llvm_only) {
+ MonoInst *args [16];
+
+ if (virtual_) {
+ args [0] = obj;
+ args [1] = target;
+ args [2] = emit_get_rgctx_method (cfg, context_used, method, MONO_RGCTX_INFO_METHOD);
+ mono_emit_jit_icall (cfg, mono_llvmonly_init_delegate_virtual, args);
+ } else {
+ args [0] = obj;
+ mono_emit_jit_icall (cfg, mono_llvmonly_init_delegate, args);
+ }
+
+ return obj;
+ }
+
if (cfg->compile_aot) {
MonoDelegateClassMethodPair *del_tramp;
if (managed_alloc)
ins = mono_emit_method_call (cfg, managed_alloc, args, NULL);
else
- ins = mono_emit_jit_icall (cfg, mono_array_new_specific, args);
+ ins = mono_emit_jit_icall (cfg, ves_icall_array_new_specific, args);
} else {
if (cfg->opt & MONO_OPT_SHARED) {
/* Decompose now to avoid problems with references to the domainvar */