Revert dfa9220e8b7e89c29447a71c7b30d5a9a3cbdfec.
[mono.git] / mono / mini / mini-amd64.c
index 3e926c59de292e1489303d02f9ff2d67a8cb753b..f4945b9459f1c78a2db5ee1fcdbcc8bbb693437a 100644 (file)
@@ -171,36 +171,11 @@ mono_arch_xregname (int reg)
                return "unknown";
 }
 
-G_GNUC_UNUSED static void
-break_count (void)
-{
-}
-
-G_GNUC_UNUSED static gboolean
-debug_count (void)
-{
-       static int count = 0;
-       count ++;
-
-       if (!getenv ("COUNT"))
-               return TRUE;
-
-       if (count == atoi (getenv ("COUNT"))) {
-               break_count ();
-       }
-
-       if (count > atoi (getenv ("COUNT"))) {
-               return FALSE;
-       }
-
-       return TRUE;
-}
-
 static gboolean
 debug_omit_fp (void)
 {
 #if 0
-       return debug_count ();
+       return mono_debug_count ();
 #else
        return TRUE;
 #endif
@@ -1202,7 +1177,7 @@ get_call_info (MonoGenericSharingContext *gsctx, MonoMemPool *mp, MonoMethodSign
  * Returns the size of the argument area on the stack.
  */
 int
-mono_arch_get_argument_info (MonoMethodSignature *csig, int param_count, MonoJitArgumentInfo *arg_info)
+mono_arch_get_argument_info (MonoGenericSharingContext *gsctx, MonoMethodSignature *csig, int param_count, MonoJitArgumentInfo *arg_info)
 {
        int k;
        CallInfo *cinfo = get_call_info (NULL, NULL, csig);
@@ -1345,7 +1320,7 @@ mono_arch_cleanup (void)
  * This function returns the optimizations supported on this cpu.
  */
 guint32
-mono_arch_cpu_optimizazions (guint32 *exclude_mask)
+mono_arch_cpu_optimizations (guint32 *exclude_mask)
 {
        int eax, ebx, ecx, edx;
        guint32 opts = 0;
@@ -1784,7 +1759,7 @@ mono_arch_allocate_vars (MonoCompile *cfg)
        } else {
                if (cfg->arch.omit_fp)
                        cfg->arch.reg_save_area_offset = offset;
-               /* Reserve space for caller saved registers */
+               /* Reserve space for callee saved registers */
                for (i = 0; i < AMD64_NREG; ++i)
                        if (AMD64_IS_CALLEE_SAVED_REG (i) && (cfg->used_int_regs & (1 << i))) {
                                offset += sizeof(mgreg_t);
@@ -3613,11 +3588,12 @@ mono_amd64_have_tls_get (void)
 #ifdef __APPLE__
        static gboolean have_tls_get = FALSE;
        static gboolean inited = FALSE;
+       guint8 *ins;
 
        if (inited)
                return have_tls_get;
 
-       guint8 *ins = (guint8*)pthread_getspecific;
+       ins = (guint8*)pthread_getspecific;
 
        /*
         * We're looking for these two instructions: