Get rid of the old mono_arch_find_jit_info functions + defines as all platforms suppo...
[mono.git] / mono / mini / exceptions-amd64.c
index ead2f7f54c1e113a78511f0632827c14676c0794..50be3d8839bf17395898c12882af3e153b3f5faf 100644 (file)
@@ -415,11 +415,13 @@ get_throw_trampoline (MonoTrampInfo **info, gboolean rethrow, gboolean corlib, g
 
        code = start;
 
-       unwind_ops = mono_arch_get_cie_program ();
+       if (info)
+               unwind_ops = mono_arch_get_cie_program ();
 
        /* Alloc frame */
        amd64_alu_reg_imm (code, X86_SUB, AMD64_RSP, stack_size);
-       mono_add_unwind_op_def_cfa_offset (unwind_ops, code, start, stack_size + 8);
+       if (info)
+               mono_add_unwind_op_def_cfa_offset (unwind_ops, code, start, stack_size + 8);
 
        /*
         * To hide linux/windows calling convention differences, we pass all arguments on
@@ -525,17 +527,15 @@ mono_arch_get_throw_corlib_exception (MonoTrampInfo **info, gboolean aot)
 }
 
 /*
- * mono_arch_find_jit_info_ext:
+ * mono_arch_find_jit_info:
  *
  * This function is used to gather information from @ctx, and store it in @frame_info.
  * It unwinds one stack frame, and stores the resulting context into @new_ctx. @lmf
  * is modified if needed.
  * Returns TRUE on success, FALSE otherwise.
- * This function is a version of mono_arch_find_jit_info () where all the results are
- * returned in a StackFrameInfo structure.
  */
 gboolean
-mono_arch_find_jit_info_ext (MonoDomain *domain, MonoJitTlsData *jit_tls, 
+mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls, 
                                                         MonoJitInfo *ji, MonoContext *ctx, 
                                                         MonoContext *new_ctx, MonoLMF **lmf, 
                                                         StackFrameInfo *frame)
@@ -721,29 +721,31 @@ handle_signal_exception (gpointer obj, gboolean test_only)
 gboolean
 mono_arch_handle_exception (void *sigctx, gpointer obj, gboolean test_only)
 {
-#if defined(MONO_ARCH_USE_SIGACTION) && defined(UCONTEXT_GREGS)
+#if defined(MONO_ARCH_USE_SIGACTION)
+       ucontext_t *ctx = (ucontext_t*)sigctx;
+
        /*
         * Handling the exception in the signal handler is problematic, since the original
         * signal is disabled, and we could run arbitrary code though the debugger. So
         * resume into the normal stack and do most work there if possible.
         */
        MonoJitTlsData *jit_tls = TlsGetValue (mono_jit_tls_id);
-       guint64 sp = UCONTEXT_REG_RSP (sigctx);
+       guint64 sp = UCONTEXT_REG_RSP (ctx);
 
        /* Pass the ctx parameter in TLS */
-       mono_arch_sigctx_to_monoctx (sigctx, &jit_tls->ex_ctx);
+       mono_arch_sigctx_to_monoctx (ctx, &jit_tls->ex_ctx);
        /* The others in registers */
-       UCONTEXT_REG_RDI (sigctx) = (guint64)obj;
-       UCONTEXT_REG_RSI (sigctx) = test_only;
+       UCONTEXT_REG_RDI (ctx) = (guint64)obj;
+       UCONTEXT_REG_RSI (ctx) = test_only;
 
        /* Allocate a stack frame below the red zone */
        sp -= 128;
        /* The stack should be unaligned */
        if (sp % 8 == 0)
                sp -= 8;
-       UCONTEXT_REG_RSP (sigctx) = sp;
+       UCONTEXT_REG_RSP (ctx) = sp;
 
-       UCONTEXT_REG_RIP (sigctx) = (guint64)handle_signal_exception;
+       UCONTEXT_REG_RIP (ctx) = (guint64)handle_signal_exception;
 
        return TRUE;
 #else