more c*****y windows issues.
[mono.git] / mono / mini / driver.c
index 8090fcd749d2c893823c2976be143b12c6683958..34b7d4ea398d51a6b535ec443e77377f15db82f3 100644 (file)
@@ -93,7 +93,6 @@ opt_names [] = {
        MONO_OPT_LOOP |  \
        MONO_OPT_AOT)
 
-/* SSAPRE does not work correctly on non x86 platforms (bug #70637) */
 #define EXCLUDED_FROM_ALL (MONO_OPT_SHARED | MONO_OPT_PRECOMP)
 
 static guint32
@@ -304,10 +303,8 @@ mini_regression (MonoImage *image, int verbose, int *total_run) {
                comp_time = elapsed = 0.0;
 
                /* fixme: ugly hack - delete all previously compiled methods */
-               for (i = 0; i < mono_image_get_table_rows (image, MONO_TABLE_METHOD); ++i) {
-                       method = mono_get_method (image, MONO_TOKEN_METHOD_DEF | (i + 1), NULL);
-                       method->info = NULL;
-               }
+               g_hash_table_destroy (mono_domain_get ()->jit_trampoline_hash);
+               mono_domain_get ()->jit_trampoline_hash = g_hash_table_new (mono_aligned_addr_hash, NULL);
 
                g_timer_start (timer);
                if (mini_stats_fd)
@@ -411,13 +408,27 @@ compile_all_methods_thread_main (CompileAllThreadArgs *args)
        int verbose = args->verbose;
        MonoImage *image = mono_assembly_get_image (ass);
        MonoMethod *method;
+       MonoCompile *cfg;
        int i, count = 0;
 
        for (i = 0; i < mono_image_get_table_rows (image, MONO_TABLE_METHOD); ++i) {
-               method = mono_get_method (image, MONO_TOKEN_METHOD_DEF | (i + 1), NULL);
-               if (method->flags & METHOD_ATTRIBUTE_ABSTRACT)
+               guint32 token = MONO_TOKEN_METHOD_DEF | (i + 1);
+               MonoMethodSignature *sig;
+
+               if (mono_metadata_has_generic_params (image, token))
+                       continue;
+
+               method = mono_get_method (image, token, NULL);
+               if ((method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) ||
+                   (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) ||
+                   (method->iflags & METHOD_IMPL_ATTRIBUTE_RUNTIME) ||
+                   (method->flags & METHOD_ATTRIBUTE_ABSTRACT))
                        continue;
-               if (method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL)
+
+               if (method->klass->generic_container)
+                       continue;
+               sig = mono_method_signature (method);
+               if (sig->has_type_parameters)
                        continue;
 
                count++;
@@ -426,7 +437,8 @@ compile_all_methods_thread_main (CompileAllThreadArgs *args)
                        g_print ("Compiling %d %s\n", count, desc);
                        g_free (desc);
                }
-               mono_compile_method (method);
+               cfg = mini_method_compile (method, DEFAULT_OPTIMIZATIONS, mono_get_root_domain (), FALSE, FALSE, 0);
+               mono_destroy_compile (cfg);
        }
 
 }