ip += 4;
MINT_IN_BREAK;
}
- MINT_IN_CASE(MINT_START_ABORT_PROT)
- mono_threads_begin_abort_protected_block ();
- ip ++;
- MINT_IN_BREAK;
MINT_IN_CASE(MINT_ENDFINALLY) {
- mono_threads_end_abort_protected_block ();
guint16 clause_index = *(ip + 1);
guint16 *ret_ip = *(guint16**)(locals + frame->imethod->clause_data_offsets [clause_index]);
OPDEF(MINT_SDB_BREAKPOINT, "sdb_breakpoint", 1, 0, 0, MintOpNoArgs)
OPDEF(MINT_LD_DELEGATE_METHOD_PTR, "ld_delegate_method_ptr", 3, 1, 1, MintOpNoArgs)
-OPDEF(MINT_START_ABORT_PROT, "start_abort_protected", 1, 0, 0, MintOpNoArgs)
-
// Math intrinsics
// double
OPDEF(MINT_ABS, "abs", 3, 1, 1, MintOpNoArgs)
init_bb_stack_state (td, new_bb);
}
link_bblocks = TRUE;
- if (!inlining) {
- int index = td->clause_indexes [in_offset];
- if (index != -1) {
- MonoExceptionClause *clause = &header->clauses [index];
- if ((clause->flags == MONO_EXCEPTION_CLAUSE_FINALLY ||
- clause->flags == MONO_EXCEPTION_CLAUSE_FAULT) &&
- in_offset == clause->handler_offset)
- interp_add_ins (td, MINT_START_ABORT_PROT);
- }
- }
-
}
td->offset_to_bb [in_offset] = td->cbb;
td->in_start = td->ip;
g_assert_not_reached ();
}
-/*
- * We implement delaying of aborts when in finally blocks by reusing the
- * abort protected block mechanism. The problem is that when throwing an
- * exception in a finally block we don't get to exit the protected block.
- * We exit it here when unwinding. Given that the order of the clauses
- * in the jit info is from inner clauses to the outer clauses, when we
- * want to exit the finally blocks inner to the clause that handles the
- * exception, we need to search up to its index.
- *
- * FIXME We should do this inside interp, but with mixed mode we can
- * resume directly, without giving control back to the interp.
- */
-static void
-interp_exit_finally_abort_blocks (MonoJitInfo *ji, int start_clause, int end_clause, gpointer ip)
-{
- int i;
- for (i = start_clause; i < end_clause; i++) {
- MonoJitExceptionInfo *ei = &ji->clauses [i];
- if (ei->flags == MONO_EXCEPTION_CLAUSE_FINALLY &&
- ip >= ei->handler_start &&
- ip < ei->data.handler_end) {
- mono_threads_end_abort_protected_block ();
- }
- }
-}
-
static MonoException *
mono_get_exception_runtime_wrapped_checked (MonoObject *wrapped_exception_raw, MonoError *error)
{
mini_set_abort_threshold (&frame);
if (in_interp) {
- interp_exit_finally_abort_blocks (ji, clause_index_start, i, ip);
/*
* ctx->pc points into the interpreter, after the call which transitioned to
* JITted code. Store the unwind state into the
}
}
- if (in_interp)
- interp_exit_finally_abort_blocks (ji, clause_index_start, ji->num_clauses, ip);
-
if (MONO_PROFILER_ENABLED (method_exception_leave) &&
mono_profiler_get_call_instrumentation_flags (method) & MONO_PROFILER_CALL_INSTRUMENTATION_EXCEPTION_LEAVE) {
jit_tls->orig_ex_ctx_set = TRUE;