gboolean mono_compile_aot = FALSE;
/* If this is set, no code is generated dynamically, everything is taken from AOT files */
gboolean mono_aot_only = FALSE;
-/* Whenever to use IMT */
-gboolean mono_use_imt = TRUE;
+
const char *mono_build_date;
gboolean mono_do_signal_chaining;
gboolean mono_do_crash_chaining;
static void
mono_thread_start_cb (intptr_t tid, gpointer stack_start, gpointer func)
{
- MonoInternalThread *thread;
+ MonoThreadInfo *thread;
void *jit_tls = setup_jit_tls_data (stack_start, mono_thread_abort);
- thread = mono_thread_internal_current ();
+ thread = mono_thread_info_current_unchecked ();
if (thread)
thread->jit_data = jit_tls;
static void
mono_thread_attach_cb (intptr_t tid, gpointer stack_start)
{
- MonoInternalThread *thread;
+ MonoThreadInfo *thread;
void *jit_tls = setup_jit_tls_data (stack_start, mono_thread_abort_dummy);
- thread = mono_thread_internal_current ();
+ thread = mono_thread_info_current_unchecked ();
if (thread)
thread->jit_data = jit_tls;
if (mono_profiler_get_events () & MONO_PROFILE_STATISTICAL)
}
static void
-mini_thread_cleanup (MonoInternalThread *thread)
+mini_thread_cleanup (MonoNativeThreadId tid)
{
- MonoJitTlsData *jit_tls = thread->jit_data;
+ MonoJitTlsData *jit_tls = NULL;
+ MonoThreadInfo *info;
- if (jit_tls) {
- /* We can't clean up tls information if we are on another thread, it will clean up the wrong stuff
- * It would be nice to issue a warning when this happens outside of the shutdown sequence. but it's
- * not a trivial thing.
- *
- * The current offender is mono_thread_manage which cleanup threads from the outside.
- */
- if (thread == mono_thread_internal_current ())
- mono_set_jit_tls (NULL);
+ info = mono_thread_info_current_unchecked ();
+
+ /* We can't clean up tls information if we are on another thread, it will clean up the wrong stuff
+ * It would be nice to issue a warning when this happens outside of the shutdown sequence. but it's
+ * not a trivial thing.
+ *
+ * The current offender is mono_thread_manage which cleanup threads from the outside.
+ */
+ if (info && mono_thread_info_get_tid (info) == tid) {
+ jit_tls = info->jit_data;
+ info->jit_data = NULL;
+
+ mono_set_jit_tls (NULL);
/* If we attach a thread but never call into managed land, we might never get an lmf.*/
if (mono_get_lmf ()) {
mono_set_lmf (NULL);
mono_set_lmf_addr (NULL);
}
+ } else {
+ info = mono_thread_info_lookup (tid);
+ if (info) {
+ jit_tls = info->jit_data;
+ info->jit_data = NULL;
+ }
+ mono_hazard_pointer_clear (mono_hazard_pointer_get (), 1);
+ }
+ if (jit_tls)
free_jit_tls_data (jit_tls);
-
- thread->jit_data = NULL;
- }
}
int
//memcpy (info->locals_types, oinfo->locals_types, info->nlocals * sizeof (MonoType*));
break;
}
+ case MONO_PATCH_INFO_VIRT_METHOD: {
+ MonoJumpInfoVirtMethod *info;
+ MonoJumpInfoVirtMethod *oinfo;
+
+ oinfo = patch_info->data.virt_method;
+ info = mono_mempool_alloc0 (mp, sizeof (MonoJumpInfoVirtMethod));
+ res->data.virt_method = info;
+ memcpy (info, oinfo, sizeof (MonoJumpInfoVirtMethod));
+ break;
+ }
default:
break;
}
case MONO_PATCH_INFO_INTERRUPTION_REQUEST_FLAG:
case MONO_PATCH_INFO_MSCORLIB_GOT_ADDR:
case MONO_PATCH_INFO_GC_CARD_TABLE_ADDR:
+ case MONO_PATCH_INFO_GC_NURSERY_START:
case MONO_PATCH_INFO_JIT_TLS_ID:
case MONO_PATCH_INFO_MONITOR_ENTER:
case MONO_PATCH_INFO_MONITOR_ENTER_V4:
return (ji->type << 8) | (gsize)ji->data.del_tramp->klass | (gsize)ji->data.del_tramp->method | (gsize)ji->data.del_tramp->virtual;
case MONO_PATCH_INFO_LDSTR_LIT:
return g_str_hash (ji->data.target);
+ case MONO_PATCH_INFO_VIRT_METHOD: {
+ MonoJumpInfoVirtMethod *info = ji->data.virt_method;
+
+ return (ji->type << 8) | (gssize)info->klass | (gssize)info->method;
+ }
default:
printf ("info type: %d\n", ji->type);
mono_print_ji (ji); printf ("\n");
return ji1->data.del_tramp->klass == ji2->data.del_tramp->klass && ji1->data.del_tramp->method == ji2->data.del_tramp->method && ji1->data.del_tramp->virtual == ji2->data.del_tramp->virtual;
case MONO_PATCH_INFO_CASTCLASS_CACHE:
return ji1->data.index == ji2->data.index;
+ case MONO_PATCH_INFO_VIRT_METHOD:
+ return ji1->data.virt_method->klass == ji2->data.virt_method->klass && ji1->data.virt_method->method == ji2->data.virt_method->method;
default:
if (ji1->data.target != ji2->data.target)
return 0;
slot = mono_method_lookup_or_register_info (entry->method, entry->in_mrgctx, info, entry->info_type, mono_method_get_context (entry->method));
break;
}
+ case MONO_PATCH_INFO_VIRT_METHOD: {
+ MonoJumpInfoVirtMethod *info;
+ MonoJumpInfoVirtMethod *oinfo = entry->data->data.virt_method;
+
+ info = g_malloc0 (sizeof (MonoJumpInfoVirtMethod));
+ memcpy (info, oinfo, sizeof (MonoJumpInfoVirtMethod));
+ slot = mono_method_lookup_or_register_info (entry->method, entry->in_mrgctx, info, entry->info_type, mono_method_get_context (entry->method));
+ break;
+ }
default:
g_assert_not_reached ();
break;
target = mono_gc_get_card_table (&card_table_shift_bits, &card_table_mask);
break;
}
+ case MONO_PATCH_INFO_GC_NURSERY_START: {
+ int shift_bits;
+ size_t size;
+
+ target = mono_gc_get_nursery (&shift_bits, &size);
+ break;
+ }
case MONO_PATCH_INFO_CASTCLASS_CACHE: {
target = mono_domain_alloc0 (domain, sizeof (gpointer));
break;
return ji;
}
+MonoJitInfo *
+mono_get_jit_info_from_method (MonoDomain *domain, MonoMethod *method)
+{
+ return lookup_method (domain, method);
+}
+
#if ENABLE_JIT_MAP
static FILE* perf_map_file;
else if (!strcmp (arg, "explicit-null-checks"))
debug_options.explicit_null_checks = TRUE;
else if (!strcmp (arg, "gen-seq-points"))
- debug_options.gen_seq_points_debug_data = TRUE;
+ debug_options.gen_sdb_seq_points = TRUE;
else if (!strcmp (arg, "gen-compact-seq-points"))
debug_options.gen_seq_points_compact_data = TRUE;
else if (!strcmp (arg, "init-stacks"))
callbacks.debug_log_is_enabled = mono_debugger_agent_debug_log_is_enabled;
callbacks.tls_key_supported = mini_tls_key_supported;
- if (mono_use_imt) {
- callbacks.get_vtable_trampoline = mini_get_vtable_trampoline;
- callbacks.get_imt_trampoline = mini_get_imt_trampoline;
- }
+ callbacks.get_vtable_trampoline = mini_get_vtable_trampoline;
+ callbacks.get_imt_trampoline = mini_get_imt_trampoline;
mono_install_callbacks (&callbacks);
mono_unwind_init ();
+#ifdef XDEBUG_ENABLED
if (g_getenv ("MONO_XDEBUG")) {
const char *xdebug_opts = g_getenv ("MONO_XDEBUG");
mono_xdebug_init (xdebug_opts);
mono_dont_free_domains = TRUE;
mono_using_xdebug = TRUE;
}
+#endif
#ifdef ENABLE_LLVM
if (mono_use_llvm) {
mono_marshal_use_aot_wrappers (TRUE);
}
- if (mono_use_imt) {
- if (mono_aot_only)
- mono_install_imt_thunk_builder (mono_aot_get_imt_thunk);
- else
- mono_install_imt_thunk_builder (mono_arch_build_imt_thunk);
- }
+ if (mono_aot_only)
+ mono_install_imt_thunk_builder (mono_aot_get_imt_thunk);
+ else
+ mono_install_imt_thunk_builder (mono_arch_build_imt_thunk);
/*Init arch tls information only after the metadata side is inited to make sure we see dynamic appdomain tls keys*/
mono_arch_finish_init ();