From 600e528b81990364103a2e43b91d5c8727632bbe Mon Sep 17 00:00:00 2001 From: Zoltan Varga Date: Mon, 9 Feb 2009 01:08:13 +0000 Subject: [PATCH] 2009-02-09 Zoltan Varga * exceptions-amd64.c (mono_arch_get_throw_pending_exception_full): Rename this from get_throw_pending_exception, make the signature full aot compatible. svn path=/trunk/mono/; revision=126301 --- mono/mini/ChangeLog | 3 +++ mono/mini/exceptions-amd64.c | 24 ++++++++++++++---------- mono/mini/mini.h | 1 + 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/mono/mini/ChangeLog b/mono/mini/ChangeLog index 182a23c4538..bceaf36f5e9 100644 --- a/mono/mini/ChangeLog +++ b/mono/mini/ChangeLog @@ -1,5 +1,8 @@ 2009-02-09 Zoltan Varga + * exceptions-amd64.c (mono_arch_get_throw_pending_exception_full): Rename + this from get_throw_pending_exception, make the signature full aot compatible. + * Makefile.am (fullaotcheck): New target to run full-aot tests. * method-to-ir.c (inline_method): Save/Restore cfg->ret_var_set too. diff --git a/mono/mini/exceptions-amd64.c b/mono/mini/exceptions-amd64.c index 40121611c70..30358ea413b 100644 --- a/mono/mini/exceptions-amd64.c +++ b/mono/mini/exceptions-amd64.c @@ -895,17 +895,16 @@ get_original_ip (void) return lmf->rip; } -static gpointer -get_throw_pending_exception (void) +gpointer +mono_arch_get_throw_pending_exception_full (guint32 *code_size, MonoJumpInfo **ji, gboolean aot) { - static guint8* start; - static gboolean inited = FALSE; - guint8 *code; + guint8 *code, *start; guint8 *br[1]; gpointer throw_trampoline; - if (inited) - return start; + *ji = NULL; + + g_assert (!aot); start = code = mono_global_codeman_reserve (128); @@ -982,11 +981,13 @@ get_throw_pending_exception (void) g_assert ((code - start) < 128); - inited = TRUE; + *code_size = code - start; return start; } +static gpointer throw_pending_exception; + /* * Called when a thread receives an async exception while executing unmanaged code. * Instead of checking for this exception in the managed-to-native wrapper, we hijack @@ -1011,14 +1012,17 @@ mono_arch_notify_pending_exc (void) /* Signal that lmf->rip is set */ lmf->previous_lmf = (gpointer)((guint64)lmf->previous_lmf | 1); - *(gpointer*)(lmf->rsp - 8) = get_throw_pending_exception (); + *(gpointer*)(lmf->rsp - 8) = throw_pending_exception; } void mono_arch_exceptions_init (void) { + guint32 code_size; + MonoJumpInfo *ji; + /* Call this to avoid initialization races */ - get_throw_pending_exception (); + throw_pending_exception = mono_arch_get_throw_pending_exception_full (&code_size, &ji, FALSE); } #ifdef PLATFORM_WIN32 diff --git a/mono/mini/mini.h b/mono/mini/mini.h index 17b1a7ec9bd..083a3340bea 100644 --- a/mono/mini/mini.h +++ b/mono/mini/mini.h @@ -1444,6 +1444,7 @@ gpointer mono_arch_get_throw_exception_full (guint32 *code_size, MonoJumpInf gpointer mono_arch_get_rethrow_exception_full (guint32 *code_size, MonoJumpInfo **ji, gboolean aot) MONO_INTERNAL; gpointer mono_arch_get_throw_exception_by_name_full (guint32 *code_size, MonoJumpInfo **ji, gboolean aot) MONO_INTERNAL; gpointer mono_arch_get_throw_corlib_exception_full (guint32 *code_size, MonoJumpInfo **ji, gboolean aot) MONO_INTERNAL; +gpointer mono_arch_get_throw_pending_exception_full (guint32 *code_size, MonoJumpInfo **ji, gboolean aot) MONO_INTERNAL; gboolean mono_arch_handle_exception (void *sigctx, gpointer obj, gboolean test_only) MONO_INTERNAL; void mono_arch_handle_altstack_exception (void *sigctx, gpointer fault_addr, gboolean stack_ovf) MONO_INTERNAL; gboolean mono_handle_soft_stack_ovf (MonoJitTlsData *jit_tls, MonoJitInfo *ji, void *ctx, guint8* fault_addr) MONO_INTERNAL; -- 2.25.1