(obj->vtable->klass == mono_defaults.threadabortexception_class)) {
mono_thread_exit ();
} else {
- MonoObject *other = NULL;
- MonoString *str = mono_object_to_string (obj, &other);
- if (str) {
- char *msg = mono_string_to_utf8 (str);
- fprintf (stderr, "[ERROR] FATAL UNHANDLED EXCEPTION: %s\n", msg);
- fflush (stderr);
- g_free (msg);
- }
-
- exit (mono_environment_exitcode_get ());
+ mono_invoke_unhandled_exception_hook (obj);
}
}
InterlockedIncrement (&mono_jit_stats.methods_compiled);
if (mono_profiler_get_events () & MONO_PROFILE_JIT_COMPILATION)
mono_profiler_method_jit (method);
- if (MONO_PROBE_METHOD_COMPILE_BEGIN_ENABLED ())
+ if (MONO_METHOD_COMPILE_BEGIN_ENABLED ())
MONO_PROBE_METHOD_COMPILE_BEGIN (method);
if (compile_aot)
cfg->exception_type = MONO_EXCEPTION_TYPE_LOAD;
cfg->exception_message = g_strdup (mono_error_get_message (&err));
mono_error_cleanup (&err);
- if (MONO_PROBE_METHOD_COMPILE_END_ENABLED ())
+ if (MONO_METHOD_COMPILE_END_ENABLED ())
MONO_PROBE_METHOD_COMPILE_END (method, FALSE);
return cfg;
}
cfg->exception_type = MONO_EXCEPTION_INVALID_PROGRAM;
cfg->exception_message = g_strdup_printf ("Missing or incorrect header for method %s", cfg->method->name);
}
- if (MONO_PROBE_METHOD_COMPILE_END_ENABLED ())
+ if (MONO_METHOD_COMPILE_END_ENABLED ())
MONO_PROBE_METHOD_COMPILE_END (method, FALSE);
return cfg;
}
if (i < 0) {
if (try_generic_shared && cfg->exception_type == MONO_EXCEPTION_GENERIC_SHARING_FAILED) {
if (compile_aot) {
- if (MONO_PROBE_METHOD_COMPILE_END_ENABLED ())
+ if (MONO_METHOD_COMPILE_END_ENABLED ())
MONO_PROBE_METHOD_COMPILE_END (method, FALSE);
return cfg;
}
}
g_assert (cfg->exception_type != MONO_EXCEPTION_GENERIC_SHARING_FAILED);
- if (MONO_PROBE_METHOD_COMPILE_END_ENABLED ())
+ if (MONO_METHOD_COMPILE_END_ENABLED ())
MONO_PROBE_METHOD_COMPILE_END (method, FALSE);
/* cfg contains the details of the failure, so let the caller cleanup */
return cfg;
/* after method_to_ir */
if (parts == 1) {
- if (MONO_PROBE_METHOD_COMPILE_END_ENABLED ())
+ if (MONO_METHOD_COMPILE_END_ENABLED ())
MONO_PROBE_METHOD_COMPILE_END (method, TRUE);
return cfg;
}
/* after SSA translation */
if (parts == 2) {
- if (MONO_PROBE_METHOD_COMPILE_END_ENABLED ())
+ if (MONO_METHOD_COMPILE_END_ENABLED ())
MONO_PROBE_METHOD_COMPILE_END (method, TRUE);
return cfg;
}
/* after SSA removal */
if (parts == 3) {
- if (MONO_PROBE_METHOD_COMPILE_END_ENABLED ())
+ if (MONO_METHOD_COMPILE_END_ENABLED ())
MONO_PROBE_METHOD_COMPILE_END (method, TRUE);
return cfg;
}
}
/* collect statistics */
+#ifndef DISABLE_PERFCOUNTERS
mono_perfcounters->jit_methods++;
mono_perfcounters->jit_bytes += header->code_size;
+#endif
mono_jit_stats.allocated_code_size += cfg->code_len;
code_size_ratio = cfg->code_len;
if (code_size_ratio > mono_jit_stats.biggest_method_size && mono_jit_stats.enabled) {
}
mono_jit_stats.native_code_size += cfg->code_len;
- if (MONO_PROBE_METHOD_COMPILE_END_ENABLED ())
+ if (MONO_METHOD_COMPILE_END_ENABLED ())
MONO_PROBE_METHOD_COMPILE_END (method, TRUE);
return cfg;
if (mono_aot_only) {
char *fullname = mono_method_full_name (method, TRUE);
- char *msg = g_strdup_printf ("Attempting to JIT compile method '%s' while running with --aot-only.\n", fullname);
+ char *msg = g_strdup_printf ("Attempting to JIT compile method '%s' while running with --aot-only. See http://docs.xamarin.com/ios/about/limitations for more information.\n", fullname);
*jit_ex = mono_get_exception_execution_engine (msg);
g_free (fullname);
invalidated_delegate_trampoline (char *desc)
{
g_error ("Unmanaged code called delegate of type %s which was already garbage collected.\n"
- "See http://www.go-mono.com/delegate.html for an explanation and ways to fix this.",
+ "See http://www.mono-project.com/Diagnostic:Delegate for an explanation and ways to fix this.",
desc);
}
#endif
MonoRuntimeCallbacks callbacks;
MonoThreadInfoRuntimeCallbacks ticallbacks;
- MONO_PROBE_VES_INIT_BEGIN ();
+ MONO_VES_INIT_BEGIN ();
#if defined(__linux__) && !defined(__native_client__)
if (access ("/proc/self/maps", F_OK) != 0) {
g_thread_init (NULL);
mono_native_tls_alloc (&mono_jit_tls_id, NULL);
- setup_jit_tls_data ((gpointer)-1, mono_thread_abort);
if (default_opt & MONO_OPT_AOT)
mono_aot_init ();
mono_add_internal_call ("Mono.Runtime::mono_runtime_install_handlers",
mono_runtime_install_handlers);
+#ifdef PLATFORM_ANDROID
+ mono_add_internal_call ("System.Diagnostics.Debugger::Mono_UnhandledException_internal",
+ mono_debugger_agent_unhandled_exception);
+#endif
+
mono_create_helper_signatures ();
register_jit_stats ();
mono_profiler_runtime_initialized ();
- MONO_PROBE_VES_INIT_END ();
+ MONO_VES_INIT_END ();
return domain;
}