void mono_arch_exceptions_init (void) { guint8 *tramp; /* LLVM needs different throw trampolines */ tramp = get_throw_exception ("llvm_throw_exception_trampoline", FALSE, TRUE, FALSE); mono_register_jit_icall (tramp, "mono_arch_llvm_throw_exception", NULL, TRUE); tramp = get_throw_exception ("llvm_throw_corlib_exception_trampoline", FALSE, TRUE, TRUE); mono_register_jit_icall (tramp, "mono_arch_llvm_throw_corlib_exception", NULL, TRUE); }
gpointer mono_arch_get_rethrow_exception (void) { static guint32* start; static int inited = 0; if (inited) return start; inited = 1; start = get_throw_exception (TRUE); return start; }
gpointer mono_arch_get_rethrow_exception (MonoTrampInfo **info, gboolean aot) { static guint32* start; static int inited = 0; g_assert (!aot); if (info) *info = NULL; if (inited) return start; inited = 1; start = get_throw_exception (TRUE); return start; }
/** * mono_arch_get_throw_corlib_exception: * * Returns a function pointer which can be used to raise * corlib exceptions. The returned function has the following * signature: void (*func) (guint32 ex_token, guint32 offset); * Here, offset is the offset which needs to be substracted from the caller IP * to get the IP of the throw. Passing the offset has the advantage that it * needs no relocations in the caller. */ gpointer mono_arch_get_throw_corlib_exception (void) { return get_throw_exception ("throw_corlib_exception_trampoline", FALSE, FALSE, TRUE); }
gpointer mono_arch_get_rethrow_exception (void) { return get_throw_exception ("rethrow_exception_trampoline", TRUE, FALSE, FALSE); }