Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / mini / tramp-sparc.c
index 89418779664c74f7ea8e2498b7a453b7d8415a6f..b88495977d9d1b5f7346d1e7ecf8e28a11a4957a 100644 (file)
@@ -1,5 +1,6 @@
-/*
- * tramp-sparc.c: JIT trampoline code for Sparc
+/**
+ * \file
+ * JIT trampoline code for Sparc
  *
  * Authors:
  *   Mark Crichton (crichton@gimp.org)
@@ -18,6 +19,7 @@
 
 #include "mini.h"
 #include "mini-sparc.h"
+#include "jit-icalls.h"
 
 /*
  * mono_arch_get_unbox_trampoline:
@@ -51,6 +53,8 @@ mono_arch_get_unbox_trampoline (MonoMethod *m, gpointer addr)
 
        mono_arch_flush_icache (start, code - start);
 
+       mono_tramp_info_register (mono_tramp_info_create (NULL, start, code - start, NULL, NULL), NULL);
+
        return start;
 }
 
@@ -68,19 +72,6 @@ mono_arch_patch_plt_entry (guint8 *code, gpointer *got, mgreg_t *regs, guint8 *a
        g_assert_not_reached ();
 }
 
-void
-mono_arch_nullify_class_init_trampoline (guint8 *code, mgreg_t *regs)
-{
-       /* Patch calling code */
-       sparc_nop (code);
-}
-
-void
-mono_arch_nullify_plt_entry (guint8 *code, mgreg_t *regs)
-{
-       g_assert_not_reached ();
-}
-
 #define ALIGN_TO(val,align) (((val) + ((align) - 1)) & ~((align) - 1))
 
 guchar*
@@ -91,8 +82,7 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf
        gboolean has_caller;
 
        g_assert (!aot);
-       if (info)
-               *info = NULL;
+       *info = NULL;
 
        if (tramp_type == MONO_TRAMPOLINE_JUMP)
                has_caller = FALSE;
@@ -182,7 +172,7 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf
        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);
 
@@ -198,10 +188,7 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf
                sparc_lddf_imm (code, sparc_sp, MONO_SPARC_STACK_BIAS + 320 + (i * 8), sparc_f0 + (i * 2));
 #endif 
 
-       if (tramp_type == MONO_TRAMPOLINE_CLASS_INIT)
-               sparc_ret (code);
-       else
-               sparc_jmpl (code, sparc_o0, sparc_g0, sparc_g0);
+       sparc_jmpl (code, sparc_o0, sparc_g0, sparc_g0);
 
        /* restore previous frame in delay slot */
        sparc_restore_simple (code);
@@ -273,20 +260,3 @@ mono_arch_create_rgctx_lazy_fetch_trampoline (guint32 slot, MonoTrampInfo **info
        g_assert_not_reached ();
        return NULL;
 }
-
-gpointer
-mono_arch_get_nullified_class_init_trampoline (MonoTrampInfo **info)
-{
-       guint8 *buf, *code;
-
-       code = buf = mono_global_codeman_reserve (16);
-
-       sparc_ret (code);
-
-       mono_arch_flush_icache (buf, code - buf);
-
-       if (info)
-               *info = mono_tramp_info_create ("nullified_class_init_trampoline", buf, code - buf, NULL, NULL);
-
-       return buf;
-}