}
break;
}
+ case LLVMArgAsIArgs:
+ ret_type = LLVMArrayType (IntPtrType (), cinfo->ret.nslots);
+ break;
case LLVMArgFpStruct: {
/* Vtype returned as a fp struct */
LLVMTypeRef members [16];
target =
mono_create_jit_trampoline (mono_domain_get (),
call->method, &error);
- if (!mono_error_ok (&error))
- mono_error_raise_exception (&error); /* FIXME: Don't raise here */
+ if (!is_ok (&error)) {
+ set_failure (ctx, mono_error_get_message (&error));
+ mono_error_cleanup (&error);
+ return;
+ }
+
tramp_var = LLVMAddGlobal (ctx->lmodule, LLVMPointerType (llvm_sig, 0), name);
LLVMSetInitializer (tramp_var, LLVMConstIntToPtr (LLVMConstInt (LLVMInt64Type (), (guint64)(size_t)target, FALSE), LLVMPointerType (llvm_sig, 0)));
LLVMSetLinkage (tramp_var, LLVMExternalLinkage);
#else
target =
mono_create_jit_trampoline (mono_domain_get (),
- call->method, &error);
- if (!mono_error_ok (&error))
- mono_error_raise_exception (&error); /* FIXME: Don't raise here */
+ call->method, &error);
+ if (!is_ok (&error)) {
+ g_free (name);
+ set_failure (ctx, mono_error_get_message (&error));
+ mono_error_cleanup (&error);
+ return;
+ }
callee = LLVMAddFunction (ctx->lmodule, name, llvm_sig);
g_free (name);
- if (!mono_error_ok (&error))
- mono_error_raise_exception (&error); /* FIXME: Don't raise here */
LLVMAddGlobalMapping (ctx->module->ee, callee, target);
#endif
}
addresses [call->inst.dreg] = build_alloca (ctx, sig->ret);
LLVMBuildStore (builder, lcall, addresses [call->inst.dreg]);
break;
+ case LLVMArgAsIArgs:
case LLVMArgFpStruct:
if (!addresses [call->inst.dreg])
addresses [call->inst.dreg] = build_alloca (ctx, sig->ret);
LLVMBuildRetVoid (builder);
break;
}
+ case LLVMArgAsIArgs:
case LLVMArgFpStruct: {
LLVMTypeRef ret_type = LLVMGetReturnType (LLVMGetElementType (LLVMTypeOf (method)));
LLVMValueRef retval;
ji = mono_aot_patch_info_dup (tmp_ji);
g_free (tmp_ji);
+ if (ji->type == MONO_PATCH_INFO_ICALL_ADDR) {
+ char *symbol = mono_aot_get_direct_call_symbol (MONO_PATCH_INFO_ICALL_ADDR_CALL, ji->data.target);
+ if (symbol) {
+ /*
+ * Avoid emitting a got entry for these since the method is directly called, and it might not be
+ * resolvable at runtime using dlsym ().
+ */
+ g_free (symbol);
+ values [ins->dreg] = LLVMConstInt (IntPtrType (), 0, FALSE);
+ break;
+ }
+ }
+
ji->next = cfg->patch_info;
cfg->patch_info = ji;
// FIXME: beforefieldinit
if (ctx->has_got_access || mono_class_get_cctor (cfg->method->klass)) {
+ /*
+ * linkonce methods shouldn't have initialization,
+ * because they might belong to assemblies which
+ * haven't been loaded yet.
+ */
+ g_assert (!ctx->is_linkonce);
emit_init_method (ctx);
} else {
LLVMBuildBr (ctx->builder, ctx->inited_bb);
add_intrinsic (LLVMModuleRef module, int id)
{
const char *name;
+#if defined(TARGET_AMD64) || defined(TARGET_X86)
LLVMTypeRef ret_type, arg_types [16];
+#endif
name = g_hash_table_lookup (intrins_id_to_name, GINT_TO_POINTER (id));
g_assert (name);