Merge pull request #1603 from iainx/coverage-null-protect
[mono.git] / mono / mini / tramp-sparc.c
index 642f773d46b29c573dfa09d2a21dee9121dadf0e..1288603235a8f34bb2584e1bed38223653d2bd37 100644 (file)
@@ -75,12 +75,6 @@ mono_arch_nullify_class_init_trampoline (guint8 *code, mgreg_t *regs)
        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*
@@ -261,8 +255,6 @@ mono_arch_create_specific_trampoline (gpointer arg1, MonoTrampolineType tramp_ty
        if (code_len)
                *code_len = (code - buf) * 4;
 
-       mono_jit_stats.method_trampolines++;
-
        mono_arch_flush_icache ((guint8*)buf, (code - buf) * 4);
 
        return buf;
@@ -275,3 +267,20 @@ 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;
+}