2 * exceptions-mips.c: exception support for MIPS
5 * Mark Mason (mason@broadcom.com)
7 * Based on exceptions-ppc.c by:
8 * Dietmar Maurer (dietmar@ximian.com)
9 * Paolo Molaro (lupus@ximian.com)
12 * (C) 2001 Ximian, Inc.
21 #include <mono/arch/mips/mips-codegen.h>
22 #include <mono/metadata/appdomain.h>
23 #include <mono/metadata/tabledefs.h>
24 #include <mono/metadata/threads.h>
25 #include <mono/metadata/debug-helpers.h>
26 #include <mono/metadata/exception.h>
27 #include <mono/metadata/mono-debug.h>
30 #include "mini-mips.h"
32 #define GENERIC_EXCEPTION_SIZE 256
34 #ifdef CUSTOM_EXCEPTION_HANDLING
35 static gboolean arch_handle_exception (MonoContext *ctx, gpointer obj, gboolean test_only);
40 #define restore_regs_from_context(ctx_reg,ip_reg,tmp_reg) do { \
43 #define restore_regs_from_context(ctx_reg,pc,tmp_reg) do { \
45 ppc_lwz (code, pc, G_STRUCT_OFFSET (MonoContext, sc_pc), ctx_reg); \
46 ppc_lmw (code, ppc_r13, ctx_reg, G_STRUCT_OFFSET (MonoContext, sc_regs)); \
47 for (reg = 0; reg < MONO_SAVED_FREGS; ++reg) { \
48 ppc_lfd (code, (14 + reg), G_STRUCT_OFFSET(MonoLMF, sc_fpregs) + reg * sizeof (gdouble), ctx_reg); \
54 #define setup_context(ctx) do { \
55 memset ((ctx), 0, sizeof(*(ctx))); \
59 * mono_arch_get_restore_context:
61 * Returns a pointer to a method which restores a previously saved MonoContext.
62 * The first argument in a0 is the pointer to the MonoContext.
65 mono_arch_get_restore_context (void)
69 static guint8 start [128];
70 static int inited = 0;
71 guint32 iregs_to_restore;
78 iregs_to_restore = (MONO_ARCH_CALLEE_SAVED_REGS \
79 | (1 << mips_sp) | (1 << mips_ra));
80 for (i = 0; i < MONO_SAVED_GREGS; ++i) {
81 if (iregs_to_restore & (1 << i)) {
82 mips_lw (code, i, mips_a0, G_STRUCT_OFFSET (MonoContext, sc_regs[i]));
86 /* Get the address to return to */
87 mips_lw (code, mips_t9, mips_a0, G_STRUCT_OFFSET (MonoContext, sc_pc));
89 /* jump to the saved IP */
90 mips_jr (code, mips_t9);
94 mips_break (code, 0xff);
96 g_assert ((code - start) < sizeof(start));
97 mono_arch_flush_icache (start, code - start);
102 * mono_arch_get_call_filter:
104 * Returns a pointer to a method which calls an exception filter. We
105 * also use this function to call finally handlers (we pass NULL as
106 * @exc object in this case).
108 * This function is invoked as
109 * call_handler (MonoContext *ctx, handler)
111 * Where 'handler' is a function to be invoked as:
115 mono_arch_get_call_filter (void)
117 static guint8 start [320];
118 static int inited = 0;
130 g_assert ((alloc_size & (MIPS_STACK_ALIGNMENT-1)) == 0);
132 mips_addiu (code, mips_sp, mips_sp, -alloc_size);
133 mips_sw (code, mips_ra, mips_sp, alloc_size + MIPS_RET_ADDR_OFFSET);
135 /* Save global registers on stack (s0 - s7) */
137 mips_sw (code, mips_s0, mips_sp, offset); offset += 4;
138 mips_sw (code, mips_s1, mips_sp, offset); offset += 4;
139 mips_sw (code, mips_s2, mips_sp, offset); offset += 4;
140 mips_sw (code, mips_s3, mips_sp, offset); offset += 4;
141 mips_sw (code, mips_s4, mips_sp, offset); offset += 4;
142 mips_sw (code, mips_s5, mips_sp, offset); offset += 4;
143 mips_sw (code, mips_s6, mips_sp, offset); offset += 4;
144 mips_sw (code, mips_s7, mips_sp, offset); offset += 4;
145 mips_sw (code, mips_fp, mips_sp, offset); offset += 4;
147 /* Restore global registers from MonoContext, including the frame pointer */
148 mips_lw (code, mips_s0, mips_a0, G_STRUCT_OFFSET (MonoContext, sc_regs[mips_s0]));
149 mips_lw (code, mips_s1, mips_a0, G_STRUCT_OFFSET (MonoContext, sc_regs[mips_s1]));
150 mips_lw (code, mips_s2, mips_a0, G_STRUCT_OFFSET (MonoContext, sc_regs[mips_s2]));
151 mips_lw (code, mips_s3, mips_a0, G_STRUCT_OFFSET (MonoContext, sc_regs[mips_s3]));
152 mips_lw (code, mips_s4, mips_a0, G_STRUCT_OFFSET (MonoContext, sc_regs[mips_s4]));
153 mips_lw (code, mips_s5, mips_a0, G_STRUCT_OFFSET (MonoContext, sc_regs[mips_s5]));
154 mips_lw (code, mips_s6, mips_a0, G_STRUCT_OFFSET (MonoContext, sc_regs[mips_s6]));
155 mips_lw (code, mips_s7, mips_a0, G_STRUCT_OFFSET (MonoContext, sc_regs[mips_s7]));
156 mips_lw (code, mips_fp, mips_a0, G_STRUCT_OFFSET (MonoContext, sc_regs[mips_fp]));
158 /* a1 is the handler to call */
159 mips_move (code, mips_t9, mips_a1);
161 /* jump to the saved IP */
162 mips_jalr (code, mips_t9, mips_ra);
165 /* restore all regs from the stack */
167 mips_lw (code, mips_s0, mips_sp, offset); offset += 4;
168 mips_lw (code, mips_s1, mips_sp, offset); offset += 4;
169 mips_lw (code, mips_s2, mips_sp, offset); offset += 4;
170 mips_lw (code, mips_s3, mips_sp, offset); offset += 4;
171 mips_lw (code, mips_s4, mips_sp, offset); offset += 4;
172 mips_lw (code, mips_s5, mips_sp, offset); offset += 4;
173 mips_lw (code, mips_s6, mips_sp, offset); offset += 4;
174 mips_lw (code, mips_s7, mips_sp, offset); offset += 4;
175 mips_lw (code, mips_fp, mips_sp, offset); offset += 4;
178 mips_lw (code, mips_ra, mips_sp, alloc_size + MIPS_RET_ADDR_OFFSET);
179 mips_addiu (code, mips_sp, mips_sp, alloc_size);
180 mips_jr (code, mips_ra);
183 g_assert ((code - start) < sizeof(start));
184 mono_arch_flush_icache (start, code - start);
189 throw_exception (MonoObject *exc, unsigned long eip, unsigned long esp, gboolean rethrow)
191 static void (*restore_context) (MonoContext *);
194 #ifdef DEBUG_EXCEPTIONS
195 g_print ("throw_exception: exc=%p eip=%p esp=%p rethrow=%d\n",
196 exc, (void *)eip, (void *) esp, rethrow);
199 if (!restore_context)
200 restore_context = mono_arch_get_restore_context ();
202 /* adjust eip so that it point into the call instruction */
205 setup_context (&ctx);
207 /*g_print ("stack in throw: %p\n", esp);*/
208 memcpy (&ctx.sc_regs, (void *)(esp + MIPS_STACK_PARAM_OFFSET),
209 sizeof (gulong) * MONO_SAVED_GREGS);
211 memcpy (&ctx.sc_fpregs, fp_regs, sizeof (float) * MONO_SAVED_FREGS);
213 memset (&ctx.sc_fpregs, 0, sizeof (float) * MONO_SAVED_FREGS);
215 MONO_CONTEXT_SET_IP (&ctx, eip);
217 if (mono_object_isinst (exc, mono_defaults.exception_class)) {
218 MonoException *mono_ex = (MonoException*)exc;
220 mono_ex->stack_trace = NULL;
222 #ifdef CUSTOM_EXCEPTION_HANDLING
223 arch_handle_exception (&ctx, exc, FALSE);
225 mono_handle_exception (&ctx, exc, (void *)eip, FALSE);
227 #ifdef DEBUG_EXCEPTIONS
228 g_print ("throw_exception: restore to pc=%p sp=%p fp=%p ctx=%p\n",
229 (void *) ctx.sc_pc, (void *) ctx.sc_regs[mips_sp],
230 (void *) ctx.sc_regs[mips_fp], &ctx);
232 restore_context (&ctx);
234 g_assert_not_reached ();
238 * arch_get_throw_exception_generic:
240 * Returns a function pointer which can be used to raise
241 * exceptions. The returned function has the following
242 * signature: void (*func) (MonoException *exc); or
243 * void (*func) (char *exc_name);
247 mono_arch_get_throw_exception_generic (guint8 *start, int size, int by_name, gboolean rethrow)
250 int alloc_size, pos, i;
254 //g_print ("mono_arch_get_throw_exception_generic: code=%p\n", code);
257 /* XXX - save all the FP regs on the stack ? */
259 pos += MONO_MAX_IREGS * sizeof(guint32);
261 alloc_size = MIPS_MINIMAL_STACK_SIZE + pos + 64;
262 // align to MIPS_STACK_ALIGNMENT bytes
263 alloc_size += MIPS_STACK_ALIGNMENT - 1;
264 alloc_size &= ~(MIPS_STACK_ALIGNMENT - 1);
266 g_assert ((alloc_size & (MIPS_STACK_ALIGNMENT-1)) == 0);
267 mips_addiu (code, mips_sp, mips_sp, -alloc_size);
268 mips_sw (code, mips_ra, mips_sp, alloc_size + MIPS_RET_ADDR_OFFSET);
270 /* Save all the regs on the stack */
271 for (i = 0; i < MONO_MAX_IREGS; i++) {
273 mips_sw (code, i, mips_sp, i*sizeof(guint32) + MIPS_STACK_PARAM_OFFSET);
275 mips_addiu (code, mips_at, mips_sp, alloc_size);
276 mips_sw (code, mips_at, mips_sp, i*sizeof(guint32) + MIPS_STACK_PARAM_OFFSET);
281 mips_move (code, mips_a2, mips_a0);
282 mips_load (code, mips_a0, mono_defaults.corlib);
283 mips_load (code, mips_a1, "System");
284 mips_load (code, mips_t9, mono_exception_from_name);
285 mips_jalr (code, mips_t9, mips_ra);
287 mips_move (code, mips_a0, mips_v0);
289 /* call throw_exception (exc, ip, sp, rethrow) */
291 /* exc is already in place in a0 */
295 mips_lw (code, mips_a1, mips_sp, alloc_size + MIPS_RET_ADDR_OFFSET);
297 mips_move (code, mips_a1, mips_ra);
299 /* current sp & rethrow */
300 mips_move (code, mips_a2, mips_sp);
301 mips_addiu (code, mips_a3, mips_zero, rethrow);
303 mips_load (code, mips_t9, throw_exception);
304 mips_jr (code, mips_t9);
306 /* we should never reach this breakpoint */
307 mips_break (code, 0xfe);
309 g_assert ((code - start) < size);
310 mono_arch_flush_icache (start, code - start);
315 * mono_arch_get_rethrow_exception:
317 * Returns a function pointer which can be used to rethrow
318 * exceptions. The returned function has the following
319 * signature: void (*func) (MonoException *exc);
323 mono_arch_get_rethrow_exception (void)
325 static guint8 start [GENERIC_EXCEPTION_SIZE];
326 static int inited = 0;
330 mono_arch_get_throw_exception_generic (start, sizeof (start), FALSE, TRUE);
336 * arch_get_throw_exception:
338 * Returns a function pointer which can be used to raise
339 * exceptions. The returned function has the following
340 * signature: void (*func) (MonoException *exc);
341 * For example to raise an arithmetic exception you can use:
343 * x86_push_imm (code, mono_get_exception_arithmetic ());
344 * x86_call_code (code, arch_get_throw_exception ());
348 mono_arch_get_throw_exception (void)
350 static guint8 start [GENERIC_EXCEPTION_SIZE];
351 static int inited = 0;
355 mono_arch_get_throw_exception_generic (start, sizeof (start), FALSE, FALSE);
361 * arch_get_throw_exception_by_name:
363 * Returns a function pointer which can be used to raise
364 * corlib exceptions. The returned function has the following
365 * signature: void (*func) (char *exc_name);
366 * For example to raise an arithmetic exception you can use:
368 * x86_push_imm (code, "ArithmeticException");
369 * x86_call_code (code, arch_get_throw_exception_by_name ());
373 mono_arch_get_throw_exception_by_name (void)
375 static guint8 start [GENERIC_EXCEPTION_SIZE];
376 static int inited = 0;
380 mono_arch_get_throw_exception_generic (start, sizeof (start), TRUE, FALSE);
386 glist_to_array (GList *list, MonoClass *eclass)
388 MonoDomain *domain = mono_domain_get ();
395 len = g_list_length (list);
396 res = mono_array_new (domain, eclass, len);
398 for (i = 0; list; list = list->next, i++)
399 mono_array_set (res, gpointer, i, list->data);
404 /* mono_arch_find_jit_info:
406 * This function is used to gather information from @ctx. It returns the
407 * MonoJitInfo of the corresponding function, unwinds one stack frame and
408 * stores the resulting context into @new_ctx. It also stores a string
409 * describing the stack location into @trace (if not NULL), and modifies
410 * the @lmf if necessary. @native_offset return the IP offset from the
411 * start of the function or -1 if that info is not available.
414 mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls,
415 MonoJitInfo *res, MonoJitInfo *prev_ji,
416 MonoContext *ctx, MonoContext *new_ctx,
417 MonoLMF **lmf, gboolean *managed)
420 gpointer ip = MONO_CONTEXT_GET_IP (ctx);
421 gpointer fp = MONO_CONTEXT_GET_BP (ctx);
424 /* Avoid costly table lookup during stack overflow */
425 if (prev_ji && (ip > prev_ji->code_start && ((guint8*)ip < ((guint8*)prev_ji->code_start) + prev_ji->code_size)))
428 ji = mono_jit_info_table_find (domain, ip);
434 setup_context (new_ctx);
441 if (*lmf && (MONO_CONTEXT_GET_BP (ctx) >= (gpointer)(*lmf)->ebp)) {
442 /* remove any unused lmf */
443 *lmf = (*lmf)->previous_lmf;
446 address = (char *)ip - (char *)ji->code_start;
449 if (!ji->method->wrapper_type)
453 fp = MONO_CONTEXT_GET_BP (ctx);
455 /* Compute the previous stack frame */
456 sp = (guint32)(fp) - (short)(*(guint32 *)(ji->code_start));
458 /* Sanity check the frame */
459 if (!sp || (sp == 0xffffffff)
460 || (sp & 0x07) || (sp < 64*1024)) {
461 #ifdef DEBUG_EXCEPTIONS
462 g_print ("mono_arch_find_jit_info: bad stack sp=%p\n", (void *) sp);
467 if (ji->method->save_lmf && 0) {
468 /* only enable this when prologue stops emitting
469 * normal save of s-regs when save_lmf is true.
470 * Will have to sync with prologue code at that point.
472 memcpy (&new_ctx->sc_fpregs,
473 (char*)sp - sizeof (float) * MONO_SAVED_FREGS,
474 sizeof (float) * MONO_SAVED_FREGS);
475 memcpy (&new_ctx->sc_regs,
476 (char*)sp - sizeof (float) * MONO_SAVED_FREGS - sizeof (gulong) * MONO_SAVED_GREGS,
477 sizeof (gulong) * MONO_SAVED_GREGS);
478 } else if (ji->used_regs) {
480 guint32 mask = ji->used_regs;
482 /* these all happen before adjustment of fp */
483 /* Look for sw ??, ????(sp) */
484 insn = ((guint32 *)ji->code_start) + 1;
485 while (!*insn || (*insn & 0xffe00000) == 0xafa00000) {
486 int reg = (*insn >> 16) & 0x1f;
488 new_ctx->sc_regs [reg] = *(guint32 *)(((guint32)fp) + (short)(*insn & 0x0000ffff));
491 MONO_CONTEXT_SET_SP (new_ctx, sp);
492 MONO_CONTEXT_SET_BP (new_ctx, sp);
493 /* assert that we found all registers we were supposed to */
496 /* we substract 8, so that the IP points into the call instruction */
497 MONO_CONTEXT_SET_IP (new_ctx, new_ctx->sc_regs[mips_ra] - 8);
499 /* Sanity check -- we should have made progress here */
500 g_assert (new_ctx->sc_pc != ctx->sc_pc);
503 if (!(*lmf)->method) {
504 #ifdef DEBUG_EXCEPTIONS
505 g_print ("mono_arch_find_jit_info: bad lmf @ %p\n", (void *) *lmf);
509 g_assert (((*lmf)->magic == MIPS_LMF_MAGIC1) || ((*lmf)->magic == MIPS_LMF_MAGIC2));
511 if ((ji = mono_jit_info_table_find (domain, (gpointer)(*lmf)->eip))) {
513 memset (res, 0, sizeof (MonoJitInfo));
514 res->method = (*lmf)->method;
516 memcpy (&new_ctx->sc_regs, (*lmf)->iregs, sizeof (gulong) * MONO_SAVED_GREGS);
517 memcpy (&new_ctx->sc_fpregs, (*lmf)->fregs, sizeof (float) * MONO_SAVED_FREGS);
518 MONO_CONTEXT_SET_IP (new_ctx, (*lmf)->eip);
519 /* ensure that we've made progress */
520 g_assert (new_ctx->sc_pc != ctx->sc_pc);
521 *lmf = (*lmf)->previous_lmf;
523 return ji ? ji : res;
530 mono_arch_sigctx_to_monoctx (void *sigctx, MonoContext *mctx)
533 struct sigcontext *ctx = (struct sigcontext *)sigctx;
535 mctx->sc_pc = ctx->sc_pc;
536 for (i = 0; i < 32; ++i) {
537 mctx->sc_regs[i] = ctx->sc_regs[i];
538 mctx->sc_fpregs[i] = ctx->sc_fpregs[i];
543 mono_arch_monoctx_to_sigctx (MonoContext *mctx, void *sigctx)
546 struct sigcontext *ctx = (struct sigcontext *)sigctx;
548 ctx->sc_pc = mctx->sc_pc;
549 for (i = 0; i < 32; ++i) {
550 ctx->sc_regs[i] = mctx->sc_regs[i];
551 ctx->sc_fpregs[i] = mctx->sc_fpregs[i];
556 mono_arch_ip_from_context (void *sigctx)
558 struct sigcontext *ctx = (struct sigcontext *)sigctx;
559 return (gpointer)(guint32)ctx->sc_pc;
563 * This is the function called from the signal handler
566 mono_arch_handle_exception (void *ctx, gpointer obj, gboolean test_only)
571 mono_arch_sigctx_to_monoctx (ctx, &mctx);
572 #ifdef DEBUG_EXCEPTIONS
573 g_print ("mono_arch_handle_exception: pc=%p\n", (void *) mctx.sc_pc);
575 #ifdef CUSTOM_EXCEPTION_HANDLING
576 result = arch_handle_exception (&mctx, obj, test_only);
578 mono_handle_exception (&mctx, obj, (gpointer)mctx.sc_pc, test_only);
582 #ifdef DEBUG_EXCEPTIONS
583 g_print ("mono_arch_handle_exception: restore pc=%p\n", (void *)mctx.sc_pc);
585 /* restore the context so that returning from the signal handler
586 * will invoke the catch clause
588 mono_arch_monoctx_to_sigctx (&mctx, ctx);
593 #ifdef CUSTOM_EXCEPTION_HANDLING
595 * arch_handle_exception:
596 * @ctx: saved processor state
597 * @obj: the exception object
598 * @test_only: only test if the exception is caught, but dont call handlers
603 arch_handle_exception (MonoContext *ctx, gpointer obj, gboolean test_only)
605 MonoDomain *domain = mono_domain_get ();
606 MonoJitInfo *ji, rji;
607 static int (*call_filter) (MonoContext *, gpointer, gpointer) = NULL;
608 MonoJitTlsData *jit_tls = TlsGetValue (mono_jit_tls_id);
609 MonoLMF *lmf = jit_tls->lmf;
610 GList *trace_ips = NULL;
611 MonoException *mono_ex;
612 MonoArray *initial_trace_ips = NULL;
614 gboolean has_dynamic_methods = FALSE;
616 g_assert (ctx != NULL);
618 MonoException *ex = mono_get_exception_null_reference ();
619 ex->message = mono_string_new (domain,
620 "Object reference not set to an instance of an object");
621 obj = (MonoObject *)ex;
624 if (mono_object_isinst (obj, mono_defaults.exception_class)) {
625 mono_ex = (MonoException*)obj;
626 initial_trace_ips = mono_ex->trace_ips;
633 call_filter = mono_arch_get_call_filter ();
635 g_assert (jit_tls->end_of_stack);
636 g_assert (jit_tls->abort_func);
639 MonoContext ctx_cp = *ctx;
640 setup_context (&ctx_cp);
641 if (mono_jit_trace_calls != NULL)
642 g_print ("EXCEPTION handling: %s\n", mono_object_class (obj)->name);
643 if (!arch_handle_exception (&ctx_cp, obj, TRUE)) {
644 if (mono_break_on_exc)
646 mono_unhandled_exception (obj);
650 memset (&rji, 0, sizeof (rji));
655 setup_context (&new_ctx);
656 ji = mono_arch_find_jit_info (domain, jit_tls, &rji, &rji, ctx, &new_ctx,
657 NULL, &lmf, NULL, NULL);
659 g_warning ("Exception inside function without unwind info");
660 g_assert_not_reached ();
663 if (ji != (gpointer)-1) {
666 if (test_only && ji->method->wrapper_type != MONO_WRAPPER_RUNTIME_INVOKE && mono_ex) {
668 * Avoid overwriting the stack trace if the exception is
669 * rethrown. Also avoid giant stack traces during a stack
672 if (!initial_trace_ips && (frame_count < 1000)) {
673 trace_ips = g_list_prepend (trace_ips, MONO_CONTEXT_GET_IP (ctx));
678 if (ji->method->dynamic)
679 has_dynamic_methods = TRUE;
681 if (ji->num_clauses) {
684 g_assert (ji->clauses);
686 for (i = 0; i < ji->num_clauses; i++) {
687 MonoJitExceptionInfo *ei = &ji->clauses [i];
688 gboolean filtered = FALSE;
690 if (ei->try_start <= MONO_CONTEXT_GET_IP (ctx) &&
691 MONO_CONTEXT_GET_IP (ctx) <= ei->try_end) {
694 if ((ei->flags == MONO_EXCEPTION_CLAUSE_NONE) || (ei->flags == MONO_EXCEPTION_CLAUSE_FILTER)) {
695 /* store the exception object int cfg->excvar */
696 g_assert (ei->exvar_offset);
697 /* need to use the frame pointer (mips_fp): methods with clauses always have mips_fp */
698 *((gpointer *)(void*)((char *)(ctx->sc_regs [mips_fp]) + ei->exvar_offset)) = obj;
701 if (ei->flags == MONO_EXCEPTION_CLAUSE_FILTER)
702 filtered = call_filter (ctx, ei->data.filter, mono_ex);
704 if ((ei->flags == MONO_EXCEPTION_CLAUSE_NONE &&
705 mono_object_isinst (obj, ei->data.catch_class)) || filtered) {
707 if (mono_ex && !initial_trace_ips) {
708 trace_ips = g_list_reverse (trace_ips);
709 mono_ex->trace_ips = glist_to_array (trace_ips, mono_defaults.int_class);
710 if (has_dynamic_methods)
711 /* These methods could go away anytime, so compute the stack trace now */
712 mono_ex->stack_trace = ves_icall_System_Exception_get_trace (mono_ex);
714 g_list_free (trace_ips);
717 if (mono_jit_trace_calls != NULL)
718 g_print ("EXCEPTION: catch found at clause %d of %s\n", i, mono_method_full_name (ji->method, TRUE));
719 /*g_print ("stack for catch: %p\n", MONO_CONTEXT_GET_BP (ctx));*/
720 MONO_CONTEXT_SET_IP (ctx, ei->handler_start);
724 if (!test_only && ei->try_start <= MONO_CONTEXT_GET_IP (ctx) &&
725 MONO_CONTEXT_GET_IP (ctx) < ei->try_end &&
726 (ei->flags & MONO_EXCEPTION_CLAUSE_FINALLY)) {
727 if (mono_jit_trace_calls != NULL)
728 g_print ("EXCEPTION: finally clause %d of %s\n", i, mono_method_full_name (ji->method, TRUE));
729 call_filter (ctx, ei->handler_start, NULL);
740 if ((ji == (gpointer)-1) || MONO_CONTEXT_GET_BP (ctx) >= jit_tls->end_of_stack) {
743 jit_tls->abort_func (obj);
744 g_assert_not_reached ();
746 if (mono_ex && !initial_trace_ips) {
747 trace_ips = g_list_reverse (trace_ips);
748 mono_ex->trace_ips = glist_to_array (trace_ips, mono_defaults.int_class);
749 if (has_dynamic_methods)
750 /* These methods could go away anytime, so compute the stack trace now */
751 mono_ex->stack_trace = ves_icall_System_Exception_get_trace (mono_ex);
753 g_list_free (trace_ips);
759 g_assert_not_reached ();
761 #endif /* CUSTOM_EXCEPTION_HANDLING */
764 mono_arch_has_unwind_info (gconstpointer addr)