guint32 free_stack = 0;
StackFrameInfo frame;
- /* convert sigcontext to MonoContext (due to reuse of stack walking helpers */
- mono_arch_sigctx_to_monoctx (sctx, &ctx);
+ mono_sigctx_to_monoctx (sctx, &ctx);
/* get our os page size */
GetSystemInfo(&si);
ctx = new_ctx;
} while (free_stack < 64 * 1024 && frame.ji != (gpointer) -1);
- /* convert into sigcontext to be used in mono_arch_handle_exception */
- mono_arch_monoctx_to_sigctx (&ctx, sctx);
+ mono_monoctx_to_sigctx (&ctx, sctx);
/* todo: install new stack-guard page */
/* Adjust IP */
new_ctx->eip --;
-
-#ifndef MONO_X86_NO_PUSHES
- /* Pop arguments off the stack */
- if (ji->has_arch_eh_info) {
- int stack_size;
-
- stack_size = mono_jit_info_get_arch_eh_info (ji)->stack_size;
-
- if (stack_size) {
-#ifdef ENABLE_LLVM
- MonoJitInfo *caller_ji;
-
- caller_ji = mini_jit_info_table_find (domain, (char*)new_ctx->eip, NULL);
- /* LLVM doesn't push the arguments */
- if (caller_ji && !caller_ji->from_llvm)
- new_ctx->esp += stack_size;
-#else
- new_ctx->esp += stack_size;
-#endif
- }
- }
-#endif
-
return TRUE;
} else if (*lmf) {
return TRUE;
}
-
+
if ((ji = mini_jit_info_table_find (domain, (gpointer)(*lmf)->eip, NULL))) {
+ frame->ji = ji;
} else {
- if (!((guint32)((*lmf)->previous_lmf) & 1))
- /* Top LMF entry */
+ if (!(*lmf)->method)
return FALSE;
- g_assert_not_reached ();
- /* Trampoline lmf frame */
frame->method = (*lmf)->method;
}
/* Adjust IP */
new_ctx->eip --;
- frame->ji = ji;
frame->type = FRAME_TYPE_MANAGED_TO_NATIVE;
/* Check if we are in a trampoline LMF frame */
if ((guint32)((*lmf)->previous_lmf) & 1) {
/* lmf->esp is set by the trampoline code */
new_ctx->esp = (*lmf)->esp;
-
- /* Pop arguments off the stack */
- /* FIXME: Handle the delegate case too ((*lmf)->method == NULL) */
- /* FIXME: Handle the IMT/vtable case too */
-#if 0
-#ifndef ENABLE_LLVM
- if ((*lmf)->method) {
- MonoMethod *method = (*lmf)->method;
- MonoJitArgumentInfo *arg_info = g_newa (MonoJitArgumentInfo, mono_method_signature (method)->param_count + 1);
-
- guint32 stack_to_pop = mono_arch_get_argument_info (NULL, mono_method_signature (method), mono_method_signature (method)->param_count, arg_info);
- new_ctx->esp += stack_to_pop;
- }
-#endif
-#endif
}
else
/* the lmf is always stored on the stack, so the following
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);
-}
-
gpointer
mono_arch_ip_from_context (void *sigctx)
{
MonoJitTlsData *jit_tls = mono_native_tls_get_value (mono_jit_tls_id);
/* Pass the ctx parameter in TLS */
- mono_arch_sigctx_to_monoctx (ctx, &jit_tls->ex_ctx);
+ mono_sigctx_to_monoctx (ctx, &jit_tls->ex_ctx);
mctx = jit_tls->ex_ctx;
mono_setup_async_callback (&mctx, handle_signal_exception, obj);
MonoJitTlsData *jit_tls = mono_native_tls_get_value (mono_jit_tls_id);
struct sigcontext *ctx = (struct sigcontext *)sigctx;
- mono_arch_sigctx_to_monoctx (sigctx, &jit_tls->ex_ctx);
+ mono_sigctx_to_monoctx (sigctx, &jit_tls->ex_ctx);
mctx = jit_tls->ex_ctx;
mono_setup_async_callback (&mctx, handle_signal_exception, obj);
#else
MonoContext mctx;
- mono_arch_sigctx_to_monoctx (sigctx, &mctx);
+ mono_sigctx_to_monoctx (sigctx, &mctx);
mono_handle_exception (&mctx, obj);
- mono_arch_monoctx_to_sigctx (&mctx, sigctx);
+ mono_monoctx_to_sigctx (&mctx, sigctx);
return TRUE;
#endif