+
/*
* mini-runtime.c: Runtime code for the JIT
*
* Copyright 2002-2003 Ximian, Inc.
* Copyright 2003-2010 Novell, Inc.
* Copyright 2011-2015 Xamarin, Inc (http://www.xamarin.com)
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
#include <config.h>
#ifdef MONO_ARCH_LLVM_SUPPORTED
#ifdef ENABLE_LLVM
#include "mini-llvm-cpp.h"
+#include "llvm-jit.h"
#endif
#endif
MonoVTable *vtable;
mono_jit_stats.methods_lookups++;
- vtable = mono_class_vtable (domain, method->klass);
+ vtable = mono_class_vtable_full (domain, method->klass, error);
+ if (!is_ok (error))
+ return NULL;
g_assert (vtable);
if (!mono_runtime_class_init_full (vtable, error))
return NULL;
}
g_slist_free (remove);
}
-
mono_domain_unlock (domain);
#ifdef MONO_ARCH_HAVE_INVALIDATE_METHOD
if (!info->dyn_call_info) {
if (mono_llvm_only) {
-#ifndef ENABLE_GSHAREDVT
+#ifndef MONO_ARCH_GSHAREDVT_SUPPORTED
g_assert_not_reached ();
#endif
info->gsharedvt_invoke = TRUE;
mono_error_set_exception_instance (error, (MonoException*) *exc);
if (sig->ret->type != MONO_TYPE_VOID && info->ret_box_class)
- return mono_value_box (domain, info->ret_box_class, retval);
+ return mono_value_box_checked (domain, info->ret_box_class, retval, error);
else
return *(MonoObject**)retval;
}
mono_arch_finish_dyn_call (info->dyn_call_info, buf);
if (info->ret_box_class)
- return mono_value_box (domain, info->ret_box_class, retval);
+ return mono_value_box_checked (domain, info->ret_box_class, retval, error);
else
return *(MonoObject**)retval;
}
}
#endif
-static void
+static G_GNUC_UNUSED void
no_imt_trampoline (void)
{
g_assert_not_reached ();
}
-static void
+static G_GNUC_UNUSED void
no_vcall_trampoline (void)
{
g_assert_not_reached ();
mono_align_small_structs = TRUE;
else if (!strcmp (option, "native-debugger-break"))
debug_options.native_debugger_break = TRUE;
+ else if (!strcmp (option, "disable_omit_fp"))
+ debug_options.disable_omit_fp = TRUE;
else
return FALSE;
g_free (info);
}
+static void
+free_jit_callee_list (gpointer key, gpointer value, gpointer user_data)
+{
+ g_slist_free (value);
+}
+
static void
mini_free_jit_domain_info (MonoDomain *domain)
{
mono_debugger_agent_free_domain_info (domain);
if (info->gsharedvt_arg_tramp_hash)
g_hash_table_destroy (info->gsharedvt_arg_tramp_hash);
+ if (info->llvm_jit_callees) {
+ g_hash_table_foreach (info->llvm_jit_callees, free_jit_callee_list, NULL);
+ g_hash_table_destroy (info->llvm_jit_callees);
+ }
#ifdef ENABLE_LLVM
mono_llvm_free_domain_info (domain);
#endif
void
mini_cleanup (MonoDomain *domain)
{
- mono_runtime_shutdown_stat_profiler ();
+ if (mono_profiler_get_events () & MONO_PROFILE_STATISTICAL)
+ mono_runtime_shutdown_stat_profiler ();
#ifndef DISABLE_COM
cominterop_release_all_rcws ();
/* This accesses metadata so needs to be called before runtime shutdown */
print_jit_stats ();
- mono_profiler_shutdown ();
-
#ifndef MONO_CROSS_COMPILE
mono_runtime_cleanup (domain);
#endif
+ mono_profiler_shutdown ();
+
free_jit_tls_data ((MonoJitTlsData *)mono_native_tls_get_value (mono_jit_tls_id));
mono_icall_cleanup ();