*/
if (G_UNLIKELY (jit_tls->handler_block_return_address)) {
gboolean is_outside = FALSE;
- gpointer prot_bp = MONO_CONTEXT_GET_BP (&jit_tls->ex_ctx);
+ gpointer prot_bp = MONO_CONTEXT_GET_BP (&jit_tls->handler_block_context);
gpointer catch_bp = MONO_CONTEXT_GET_BP (ctx);
//FIXME make this stack direction aware
if (catch_bp > prot_bp) {
* There aren't any further finally/fault handler blocks down the stack over this exception.
* This must be ensured by the code that installs the guard trampoline.
*/
- g_assert (ji == mini_jit_info_table_find (domain, MONO_CONTEXT_GET_IP (&jit_tls->ex_ctx), NULL));
+ g_assert (ji == mini_jit_info_table_find (domain, MONO_CONTEXT_GET_IP (&jit_tls->handler_block_context), NULL));
if (!is_address_protected (ji, jit_tls->handler_block, ei->handler_start)) {
is_outside = TRUE;
if (!data.ji)
return FALSE;
- memcpy (&jit_tls->ex_ctx, &data.ctx, sizeof (MonoContext));
+ memcpy (&jit_tls->handler_block_context, &data.ctx, sizeof (MonoContext));
resume_ip = install_handler_block_guard (data.ji, &data.ctx);
if (resume_ip == NULL)
MonoJitTlsData *jit_tls = TlsGetValue (mono_jit_tls_id);
gpointer resume_ip = jit_tls->handler_block_return_address;
- memcpy (&ctx, &jit_tls->ex_ctx, sizeof (MonoContext));
+ memcpy (&ctx, &jit_tls->handler_block_context, sizeof (MonoContext));
MONO_CONTEXT_SET_IP (&ctx, jit_tls->handler_block_return_address);
jit_tls->handler_block_return_address = NULL;
/* Stores state needed by handler block with a guard */
MonoContext ex_ctx;
ResumeState resume_state;
- /* handle block return address */
+
+ /*Variabled use to implement handler blocks (finally/catch/etc) guards during interruption*/
+ /* handler block return address */
gpointer handler_block_return_address;
- /* handler block been guarded */
+
+ /* handler block been guarded. It's safe to store this even for dynamic methods since there
+ is an activation on stack making sure it will remain alive.*/
MonoJitExceptionInfo *handler_block;
+ /* context to be used by the guard trampoline when resuming interruption.*/
+ MonoContext handler_block_context;
/*
* Stores the state at the exception throw site to be used by mono_stack_walk ()
* when it is called from profiler functions during exception handling.