Added array bounds check (ABC) removal optimization.
[mono.git] / mono / mini / driver.c
index 03ffb77b6e95f67ccba29e33d7eda89e999d61ad..bb159ba29c2853413bd80b57df970014379a8cc3 100644 (file)
@@ -77,7 +77,8 @@ opt_names [] = {
        {"fcmov",    "Fast x86 FP compares"},
        {"leaf",     "Leaf procedures optimizations"},
        {"aot",      "Usage of Ahead Of Time compiled code"},
-       {"precomp",  "Precompile all methods before executing Main"}
+       {"precomp",  "Precompile all methods before executing Main"},
+       {"abcrem",   "Array bound checks removal"}
 };
 
 #define DEFAULT_OPTIMIZATIONS (        \
@@ -222,7 +223,8 @@ opt_sets [] = {
        MONO_OPT_BRANCH | MONO_OPT_PEEPHOLE | MONO_OPT_LINEARS | MONO_OPT_COPYPROP,
        MONO_OPT_BRANCH | MONO_OPT_PEEPHOLE | MONO_OPT_LINEARS | MONO_OPT_CFOLD,
        MONO_OPT_BRANCH | MONO_OPT_PEEPHOLE | MONO_OPT_LINEARS | MONO_OPT_COPYPROP | MONO_OPT_CONSPROP | MONO_OPT_DEADCE,
-       MONO_OPT_BRANCH | MONO_OPT_PEEPHOLE | MONO_OPT_LINEARS | MONO_OPT_COPYPROP | MONO_OPT_CONSPROP | MONO_OPT_DEADCE | MONO_OPT_LOOP | MONO_OPT_INLINE | MONO_OPT_INTRINS
+       MONO_OPT_BRANCH | MONO_OPT_PEEPHOLE | MONO_OPT_LINEARS | MONO_OPT_COPYPROP | MONO_OPT_CONSPROP | MONO_OPT_DEADCE | MONO_OPT_LOOP | MONO_OPT_INLINE | MONO_OPT_INTRINS,
+       MONO_OPT_BRANCH | MONO_OPT_PEEPHOLE | MONO_OPT_LINEARS | MONO_OPT_COPYPROP | MONO_OPT_CONSPROP | MONO_OPT_DEADCE | MONO_OPT_LOOP | MONO_OPT_INLINE | MONO_OPT_INTRINS | MONO_OPT_ABCREM
 };
 
 typedef int (*TestMethod) (void);
@@ -387,7 +389,7 @@ enum {
        DO_REGRESSION,
        DO_COMPILE,
        DO_EXEC,
-       DO_DRAW,
+       DO_DRAW
 };
 
 typedef struct CompileAllThreadArgs {
@@ -756,6 +758,11 @@ mono_main (int argc, char* argv[])
        if (enable_debugging)
                mono_debug_init (domain, MONO_DEBUG_FORMAT_MONO);
 
+       /* Parse gac loading options before loading assemblies. */
+       if (mono_compile_aot || action == DO_EXEC) {
+               mono_config_parse (config_file);
+       }
+
        assembly = mono_assembly_open (aname, NULL);
        if (!assembly) {
                fprintf (stderr, "cannot open assembly %s\n", aname);
@@ -775,7 +782,6 @@ mono_main (int argc, char* argv[])
        if (mono_compile_aot || action == DO_EXEC) {
                const guchar *error;
 
-               mono_config_parse (config_file);
                //mono_set_rootdir ();
 
                error = mono_check_corlib_version ();