Merge pull request #1668 from alexanderkyte/bug1856
[mono.git] / mono / mini / exceptions-x86.c
index f79e06cb22605a8a8da555b1df265ce6de6605ea..d7d4f72d299091b426195e49712a4002b98c0eda 100644 (file)
@@ -109,6 +109,9 @@ mono_win32_get_handle_stackoverflow (void)
        /* return */
        x86_ret (code);
 
+       mono_arch_flush_icache (start, code - start);
+       mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL);
+
        return start;
 }
 
@@ -354,6 +357,9 @@ mono_arch_get_restore_context (MonoTrampInfo **info, gboolean aot)
                g_slist_free (unwind_ops);
        }
 
+       mono_arch_flush_icache (start, code - start);
+       mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL);
+
        return start;
 }
 
@@ -431,6 +437,9 @@ mono_arch_get_call_filter (MonoTrampInfo **info, gboolean aot)
                g_slist_free (unwind_ops);
        }
 
+       mono_arch_flush_icache (start, code - start);
+       mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL);
+
        g_assert ((code - start) < kMaxCodeSize);
        return start;
 }
@@ -655,6 +664,9 @@ get_throw_trampoline (const char *name, gboolean rethrow, gboolean llvm, gboolea
                g_slist_free (unwind_ops);
        }
 
+       mono_arch_flush_icache (start, code - start);
+       mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL);
+
        return start;
 }
 
@@ -708,7 +720,7 @@ mono_arch_exceptions_init (void)
  * for SEHs to behave. This requires hotfix http://support.microsoft.com/kb/976038
  * or (eventually) Windows 7 SP1.
  */
-#ifdef HOST_WIN32
+#ifdef TARGET_WIN32
        DWORD flags;
        FARPROC getter;
        FARPROC setter;
@@ -945,6 +957,9 @@ mono_x86_get_signal_exception_trampoline (MonoTrampInfo **info, gboolean aot)
                g_slist_free (unwind_ops);
        }
 
+       mono_arch_flush_icache (start, code - start);
+       mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL);
+
        return start;
 }