static const OptName
opt_names [] = {
- {"peephole", "Peephole postpass"},
- {"branch", "Branch optimizations"},
- {"inline", "Inline method calls"},
- {"cfold", "Constant folding"},
- {"consprop", "Constant propagation"},
- {"copyprop", "Copy propagation"},
- {"deadce", "Dead code elimination"},
- {"linears", "Linear scan global reg allocation"},
- {"cmov", "Conditional moves"},
- {"shared", "Emit per-domain code"},
- {"sched", "Instruction scheduling"},
- {"intrins", "Intrinsic method implementations"},
- {"tailc", "Tail recursion and tail calls"},
- {"loop", "Loop related optimizations"},
- {"fcmov", "Fast x86 FP compares"},
- {"leaf", "Leaf procedures optimizations"},
- {"aot", "Usage of Ahead Of Time compiled code"},
- {"precomp", "Precompile all methods before executing Main"},
- {"abcrem", "Array bound checks removal"},
- {"ssapre", "SSA based Partial Redundancy Elimination"}
+ {"peephole", "Peephole postpass"},
+ {"branch", "Branch optimizations"},
+ {"inline", "Inline method calls"},
+ {"cfold", "Constant folding"},
+ {"consprop", "Constant propagation"},
+ {"copyprop", "Copy propagation"},
+ {"deadce", "Dead code elimination"},
+ {"linears", "Linear scan global reg allocation"},
+ {"cmov", "Conditional moves"},
+ {"shared", "Emit per-domain code"},
+ {"sched", "Instruction scheduling"},
+ {"intrins", "Intrinsic method implementations"},
+ {"tailc", "Tail recursion and tail calls"},
+ {"loop", "Loop related optimizations"},
+ {"fcmov", "Fast x86 FP compares"},
+ {"leaf", "Leaf procedures optimizations"},
+ {"aot", "Usage of Ahead Of Time compiled code"},
+ {"precomp", "Precompile all methods before executing Main"},
+ {"abcrem", "Array bound checks removal"},
+ {"ssapre", "SSA based Partial Redundancy Elimination"},
+ {"exception", "Optimize exception catch blocks"},
+ {"ssa", "Build and use SSA form"}
};
#define DEFAULT_OPTIMIZATIONS ( \
MONO_OPT_LINEARS | \
MONO_OPT_INTRINS | \
MONO_OPT_LOOP | \
+ MONO_OPT_EXCEPTION | \
MONO_OPT_AOT)
#define EXCLUDED_FROM_ALL (MONO_OPT_SHARED | MONO_OPT_PRECOMP)
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_SSA,
+ 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_EXCEPTION,
+ 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_EXCEPTION | MONO_OPT_ABCREM,
+ 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_EXCEPTION | MONO_OPT_ABCREM | MONO_OPT_SSAPRE,
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,
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_SSAPRE,
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 | MONO_OPT_SHARED
func = jinfo->code_start;
else
#endif
- func = (TestMethod)cfg->native_code;
+ func = (TestMethod)(gpointer)cfg->native_code;
+ func = (TestMethod)mono_create_ftnptr (mono_get_root_domain (), func);
result = func ();
if (result != expected) {
failed++;
typedef struct CompileAllThreadArgs {
MonoAssembly *ass;
int verbose;
+ guint32 opts;
} CompileAllThreadArgs;
static void
g_print ("Compiling %d %s\n", count, desc);
g_free (desc);
}
- cfg = mini_method_compile (method, DEFAULT_OPTIMIZATIONS, mono_get_root_domain (), FALSE, FALSE, 0);
+ cfg = mini_method_compile (method, args->opts, mono_get_root_domain (), FALSE, FALSE, 0);
mono_destroy_compile (cfg);
}
}
static void
-compile_all_methods (MonoAssembly *ass, int verbose)
+compile_all_methods (MonoAssembly *ass, int verbose, guint32 opts)
{
CompileAllThreadArgs args;
args.ass = ass;
args.verbose = verbose;
+ args.opts = opts;
/*
* Need to create a mono thread since compilation might trigger
#else
"\tSIGSEGV : normal\n"
#endif
-#ifdef HAVE_ICU
- "\tGlobalization: ICU (unsupported, don't use)\n"
-#else
- "\tGlobalization: normal\n"
-#endif /* HAVE_ICU */
"";
int
} else if (strcmp (argv [i], "--security") == 0) {
mono_use_security_manager = TRUE;
mono_activate_security_manager ();
+ } else if (strcmp (argv [i], "--desktop") == 0) {
+ GC_dont_expand = 1;
+ /* Put desktop-specific optimizations here */
+ } else if (strcmp (argv [i], "--server") == 0){
+ /* Put server-specific optimizations here */
} else {
fprintf (stderr, "Unknown command line option: '%s'\n", argv [i]);
return 1;
exit (1);
}
+#ifdef PLATFORM_WIN32
+ /* Detach console when executing IMAGE_SUBSYSTEM_WINDOWS_GUI on win32 */
+ if (!mono_compile_aot && ((MonoCLIImageInfo*)(mono_assembly_get_image (assembly)->image_info))->cli_header.nt.pe_subsys_required == IMAGE_SUBSYSTEM_WINDOWS_GUI)
+ FreeConsole ();
+#endif
+
main_args.domain = domain;
main_args.file = aname;
main_args.argc = argc - i;
i = mono_environment_exitcode_get ();
return i;
} else if (action == DO_COMPILE) {
- compile_all_methods (assembly, mini_verbose);
+ compile_all_methods (assembly, mini_verbose, opt);
mini_cleanup (domain);
return 0;
}