2004-07-02 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / mono / mini / driver.c
index bb159ba29c2853413bd80b57df970014379a8cc3..d6af531824f8a9d50f60633270855d346b57a14b 100644 (file)
@@ -140,7 +140,7 @@ parse_optimizations (const char* p)
                                if (invert)
                                        opt = 0;
                                else
-                                       opt = ~(MONO_OPT_SHARED | MONO_OPT_PRECOMP | exclude);
+                                       opt = ~(MONO_OPT_SHARED | MONO_OPT_PRECOMP | MONO_OPT_ABCREM | exclude);
                                p += 3;
                                if (*p == ',')
                                        p++;
@@ -269,7 +269,7 @@ mini_regression (MonoImage *image, int verbose, int *total_run) {
        }
 
        /* load the metadata */
-       for (i = 0; i < image->tables [MONO_TABLE_METHOD].rows; ++i) {
+       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);
                mono_class_init (method->klass);
 
@@ -290,13 +290,13 @@ mini_regression (MonoImage *image, int verbose, int *total_run) {
                opt_flags = opt_sets [opt];
                mono_set_defaults (verbose, opt_flags);
                n = opt_descr (opt_flags);
-               g_print ("Test run: image=%s, opts=%s\n", image->name, n);
+               g_print ("Test run: image=%s, opts=%s\n", mono_image_get_filename (image), n);
                g_free (n);
                cfailed = failed = run = code_size = 0;
                comp_time = elapsed = 0.0;
 
                /* fixme: ugly hack - delete all previously compiled methods */
-               for (i = 0; i < image->tables [MONO_TABLE_METHOD].rows; ++i) {
+               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;
                }
@@ -304,20 +304,20 @@ mini_regression (MonoImage *image, int verbose, int *total_run) {
                g_timer_start (timer);
                if (mini_stats_fd)
                        fprintf (mini_stats_fd, "[");
-               for (i = 0; i < image->tables [MONO_TABLE_METHOD].rows; ++i) {
+               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 (strncmp (method->name, "test_", 5) == 0) {
                                expected = atoi (method->name + 5);
                                run++;
                                start_time = g_timer_elapsed (timer, NULL);
                                comp_time -= start_time; 
-                               cfg = mini_method_compile (method, opt_flags, mono_root_domain, TRUE, 0);
+                               cfg = mini_method_compile (method, opt_flags, mono_get_root_domain (), TRUE, 0);
                                comp_time += g_timer_elapsed (timer, NULL);
                                if (cfg) {
                                        if (verbose >= 2)
                                                g_print ("Running '%s' ...\n", method->name);
 #ifdef MONO_USE_AOT_COMPILER
-                                       if ((jinfo = mono_aot_get_method (mono_root_domain, method)))
+                                       if ((jinfo = mono_aot_get_method (mono_get_root_domain (), method)))
                                                func = jinfo->code_start;
                                        else
 #endif
@@ -375,7 +375,7 @@ mini_regression_list (int verbose, int count, char *images [])
                        g_warning ("failed to load assembly: %s", images [i]);
                        continue;
                }
-               total += mini_regression (ass->image, verbose, &run);
+               total += mini_regression (mono_assembly_get_image (ass), verbose, &run);
                total_run += run;
                mono_assembly_close (ass);
        }
@@ -402,11 +402,11 @@ compile_all_methods_thread_main (CompileAllThreadArgs *args)
 {
        MonoAssembly *ass = args->ass;
        int verbose = args->verbose;
-       MonoImage *image = ass->image;
+       MonoImage *image = mono_assembly_get_image (ass);
        MonoMethod *method;
        int i, count = 0;
 
-       for (i = 0; i < image->tables [MONO_TABLE_METHOD].rows; ++i) {
+       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)
                        continue;
@@ -452,12 +452,12 @@ compile_all_methods (MonoAssembly *ass, int verbose)
 int 
 mono_jit_exec (MonoDomain *domain, MonoAssembly *assembly, int argc, char *argv[])
 {
-       MonoImage *image = assembly->image;
+       MonoImage *image = mono_assembly_get_image (assembly);
        MonoMethod *method;
        guint32 entry = mono_image_get_entry_point (image);
 
        if (!entry) {
-               g_print ("Assembly '%s' doesn't have an entry point.\n", image->name);
+               g_print ("Assembly '%s' doesn't have an entry point.\n", mono_image_get_filename (image));
                /* FIXME: remove this silly requirement. */
                mono_environment_exitcode_set (1);
                return 1;
@@ -566,7 +566,7 @@ mini_trace_usage (void)
 
 static const char *info = ""
 #ifdef HAVE_KW_THREAD
-       "\tTLS:           NPTL\n"
+       "\tTLS:           __thread\n"
 #else
        "\tTLS:           normal\n"
 #endif /* HAVE_KW_THREAD */
@@ -634,7 +634,7 @@ mono_main (int argc, char* argv[])
                                const guchar *clibpath;
                                mono_init ("mono");
                                cerror = mono_check_corlib_version ();
-                               clibpath = mono_defaults.corlib? mono_defaults.corlib->name: "unknown";
+                               clibpath = mono_defaults.corlib? mono_image_get_filename (mono_defaults.corlib): "unknown";
                                if (cerror) {
                                        g_print ("The currently installed mscorlib doesn't match this runtime version.\n");
                                        g_print ("The error is: %s\n", cerror);
@@ -814,7 +814,7 @@ mono_main (int argc, char* argv[])
                mini_cleanup (domain);
                return 3;
        }
-       method = mono_method_desc_search_in_image (desc, assembly->image);
+       method = mono_method_desc_search_in_image (desc, mono_assembly_get_image (assembly));
        if (!method) {
                g_print ("Cannot find method %s\n", mname);
                mini_cleanup (domain);
@@ -842,7 +842,7 @@ mono_main (int argc, char* argv[])
                        break;
                }
 
-               cfg = mini_method_compile (method, opt, mono_root_domain, FALSE, part);
+               cfg = mini_method_compile (method, opt, mono_get_root_domain (), FALSE, part);
                if ((mono_graph_options & MONO_GRAPH_CFG_SSA) && !(cfg->comp_done & MONO_COMP_SSA)) {
                        g_warning ("no SSA info available (use -O=deadce)");
                        return 1;
@@ -874,7 +874,7 @@ mono_main (int argc, char* argv[])
                                opt = opt_sets [i];
                                g_timer_start (timer);
                                for (j = 0; j < count; ++j) {
-                                       cfg = mini_method_compile (method, opt, mono_root_domain, FALSE, 0);
+                                       cfg = mini_method_compile (method, opt, mono_get_root_domain (), FALSE, 0);
                                        mono_destroy_compile (cfg);
                                }
                                g_timer_stop (timer);
@@ -897,12 +897,12 @@ mono_main (int argc, char* argv[])
                                        (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL))
                                        method = mono_marshal_get_native_wrapper (method);
 
-                               cfg = mini_method_compile (method, opt, mono_root_domain, FALSE, 0);
+                               cfg = mini_method_compile (method, opt, mono_get_root_domain (), FALSE, 0);
                                mono_destroy_compile (cfg);
                        }
                }
        } else {
-               cfg = mini_method_compile (method, opt, mono_root_domain, FALSE, 0);
+               cfg = mini_method_compile (method, opt, mono_get_root_domain (), FALSE, 0);
                mono_destroy_compile (cfg);
        }