X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmini%2Ftramp-ia64.c;h=f0ca392d9c55c97355b605918d7d993562cdc802;hb=85988f4de7356eff9a6da00764d73ce48da07448;hp=8024cc0ca085cc8f31167ce48a92f9d5b189a6e3;hpb=6bc565c1f7e7fd9aaf6ee6a141ea18479a316ac4;p=mono.git diff --git a/mono/mini/tramp-ia64.c b/mono/mini/tramp-ia64.c index 8024cc0ca08..f0ca392d9c5 100644 --- a/mono/mini/tramp-ia64.c +++ b/mono/mini/tramp-ia64.c @@ -123,52 +123,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) -{ - guint8 *callsite_begin; - guint64 *callsite = (guint64*)(gpointer)(code - 16); - guint64 instructions [3]; - guint64 buf [16]; - Ia64CodegenState gen; - - while ((ia64_bundle_template (callsite) != IA64_TEMPLATE_MLX) && - (ia64_bundle_template (callsite) != IA64_TEMPLATE_MLXS)) - callsite -= 2; - callsite_begin = (guint8*)callsite; - - /* Replace the code generated by emit_call with a sets of nops */ - - /* The first bundle might have other instructions in it */ - instructions [0] = ia64_bundle_ins1 (callsite); - instructions [1] = IA64_NOP_X; - instructions [2] = IA64_NOP_X; - - ia64_codegen_init (gen, (guint8*)buf); - ia64_emit_bundle_template (&gen, ia64_bundle_template (callsite), instructions [0], instructions [1], instructions [2]); - ia64_codegen_close (gen); - - /* This might not be safe, but not all itanium processors support st16 */ - callsite [0] = buf [0]; - callsite [1] = buf [1]; - - callsite += 2; - - /* The other bundles can be full replaced with nops */ - - ia64_codegen_init (gen, (guint8*)buf); - ia64_emit_bundle_template (&gen, IA64_TEMPLATE_MII, IA64_NOP_M, IA64_NOP_I, IA64_NOP_I); - ia64_codegen_close (gen); - - while ((guint8*)callsite < code) { - callsite [0] = buf [0]; - callsite [1] = buf [1]; - callsite += 2; - } - - mono_arch_flush_icache (callsite_begin, code - callsite_begin); -} - guchar* mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInfo **info, gboolean aot) { @@ -181,8 +135,7 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf unw_dyn_region_info_t *r_pro; g_assert (!aot); - if (info) - *info = NULL; + *info = NULL; /* * Since jump trampolines are not patched, this trampoline is executed every @@ -317,25 +270,17 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf /* FIXME: Handle NATs in fp regs / scratch regs */ - if (tramp_type != MONO_TRAMPOLINE_CLASS_INIT) { - /* Load method address from function descriptor */ - ia64_ld8 (code, l0, IA64_R8); - ia64_mov_to_br (code, IA64_B6, l0); - } + /* Load method address from function descriptor */ + ia64_ld8 (code, l0, IA64_R8); + ia64_mov_to_br (code, IA64_B6, l0); /* Clean up register/memory stack frame */ ia64_adds_imm (code, IA64_SP, framesize, IA64_SP); ia64_mov_to_ar_i (code, IA64_PFS, l5); - if (tramp_type == MONO_TRAMPOLINE_CLASS_INIT) { - ia64_mov_ret_to_br (code, IA64_B0, l7); - ia64_br_ret_reg (code, IA64_B0); - } - else { - /* Call the compiled method */ - ia64_mov_to_br (code, IA64_B0, l7); - ia64_br_cond_reg (code, IA64_B6); - } + /* Call the compiled method */ + ia64_mov_to_br (code, IA64_B0, l7); + ia64_br_cond_reg (code, IA64_B6); ia64_codegen_close (code);