Merge pull request #5420 from nealef/z13v5
[mono.git] / mono / mini / driver.c
index 750aa206b992f47a3edd1f041041b090c3e04068..297179bf86cabaa76b112108bb7a977d9c65db1f 100644 (file)
@@ -512,6 +512,11 @@ mini_regression (MonoImage *image, int verbose, int *total_run)
                }
        } else {
                for (opt = 0; opt < G_N_ELEMENTS (opt_sets); ++opt) {
+                       /* builtin-types.cs needs OPT_INTRINS enabled */
+                       if (!strcmp ("builtin-types", image->assembly_name))
+                               if (!(opt_sets [opt] & MONO_OPT_INTRINS))
+                                       continue;
+
                        mini_regression_step (image, verbose, total_run, &total,
                                        opt_sets [opt] & ~exclude,
                                        timer, domain);
@@ -1415,7 +1420,7 @@ mono_jit_parse_options (int argc, char * argv[])
                        opt->break_on_exc = TRUE;
                } else if (strcmp (argv [i], "--stats") == 0) {
                        mono_counters_enable (-1);
-                       mono_stats.enabled = TRUE;
+                       InterlockedWriteBool (&mono_stats.enabled, TRUE);
                        mono_jit_stats.enabled = TRUE;
                } else if (strcmp (argv [i], "--break") == 0) {
                        if (i+1 >= argc){
@@ -1584,9 +1589,7 @@ mono_main (int argc, char* argv[])
        guint32 opt, action = DO_EXEC, recompilation_times = 1;
        MonoGraphOptions mono_graph_options = (MonoGraphOptions)0;
        int mini_verbose = 0;
-       gboolean enable_profile = FALSE;
        char *trace_options = NULL;
-       char *profile_options = NULL;
        char *aot_options = NULL;
        char *forced_version = NULL;
        GPtrArray *agents = NULL;
@@ -1764,7 +1767,7 @@ mono_main (int argc, char* argv[])
                        mono_print_vtable = TRUE;
                } else if (strcmp (argv [i], "--stats") == 0) {
                        mono_counters_enable (-1);
-                       mono_stats.enabled = TRUE;
+                       InterlockedWriteBool (&mono_stats.enabled, TRUE);
                        mono_jit_stats.enabled = TRUE;
 #ifndef DISABLE_AOT
                } else if (strcmp (argv [i], "--aot") == 0) {
@@ -1797,11 +1800,9 @@ mono_main (int argc, char* argv[])
                } else if (strcmp (argv [i], "--jitmap") == 0) {
                        mono_enable_jit_map ();
                } else if (strcmp (argv [i], "--profile") == 0) {
-                       enable_profile = TRUE;
-                       profile_options = NULL;
+                       mini_add_profiler_argument (NULL);
                } else if (strncmp (argv [i], "--profile=", 10) == 0) {
-                       enable_profile = TRUE;
-                       profile_options = argv [i] + 10;
+                       mini_add_profiler_argument (argv [i] + 10);
                } else if (strncmp (argv [i], "--agent=", 8) == 0) {
                        if (agents == NULL)
                                agents = g_ptr_array_new ();
@@ -2011,10 +2012,6 @@ mono_main (int argc, char* argv[])
        /* Set rootdir before loading config */
        mono_set_rootdir ();
 
-       if (enable_profile) {
-               mini_profiler_enable_with_options (profile_options);
-       }
-
        mono_attach_parse_options (attach_options);
 
        if (trace_options != NULL){
@@ -2381,6 +2378,12 @@ mono_jit_set_aot_mode (MonoAotMode mode)
        }
 }
 
+mono_bool
+mono_jit_aot_compiling (void)
+{
+       return mono_compile_aot;
+}
+
 /**
  * mono_jit_set_trace_options:
  * \param options string representing the trace options