Merge pull request #1155 from steffen-kiess/json-string
[mono.git] / mono / mini / mini-arm.c
index 06456fdd7ab9079c842c4c1d545a462219beeb45..d89c46b500e02d5185b226eab391f81bc1d9c65c 100644 (file)
@@ -954,12 +954,25 @@ mono_arch_init (void)
        arm_fpu = MONO_ARM_FPU_VFP;
 
 #if defined(ARM_FPU_NONE) && !defined(__APPLE__)
-       /* If we're compiling with a soft float fallback and it
-          turns out that no VFP unit is available, we need to
-          switch to soft float. We don't do this for iOS, since
-          iOS devices always have a VFP unit. */
+       /*
+        * If we're compiling with a soft float fallback and it
+        * turns out that no VFP unit is available, we need to
+        * switch to soft float. We don't do this for iOS, since
+        * iOS devices always have a VFP unit.
+        */
        if (!mono_hwcap_arm_has_vfp)
                arm_fpu = MONO_ARM_FPU_NONE;
+
+       /*
+        * This environment variable can be useful in testing
+        * environments to make sure the soft float fallback
+        * works. Most ARM devices have VFP units these days, so
+        * normally soft float code would not be exercised much.
+        */
+       const char *soft = g_getenv ("MONO_ARM_FORCE_SOFT_FLOAT");
+
+       if (soft && !strncmp (soft, "1", 1))
+               arm_fpu = MONO_ARM_FPU_NONE;
 #endif
 #endif
 
@@ -1740,7 +1753,7 @@ mono_arch_tail_call_supported (MonoCompile *cfg, MonoMethodSignature *caller_sig
         * the extra stack space would be left on the stack after the tail call.
         */
        res = c1->stack_usage >= c2->stack_usage;
-       callee_ret = mini_replace_type (callee_sig->ret);
+       callee_ret = mini_get_underlying_type (cfg, callee_sig->ret);
        if (callee_ret && MONO_TYPE_ISSTRUCT (callee_ret) && c2->ret.storage != RegTypeStructByVal)
                /* An address on the callee's stack is passed as the first argument */
                res = FALSE;
@@ -1856,7 +1869,7 @@ mono_arch_allocate_vars (MonoCompile *cfg)
        if (!cfg->arch.cinfo)
                cfg->arch.cinfo = get_call_info (cfg->generic_sharing_context, cfg->mempool, sig);
        cinfo = cfg->arch.cinfo;
-       sig_ret = mini_replace_type (sig->ret);
+       sig_ret = mini_get_underlying_type (cfg, sig->ret);
 
        mono_arch_compute_omit_fp (cfg);