#define MONO_ARCH_CONTEXT_DEF
#endif
-#ifndef MONO_ARCH_STACK_GROWS_UP
-#define MONO_ARCH_STACK_GROWS_UP 0
-#endif
-
/*
* Raw frame information is stored in MonoException.trace_ips as an IntPtr[].
* This structure represents one entry.
return addr;
}
-static inline int
-mini_abort_threshold_offset (gpointer threshold, gpointer sp)
-{
- intptr_t stack_threshold = (intptr_t) threshold;
- intptr_t stack_pointer = (intptr_t) sp;
-
- const int direction = MONO_ARCH_STACK_GROWS_UP ? -1 : 1;
- intptr_t magnitude = stack_pointer - stack_threshold;
-
- return direction * magnitude;
-}
-
static inline void
mini_clear_abort_threshold (void)
{
// Only move it up, to avoid thrown/caught
// exceptions lower in the stack from triggering
// a rethrow
- gboolean above_threshold = mini_abort_threshold_offset (jit_tls->abort_exc_stack_threshold, sp) >= 0;
+ gboolean above_threshold = (gsize) sp >= (gsize) jit_tls->abort_exc_stack_threshold;
if (!jit_tls->abort_exc_stack_threshold || above_threshold) {
jit_tls->abort_exc_stack_threshold = sp;
}
if (!sp)
return TRUE;
- gboolean above_threshold = mini_abort_threshold_offset (jit_tls->abort_exc_stack_threshold, sp) >= 0;
+ gboolean above_threshold = (gsize) sp >= (gsize) jit_tls->abort_exc_stack_threshold;
if (above_threshold)
jit_tls->abort_exc_stack_threshold = sp;
dynamic_methods = g_slist_prepend (dynamic_methods, method);
if (stack_overflow) {
- if (MONO_ARCH_STACK_GROWS_UP)
- free_stack = (guint8*)(MONO_CONTEXT_GET_SP (&initial_ctx)) - (guint8*)(MONO_CONTEXT_GET_SP (ctx));
- else
- free_stack = (guint8*)(MONO_CONTEXT_GET_SP (ctx)) - (guint8*)(MONO_CONTEXT_GET_SP (&initial_ctx));
+ free_stack = (guint8*)(MONO_CONTEXT_GET_SP (ctx)) - (guint8*)(MONO_CONTEXT_GET_SP (&initial_ctx));
} else {
free_stack = 0xffffff;
}
//printf ("M: %s %d.\n", mono_method_full_name (method, TRUE), frame_count);
if (stack_overflow) {
- if (MONO_ARCH_STACK_GROWS_UP)
- free_stack = (guint8*)(MONO_CONTEXT_GET_SP (&initial_ctx)) - (guint8*)(MONO_CONTEXT_GET_SP (ctx));
- else
- free_stack = (guint8*)(MONO_CONTEXT_GET_SP (ctx)) - (guint8*)(MONO_CONTEXT_GET_SP (&initial_ctx));
+ free_stack = (guint8*)(MONO_CONTEXT_GET_SP (ctx)) - (guint8*)(MONO_CONTEXT_GET_SP (&initial_ctx));
} else {
free_stack = 0xffffff;
}