#include "version.h"
#include "debugger-agent.h"
#include "aot-compiler.h"
+#include "jit-icalls.h"
#ifndef DISABLE_AOT
target = mono_thread_force_interruption_checkpoint;
} else if (!strcmp (ji->data.name, "mono_thread_force_interruption_checkpoint_noraise")) {
target = mono_thread_force_interruption_checkpoint_noraise;
+ } else if (!strcmp (ji->data.name, "mono_interruption_checkpoint_from_trampoline")) {
+ target = mono_interruption_checkpoint_from_trampoline;
} else if (!strcmp (ji->data.name, "mono_exception_from_token")) {
target = mono_exception_from_token;
} else if (!strcmp (ji->data.name, "mono_throw_exception")) {
#include "jit-icalls.h"
#include <mono/utils/mono-error-internals.h>
+#include <mono/metadata/threads-types.h>
#ifdef ENABLE_LLVM
#include "mini-llvm-cpp.h"
mono_raise_exception (mono_get_exception_not_supported ("Stack walks are not supported on this platform."));
return (MonoObject*)mono_assembly_get_object (mono_domain_get (), jit_tls->calling_image->assembly);
}
+
+/*
+ * mono_interruption_checkpoint_from_trampoline:
+ *
+ * Check whenever the thread has a pending exception, and throw it
+ * if needed.
+ * Architectures should move away from calling this function and
+ * instead call mono_thread_force_interruption_checkpoint_noraise (),
+ * rewrind to the parent frame, and throw the exception normally.
+ */
+void
+mono_interruption_checkpoint_from_trampoline (void)
+{
+ MonoException *ex;
+
+ ex = mono_thread_force_interruption_checkpoint_noraise ();
+ if (ex)
+ mono_raise_exception (ex);
+}
void
mono_generic_class_init (MonoVTable *vtable);
+void mono_interruption_checkpoint_from_trampoline (void);
+
MonoObject*
mono_gsharedvt_constrained_call (gpointer mp, MonoMethod *cmethod, MonoClass *klass, gboolean deref_arg, gpointer *args);
register_icall (mono_thread_get_undeniable_exception, "mono_thread_get_undeniable_exception", "object", FALSE);
register_icall (mono_thread_interruption_checkpoint, "mono_thread_interruption_checkpoint", "object", FALSE);
register_icall (mono_thread_force_interruption_checkpoint_noraise, "mono_thread_force_interruption_checkpoint_noraise", "object", FALSE);
- register_icall (mono_thread_force_interruption_checkpoint, "mono_thread_force_interruption_checkpoint", "void", FALSE);
#ifndef DISABLE_REMOTING
register_icall (mono_load_remote_field_new, "mono_load_remote_field_new", "object object ptr ptr", FALSE);
register_icall (mono_store_remote_field_new, "mono_store_remote_field_new", "void object ptr ptr object", FALSE);
* Have to call the _force_ variant, since there could be a protected wrapper on the top of the stack.
*/
if (aot) {
- ji = mono_patch_info_list_prepend (ji, code - buf, MONO_PATCH_INFO_JIT_ICALL_ADDR, "mono_thread_force_interruption_checkpoint");
+ ji = mono_patch_info_list_prepend (ji, code - buf, MONO_PATCH_INFO_JIT_ICALL_ADDR, "mono_interruption_checkpoint_from_trampoline");
ARM_LDR_IMM (code, ARMREG_IP, ARMREG_PC, 0);
ARM_B (code, 0);
*(gpointer*)code = NULL;
#ifdef USE_JUMP_TABLES
gpointer *jte = mono_jumptable_add_entry ();
code = mono_arm_load_jumptable_entry (code, jte, ARMREG_IP);
- jte [0] = mono_thread_force_interruption_checkpoint;
+ jte [0] = mono_interruption_checkpoint_from_trampoline;
#else
ARM_LDR_IMM (code, ARMREG_IP, ARMREG_PC, 0);
ARM_B (code, 0);
- *(gpointer*)code = mono_thread_force_interruption_checkpoint;
+ *(gpointer*)code = mono_interruption_checkpoint_from_trampoline;
code += 4;
#endif
}
/* This is not perf critical code so no need to check the interrupt flag */
ia64_mov (code, l2, IA64_R8);
- tramp = (guint8*)mono_thread_force_interruption_checkpoint;
+ tramp = (guint8*)mono_interruption_checkpoint_from_trampoline;
ia64_movl (code, l0, tramp);
ia64_ld8_inc_imm (code, l1, l0, 8);
ia64_mov_to_br (code, IA64_B6, l1);
sparc_sti_imm (code, sparc_o0, sparc_sp, MONO_SPARC_STACK_BIAS + 304);
/* Check for thread interruption */
- sparc_set (code, (guint8*)mono_thread_force_interruption_checkpoint, sparc_o7);
+ sparc_set (code, (guint8*)mono_interruption_checkpoint_from_trampoline, sparc_o7);
sparc_jmpl (code, sparc_o7, sparc_g0, sparc_o7);
sparc_nop (code);
/* Check for interruptions */
if (aot) {
- code = mono_arch_emit_load_aotconst (buf, code, &ji, MONO_PATCH_INFO_JIT_ICALL_ADDR, "mono_thread_force_interruption_checkpoint");
+ code = mono_arch_emit_load_aotconst (buf, code, &ji, MONO_PATCH_INFO_JIT_ICALL_ADDR, "mono_interruption_checkpoint_from_trampoline");
x86_call_reg (code, X86_EAX);
} else {
- x86_call_code (code, (guint8*)mono_thread_force_interruption_checkpoint);
+ x86_call_code (code, (guint8*)mono_interruption_checkpoint_from_trampoline);
}
/* Restore LMF */