Move mono_get_optimizations_for_method to mini.c, since driver.c is only included...
authorRolf Bjarne Kvinge <rolf@xamarin.com>
Thu, 24 Oct 2013 13:24:32 +0000 (15:24 +0200)
committerRolf Bjarne Kvinge <rolf@xamarin.com>
Thu, 24 Oct 2013 14:07:43 +0000 (16:07 +0200)
mono/mini/driver.c
mono/mini/mini.c
mono/mini/mini.h

index 8b4292ca60e022b5f2d38580663868d17606b28a..df7e57641752915c2a304034b438c3ead174bd21 100644 (file)
@@ -342,33 +342,6 @@ domain_dump_native_code (MonoDomain *domain) {
 }
 #endif
 
-static gboolean do_single_method_regression = FALSE;
-static guint32 single_method_regression_opt;
-static MonoMethod *current_single_method = NULL;
-static GSList *single_method_list = NULL;
-static GHashTable *single_method_hash = NULL;
-
-guint32
-mono_get_optimizations_for_method (MonoMethod *method, guint32 default_opt)
-{
-       g_assert (method);
-
-       if (!do_single_method_regression)
-               return default_opt;
-       if (!current_single_method) {
-               if (!single_method_hash)
-                       single_method_hash = g_hash_table_new (g_direct_hash, g_direct_equal);
-               if (!g_hash_table_lookup (single_method_hash, method)) {
-                       g_hash_table_insert (single_method_hash, method, method);
-                       single_method_list = g_slist_prepend (single_method_list, method);
-               }
-               return default_opt;
-       }
-       if (method == current_single_method)
-               return single_method_regression_opt;
-       return default_opt;
-}
-
 static void
 mini_regression_step (MonoImage *image, int verbose, int *total_run, int *total,
                guint32 opt_flags,
index 03c522d4ae0bfe5a0740d29e8058680837ea66c5..a3591842ef191fb922a42b5320e178a2c04c0501 100644 (file)
@@ -6306,6 +6306,33 @@ mono_jit_find_compiled_method_with_jit_info (MonoDomain *domain, MonoMethod *met
        return NULL;
 }
 
+gboolean do_single_method_regression = FALSE;
+guint32 single_method_regression_opt = 0;
+MonoMethod *current_single_method = NULL;
+GSList *single_method_list = NULL;
+GHashTable *single_method_hash = NULL;
+
+guint32
+mono_get_optimizations_for_method (MonoMethod *method, guint32 default_opt)
+{
+       g_assert (method);
+
+       if (!do_single_method_regression)
+               return default_opt;
+       if (!current_single_method) {
+               if (!single_method_hash)
+                       single_method_hash = g_hash_table_new (g_direct_hash, g_direct_equal);
+               if (!g_hash_table_lookup (single_method_hash, method)) {
+                       g_hash_table_insert (single_method_hash, method, method);
+                       single_method_list = g_slist_prepend (single_method_list, method);
+               }
+               return default_opt;
+       }
+       if (method == current_single_method)
+               return single_method_regression_opt;
+       return default_opt;
+}
+
 gpointer
 mono_jit_find_compiled_method (MonoDomain *domain, MonoMethod *method)
 {
index 0a41407020b6d056db4a4ddda67548f52b706bbe..77c76edfd17b049932932ed967b33ecb62eba5a8 100644 (file)
@@ -526,6 +526,11 @@ extern gboolean mono_do_x86_stack_align;
 extern const char *mono_build_date;
 extern gboolean mono_do_signal_chaining;
 extern gboolean mono_use_llvm;
+extern gboolean do_single_method_regression;
+extern guint32 single_method_regression_opt;
+extern MonoMethod *current_single_method;
+extern GSList *single_method_list;
+extern GHashTable *single_method_hash;
 
 #define INS_INFO(opcode) (&ins_info [((opcode) - OP_START - 1) * 4])