[runtime] Add a few mono mono_class_is_... accessors. (#3891)
[mono.git] / mono / mini / exceptions-arm64.c
index 717443c9a67dcfa6056ba65dc63f468457059ead..6e8889e0b24b78cfac214ff96c0084f4930c6704 100644 (file)
@@ -69,7 +69,7 @@ mono_arch_get_call_filter (MonoTrampInfo **info, gboolean aot)
 {
        guint8 *code;
        guint8* start;
-       int size, offset, gregs_offset, fregs_offset, ctx_offset, num_fregs, frame_size;
+       int i, size, offset, gregs_offset, fregs_offset, ctx_offset, num_fregs, frame_size;
        MonoJumpInfo *ji = NULL;
        GSList *unwind_ops = NULL;
 
@@ -105,10 +105,17 @@ mono_arch_get_call_filter (MonoTrampInfo **info, gboolean aot)
        arm_strx (code, ARMREG_R0, ARMREG_FP, ctx_offset);
        /* Save gregs */
        code = mono_arm_emit_store_regarray (code, MONO_ARCH_CALLEE_SAVED_REGS | (1 << ARMREG_FP), ARMREG_FP, gregs_offset);
+       /* Save fregs */
+       for (i = 0; i < num_fregs; ++i)
+               arm_strfpx (code, ARMREG_D8 + i, ARMREG_FP, fregs_offset + (i * 8));
+
        /* No need to save/restore fregs, since we don't currently use them */
 
        /* Load regs from ctx */
        code = mono_arm_emit_load_regarray (code, MONO_ARCH_CALLEE_SAVED_REGS, ARMREG_R0, MONO_STRUCT_OFFSET (MonoContext, regs));
+       /* Load fregs */
+       for (i = 0; i < num_fregs; ++i)
+               arm_ldrfpx (code, ARMREG_D8 + i, ARMREG_R0, MONO_STRUCT_OFFSET (MonoContext, fregs) + (i * 8));
        /* Load fp */
        arm_ldrx (code, ARMREG_FP, ARMREG_R0, MONO_STRUCT_OFFSET (MonoContext, regs) + (ARMREG_FP * 8));
 
@@ -126,6 +133,9 @@ mono_arch_get_call_filter (MonoTrampInfo **info, gboolean aot)
 
        /* Restore regs */
        code = mono_arm_emit_load_regarray (code, MONO_ARCH_CALLEE_SAVED_REGS, ARMREG_FP, gregs_offset);
+       /* Restore fregs */
+       for (i = 0; i < num_fregs; ++i)
+               arm_ldrfpx (code, ARMREG_D8 + i, ARMREG_FP, fregs_offset + (i * 8));
        /* Destroy frame */
        code = mono_arm_emit_destroy_frame (code, frame_size, (1 << ARMREG_IP0));
        arm_retx (code, ARMREG_LR);
@@ -378,8 +388,10 @@ mono_arm_throw_exception (gpointer arg, mgreg_t pc, mgreg_t *int_regs, gdouble *
 
        if (mono_object_isinst_checked (exc, mono_defaults.exception_class, &error)) {
                MonoException *mono_ex = (MonoException*)exc;
-               if (!rethrow)
+               if (!rethrow) {
                        mono_ex->stack_trace = NULL;
+                       mono_ex->trace_ips = NULL;
+               }
        }
        mono_error_assert_ok (&error);
 
@@ -500,18 +512,6 @@ mono_arch_unwind_frame (MonoDomain *domain, MonoJitTlsData *jit_tls,
        return FALSE;
 }
 
-void
-mono_arch_sigctx_to_monoctx (void *sigctx, MonoContext *mctx)
-{
-       mono_sigctx_to_monoctx (sigctx, mctx);
-}
-
-void
-mono_arch_monoctx_to_sigctx (MonoContext *mctx, void *sigctx)
-{
-       mono_monoctx_to_sigctx (mctx, sigctx);
-}
-
 /*
  * handle_exception:
  *
@@ -548,7 +548,7 @@ mono_arch_handle_exception (void *ctx, gpointer obj)
        jit_tls = mono_native_tls_get_value (mono_jit_tls_id);
 
        /* Pass the ctx parameter in TLS */
-       mono_arch_sigctx_to_monoctx (sigctx, &jit_tls->ex_ctx);
+       mono_sigctx_to_monoctx (sigctx, &jit_tls->ex_ctx);
        /* The others in registers */
        UCONTEXT_REG_R0 (sigctx) = (gsize)obj;