Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / mini / mini-mips.c
index d660489fe5e4c37ea47bf2137b2bf155da4f9eaf..0a489649c86dc3eae078a1a0342647d73ca8a5f8 100644 (file)
@@ -21,6 +21,7 @@
 #include <mono/metadata/debug-helpers.h>
 #include <mono/utils/mono-mmap.h>
 #include <mono/utils/mono-hwcap.h>
+#include <mono/utils/unlocked.h>
 
 #include <mono/arch/mips/mips-codegen.h>
 
@@ -1351,8 +1352,7 @@ mono_arch_compute_omit_fp (MonoCompile *cfg)
                cfg->arch.omit_fp = FALSE;
        if (!sig->pinvoke && (sig->call_convention == MONO_CALL_VARARG))
                cfg->arch.omit_fp = FALSE;
-       if ((mono_jit_trace_calls != NULL && mono_trace_eval (cfg->method)) ||
-               (cfg->prof_options & MONO_PROFILE_ENTER_LEAVE))
+       if ((mono_jit_trace_calls != NULL && mono_trace_eval (cfg->method)))
                cfg->arch.omit_fp = FALSE;
        /*
         * On MIPS, fp points to the bottom of the frame, so it can be eliminated even if
@@ -1881,7 +1881,7 @@ mono_arch_emit_outarg_vt (MonoCompile *cfg, MonoInst *ins, MonoInst *src)
                        soffset += SIZEOF_REGISTER;
                }
                if (ovf_size != 0) {
-                       mini_emit_memcpy (cfg, mips_sp, doffset, src->dreg, soffset, ovf_size * sizeof (gpointer), 0);
+                       mini_emit_memcpy (cfg, mips_sp, doffset, src->dreg, soffset, ovf_size * sizeof (gpointer), SIZEOF_VOID_P);
                }
        } else if (ainfo->storage == ArgInFReg) {
                int tmpr = mono_alloc_freg (cfg);
@@ -1909,7 +1909,7 @@ mono_arch_emit_outarg_vt (MonoCompile *cfg, MonoInst *ins, MonoInst *src)
                        g_assert (ovf_size > 0);
 
                EMIT_NEW_VARLOADA (cfg, load, vtcopy, vtcopy->inst_vtype);
-               mini_emit_memcpy (cfg, load->dreg, 0, src->dreg, 0, size, 0);
+               mini_emit_memcpy (cfg, load->dreg, 0, src->dreg, 0, size, SIZEOF_VOID_P);
 
                if (ainfo->offset)
                        MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STORE_MEMBASE_REG, mips_at, ainfo->offset, load->dreg);
@@ -3217,21 +3217,6 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
 
        cpos = bb->max_offset;
 
-#if 0
-       if (cfg->prof_options & MONO_PROFILE_COVERAGE) {
-               MonoCoverageInfo *cov = mono_get_coverage_info (cfg->method);
-               g_assert (!mono_compile_aot);
-               cpos += 20;
-               if (bb->cil_code)
-                       cov->data [bb->dfn].iloffset = bb->cil_code - cfg->cil_code;
-               /* this is not thread save, but good enough */
-               /* fixme: howto handle overflows? */
-               mips_load_const (code, mips_at, &cov->data [bb->dfn].count);
-               mips_lw (code, mips_temp, mips_at, 0);
-               mips_addiu (code, mips_temp, mips_temp, 1);
-               mips_sw (code, mips_temp, mips_at, 0);
-       }
-#endif
        MONO_BB_FOR_EACH_INS (bb, ins) {
                offset = code - cfg->native_code;
 
@@ -4832,9 +4817,6 @@ mono_arch_emit_prolog (MonoCompile *cfg)
                MonoInst *ins = bb->code;
                bb->max_offset = max_offset;
 
-               if (cfg->prof_options & MONO_PROFILE_COVERAGE)
-                       max_offset += 6; 
-
                MONO_BB_FOR_EACH_INS (bb, ins)
                        max_offset += ((guint8 *)ins_get_spec (ins->opcode))[MONO_INST_LEN];
        }
@@ -5310,9 +5292,6 @@ mono_arch_emit_epilog_sub (MonoCompile *cfg, guint8 *code)
        if (mono_jit_trace_calls != NULL)
                max_epilog_size += 50;
 
-       if (cfg->prof_options & MONO_PROFILE_ENTER_LEAVE)
-               max_epilog_size += 50;
-
        if (code)
                pos = code - cfg->native_code;
        while (cfg->code_len + max_epilog_size > (cfg->code_size - 16)) {
@@ -5583,12 +5562,6 @@ mono_arch_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMetho
        return NULL;
 }
 
-gboolean
-mono_arch_print_tree (MonoInst *tree, int arity)
-{
-       return 0;
-}
-
 mgreg_t
 mono_arch_context_get_int_reg (MonoContext *ctx, int reg)
 {
@@ -5737,7 +5710,7 @@ mono_arch_build_imt_trampoline (MonoVTable *vtable, MonoDomain *domain, MonoIMTC
        }
 
        if (!fail_tramp)
-               mono_stats.imt_trampolines_size += code - start;
+               UnlockedAdd (&mono_stats.imt_trampolines_size, code - start);
        g_assert (code - start <= size);
        mono_arch_flush_icache (start, size);