X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmini%2Ftramp-mips.c;h=37f17a47c89b3d7c20e638236364ae6fa25b4533;hb=66d4425f049880bca9241e0aacf7482ecfc248e0;hp=a8dbfd8fa5427027f497a16fd38f5947e4421315;hpb=f03a1b538bfb0d9be810688e8713731e122320b5;p=mono.git diff --git a/mono/mini/tramp-mips.c b/mono/mini/tramp-mips.c index a8dbfd8fa54..37f17a47c89 100644 --- a/mono/mini/tramp-mips.c +++ b/mono/mini/tramp-mips.c @@ -53,6 +53,8 @@ mono_arch_get_unbox_trampoline (MonoMethod *m, gpointer addr) /*g_print ("unbox trampoline at %d for %s:%s\n", this_pos, m->klass->name, m->name); g_print ("unbox code is at %p for method at %p\n", start, addr);*/ + mono_tramp_info_register (mono_tramp_info_create (NULL, start, code - start, NULL, NULL), domain); + return start; } @@ -112,42 +114,6 @@ mono_arch_patch_plt_entry (guint8 *code, gpointer *got, mgreg_t *regs, guint8 *a #define STACK (int)(ALIGN_TO(4*IREG_SIZE + 8 + sizeof(MonoLMF) + 32, 8)) -void -mono_arch_nullify_class_init_trampoline (guint8 *code, mgreg_t *regs) -{ - guint32 *code32 = (guint32*)code; - - /* back up to the jal/jalr instruction */ - code32 -= 2; - - /* Check for jal/jalr -- and NOP it out */ - if ((((*code32)&0xfc000000) == 0x0c000000) - || (((*code32)&0xfc1f003f) == 0x00000009)) { - mips_nop (code32); - mono_arch_flush_icache ((gpointer)(code32 - 1), 4); - return; - } - g_assert_not_reached (); -} - -gpointer -mono_arch_get_nullified_class_init_trampoline (MonoTrampInfo **info) -{ - guint8 *buf, *code; - - code = buf = mono_global_codeman_reserve (16); - - mips_jr (code, mips_ra); - mips_nop (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; -} - /* * Stack frame description when the generic trampoline is called. * caller frame @@ -247,10 +213,7 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf } /* Arg 3: MonoMethod *method. */ - if (tramp_type == MONO_TRAMPOLINE_GENERIC_CLASS_INIT) - mips_lw (code, mips_a2, mips_sp, lmf + G_STRUCT_OFFSET (MonoLMF, iregs [mips_a0])); - else - mips_lw (code, mips_a2, mips_sp, lmf + G_STRUCT_OFFSET (MonoLMF, method)); + mips_lw (code, mips_a2, mips_sp, lmf + G_STRUCT_OFFSET (MonoLMF, method)); /* Arg 4: Trampoline */ mips_move (code, mips_a3, mips_zero); @@ -363,6 +326,8 @@ mono_arch_get_static_rgctx_trampoline (MonoMethod *m, MonoMethodRuntimeGenericCo mono_arch_flush_icache (start, code - start); + mono_tramp_info_register (mono_tramp_info_create (NULL, start, code - start, NULL, NULL), domain); + return start; }