NaCl runtime fixes
[mono.git] / mono / mini / driver.c
index e01a6d304ccb02606d373579d53df702dcc77e64..dc73ec4fbfe172e1458975061a0112709c2c5216 100644 (file)
@@ -138,7 +138,7 @@ extern char *nacl_mono_path;
        MONO_OPT_SIMD | \
        MONO_OPT_AOT)
 
-#define EXCLUDED_FROM_ALL (MONO_OPT_SHARED | MONO_OPT_PRECOMP | MONO_OPT_UNSAFE)
+#define EXCLUDED_FROM_ALL (MONO_OPT_SHARED | MONO_OPT_PRECOMP | MONO_OPT_UNSAFE | MONO_OPT_GSHAREDVT)
 
 static guint32
 parse_optimizations (const char* p)
@@ -150,7 +150,7 @@ parse_optimizations (const char* p)
        int i, invert, len;
 
        /* call out to cpu detection code here that sets the defaults ... */
-       opt |= mono_arch_cpu_optimizazions (&exclude);
+       opt |= mono_arch_cpu_optimizations (&exclude);
        opt &= ~exclude;
        if (!p)
                return opt;
@@ -351,7 +351,7 @@ mini_regression (MonoImage *image, int verbose, int *total_run)
        MonoDomain *domain = mono_domain_get ();
        guint32 exclude = 0;
 
-       mono_arch_cpu_optimizazions (&exclude);
+       mono_arch_cpu_optimizations (&exclude);
 
        if (mini_stats_fd) {
                fprintf (mini_stats_fd, "$stattitle = \'Mono Benchmark Results (various optimizations)\';\n");
@@ -1171,9 +1171,11 @@ mini_trace_usage (void)
                 "    none                 No assemblies\n"
                 "    program              Entry point assembly\n"
                 "    assembly             Specifies an assembly\n"
+                "    wrapper              All wrappers bridging native and managed code\n"
                 "    M:Type:Method        Specifies a method\n"
                 "    N:Namespace          Specifies a namespace\n"
                 "    T:Type               Specifies a type\n"
+                "    E:Type               Specifies stack traces for an exception type\n"
                 "    EXPR                 Includes expression\n"
                 "    -EXPR                Excludes expression\n"
                 "    EXPR,EXPR            Multiple expressions\n"
@@ -1421,6 +1423,9 @@ mono_main (int argc, char* argv[])
 #ifdef HOST_WIN32
        int mixed_mode = FALSE;
 #endif
+#ifdef __native_client__
+       gboolean nacl_null_checks_off = FALSE;
+#endif
 
 #ifdef MOONLIGHT
 #ifndef HOST_WIN32
@@ -1725,6 +1730,8 @@ mono_main (int argc, char* argv[])
 #ifdef __native_client__
                } else if (strcmp (argv [i], "--nacl-mono-path") == 0){
                        nacl_mono_path = g_strdup(argv[++i]);
+               } else if (strcmp (argv [i], "--nacl-null-checks-off") == 0){
+                       nacl_null_checks_off = TRUE;
 #endif
                } else {
                        fprintf (stderr, "Unknown command line option: '%s'\n", argv [i]);
@@ -1737,6 +1744,10 @@ mono_main (int argc, char* argv[])
        {
                nacl_align_byte = -1; /* 0xff */
        }
+       if (!nacl_null_checks_off) {
+               MonoDebugOptions *opt = mini_get_debug_options ();
+               opt->explicit_null_checks = TRUE;
+       }
 #endif
 
        if (!argv [i]) {
@@ -1948,7 +1959,7 @@ mono_main (int argc, char* argv[])
         * This used to be an amd64 only crash, but it looks like now most glibc targets do unwinding
         * that requires reading the target code.
         */
-#ifdef __linux__
+#if defined( __linux__ ) || defined( __native_client__ )
                mono_dont_free_global_codeman = TRUE;
 #endif