2009-02-09 Zoltan Varga <vargaz@gmail.com>
authorZoltan Varga <vargaz@gmail.com>
Mon, 9 Feb 2009 01:08:13 +0000 (01:08 -0000)
committerZoltan Varga <vargaz@gmail.com>
Mon, 9 Feb 2009 01:08:13 +0000 (01:08 -0000)
* 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
mono/mini/exceptions-amd64.c
mono/mini/mini.h

index 182a23c45383cc9ffd32a95fdb57b15685e84132..bceaf36f5e900efd44dfc672fd7d3a6667c5f62c 100644 (file)
@@ -1,5 +1,8 @@
 2009-02-09  Zoltan Varga  <vargaz@gmail.com>
 
+       * 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.
index 40121611c7088c8362da4831f58e821770119b29..30358ea413b51102f7fc9efd43252e97fdcfc5db 100644 (file)
@@ -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
index 17b1a7ec9bdc3d2a190a5ae987f7868c7bd4b1f3..083a3340bea412b2fe10fd04bba8ea60c5ce7f9e 100644 (file)
@@ -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;