#define FILL_IN_TRACE(exception, frame) fill_in_trace(exception, frame)
-#define THROW_EX(exception,ex_ip) \
+#define THROW_EX_GENERAL(exception,ex_ip,rethrow) \
do {\
frame->ip = (ex_ip); \
frame->ex = (MonoException*)(exception); \
- FILL_IN_TRACE(frame->ex, frame); \
+ if (!rethrow) { \
+ FILL_IN_TRACE(frame->ex, frame); \
+ } \
goto handle_exception; \
} while (0)
+#define THROW_EX(exception,ex_ip) THROW_EX_GENERAL ((exception), (ex_ip), FALSE)
+
static MonoObject*
ves_array_create (MonoInvocation *frame, MonoDomain *domain, MonoClass *klass, MonoMethodSignature *sig, stackval *values)
{
g_assert (!frame->runtime_method);
if (!mono_interp_enter_icall_trampoline) {
- MonoTrampInfo *info;
- mono_interp_enter_icall_trampoline = mono_arch_get_enter_icall_trampoline (&info);
- // TODO:
- // mono_tramp_info_register (info, NULL);
+ if (mono_aot_only) {
+ mono_interp_enter_icall_trampoline = mono_aot_get_trampoline ("enter_icall_trampoline");
+ } else {
+ MonoTrampInfo *info;
+ mono_interp_enter_icall_trampoline = mono_arch_get_enter_icall_trampoline (&info);
+ // TODO:
+ // mono_tramp_info_register (info, NULL);
+ }
}
InterpMethodArguments *margs = build_args_from_sig (sig, frame);
* rgctx register using a trampoline.
*/
- // FIXME: AOT
- g_assert (!mono_aot_only);
- addr = mono_arch_get_static_rgctx_trampoline (ftndesc, jit_wrapper);
+ if (mono_aot_only)
+ addr = mono_aot_get_static_rgctx_trampoline (ftndesc, jit_wrapper);
+ else
+ addr = mono_arch_get_static_rgctx_trampoline (ftndesc, jit_wrapper);
mono_memory_barrier ();
rmethod->jit_entry = addr;
ip += 2;
MINT_IN_BREAK;
#endif
- MINT_IN_CASE(MINT_RETHROW)
+ MINT_IN_CASE(MINT_RETHROW) {
/*
* need to clarify what this should actually do:
* start the search from the last found handler in
* We need to NULL frame->ex_handler for the later code to
* actually run the new found handler.
*/
+ int exvar_offset = *(guint16*)(ip + 1);
frame->ex_handler = NULL;
- THROW_EX (frame->ex, ip - 1);
+ THROW_EX_GENERAL (*(MonoException**)(frame->locals + exvar_offset), ip - 1, TRUE);
MINT_IN_BREAK;
+ }
MINT_IN_DEFAULT
g_print ("Unimplemented opcode: %04x %s at 0x%x\n", *ip, mono_interp_opname[*ip], ip-rtm->code);
THROW_EX (mono_get_exception_execution_engine ("Unimplemented opcode"), ip);
g_print ("* Matched Filter at '%s'\n", method->name);
#endif
inv->ex_handler = clause;
+ *(MonoException**)(inv->locals + inv->runtime_method->exvar_offsets [i]) = frame->ex;
goto handle_finally;
}
} else if (clause->flags == MONO_EXCEPTION_CLAUSE_NONE) {
g_print ("* Found handler at '%s'\n", method->name);
#endif
inv->ex_handler = clause;
+ *(MonoException**)(inv->locals + inv->runtime_method->exvar_offsets [i]) = frame->ex;
goto handle_finally;
}
}