Merge pull request #3936 from kumpera/monoclass_reorg2
[mono.git] / mono / mini / liveness.c
index ee87dfa082ad509892177d58242c5dc7bf962971..7cc05634123e8b4a78b0d5f3c007578e563b3c1c 100644 (file)
@@ -6,9 +6,11 @@
  *
  * (C) 2002 Ximian, Inc.
  * Copyright 2011 Xamarin, Inc (http://www.xamarin.com)
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
  */
 
 #include <config.h>
+#include <mono/utils/mono-compiler.h>
 
 #ifndef DISABLE_JIT
 
@@ -103,8 +105,8 @@ visit_bb (MonoCompile *cfg, MonoBasicBlock *bb, GSList **visited)
                        cfg->varinfo [vi->idx]->flags |= MONO_INST_VOLATILE;
                        if (SIZEOF_REGISTER == 4 && (var->type == STACK_I8 || (var->type == STACK_R8 && COMPILE_SOFT_FLOAT (cfg)))) {
                                /* Make the component vregs volatile as well (#612206) */
-                               get_vreg_to_inst (cfg, var->dreg + 1)->flags |= MONO_INST_VOLATILE;
-                               get_vreg_to_inst (cfg, var->dreg + 2)->flags |= MONO_INST_VOLATILE;
+                               get_vreg_to_inst (cfg, MONO_LVREG_LS (var->dreg))->flags |= MONO_INST_VOLATILE;
+                               get_vreg_to_inst (cfg, MONO_LVREG_MS (var->dreg))->flags |= MONO_INST_VOLATILE;
                        }
                }
                        
@@ -122,8 +124,8 @@ visit_bb (MonoCompile *cfg, MonoBasicBlock *bb, GSList **visited)
                                cfg->varinfo [vi->idx]->flags |= MONO_INST_VOLATILE;
                                if (SIZEOF_REGISTER == 4 && (var->type == STACK_I8 || (var->type == STACK_R8 && COMPILE_SOFT_FLOAT (cfg)))) {
                                        /* Make the component vregs volatile as well (#612206) */
-                                       get_vreg_to_inst (cfg, var->dreg + 1)->flags |= MONO_INST_VOLATILE;
-                                       get_vreg_to_inst (cfg, var->dreg + 2)->flags |= MONO_INST_VOLATILE;
+                                       get_vreg_to_inst (cfg, MONO_LVREG_LS (var->dreg))->flags |= MONO_INST_VOLATILE;
+                                       get_vreg_to_inst (cfg, MONO_LVREG_MS (var->dreg))->flags |= MONO_INST_VOLATILE;
                                }
                        }
                }
@@ -1157,4 +1159,8 @@ mono_analyze_liveness_gc (MonoCompile *cfg)
        g_free (vreg_to_varinfo);
 }
 
-#endif /* DISABLE_JIT */
+#else /* !DISABLE_JIT */
+
+MONO_EMPTY_SOURCE_FILE (liveness);
+
+#endif /* !DISABLE_JIT */