Merge pull request #2948 from ludovic-henry/coop-n2m-eh-callback
[mono.git] / mono / mini / mini-runtime.c
index 2aba264d1f0747a3bf419415731ebe775a94bc61..71c9e6bcceee9e21b165f6acdd16cb613f6beba3 100644 (file)
@@ -951,7 +951,7 @@ mono_jit_thread_attach (MonoDomain *domain, gpointer *dummy)
 
                        /* mono_threads_reset_blocking_start returns the current MonoThreadInfo
                         * if we were in BLOCKING mode */
-                       return mono_thread_info_current ();
+                       return mono_threads_cookie_for_reset_blocking_start (mono_thread_info_current (), 1);
                } else {
                        orig = mono_domain_get ();
 
@@ -1112,8 +1112,6 @@ mono_thread_attach_cb (intptr_t tid, gpointer stack_start)
        thread = mono_thread_info_current_unchecked ();
        if (thread)
                thread->jit_data = jit_tls;
-       if (mono_profiler_get_events () & MONO_PROFILE_STATISTICAL)
-               mono_runtime_setup_stat_profiler ();
 
        mono_arch_cpu_init ();
 }
@@ -3840,6 +3838,9 @@ mini_init (const char *filename, const char *runtime_version)
        mono_thread_attach (domain);
 #endif
 
+       if (mono_profiler_get_events () & MONO_PROFILE_STATISTICAL)
+               mono_runtime_setup_stat_profiler ();
+
        mono_profiler_runtime_initialized ();
 
        MONO_VES_INIT_END ();
@@ -3900,8 +3901,8 @@ register_icalls (void)
        register_icall (mono_thread_interruption_checkpoint, "mono_thread_interruption_checkpoint", "object", FALSE);
        register_icall (mono_thread_force_interruption_checkpoint_noraise, "mono_thread_force_interruption_checkpoint_noraise", "object", FALSE);
 #ifndef DISABLE_REMOTING
-       register_icall (mono_load_remote_field_new, "mono_load_remote_field_new", "object object ptr ptr", FALSE);
-       register_icall (mono_store_remote_field_new, "mono_store_remote_field_new", "void object ptr ptr object", FALSE);
+       register_icall (mono_load_remote_field_new_icall, "mono_load_remote_field_new_icall", "object object ptr ptr", FALSE);
+       register_icall (mono_store_remote_field_new_icall, "mono_store_remote_field_new_icall", "void object ptr ptr object", FALSE);
 #endif
 
 #if defined(__native_client__) || defined(__native_client_codegen__)
@@ -4050,7 +4051,7 @@ register_icalls (void)
        register_icall (mono_helper_stelem_ref_check, "mono_helper_stelem_ref_check", "void object object", FALSE);
        register_icall (ves_icall_object_new, "ves_icall_object_new", "object ptr ptr", FALSE);
        register_icall (ves_icall_object_new_specific, "ves_icall_object_new_specific", "object ptr", FALSE);
-       register_icall (mono_array_new, "mono_array_new", "object ptr ptr int32", FALSE);
+       register_icall (ves_icall_array_new, "ves_icall_array_new", "object ptr ptr int32", FALSE);
        register_icall (ves_icall_array_new_specific, "ves_icall_array_new_specific", "object ptr int32", FALSE);
        register_icall (ves_icall_runtime_class_init, "ves_icall_runtime_class_init", "void ptr", FALSE);
        register_icall (mono_ldftn, "mono_ldftn", "ptr ptr", FALSE);