{"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 ( \
MONO_OPT_INTRINS | \
MONO_OPT_AOT)
+
static guint32
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++;
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);
}
/* 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);
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;
}
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
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);
}
DO_REGRESSION,
DO_COMPILE,
DO_EXEC,
- DO_DRAW,
+ DO_DRAW
};
typedef struct CompileAllThreadArgs {
{
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;
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;
static const char *info = ""
#ifdef HAVE_KW_THREAD
- "\tTLS: NPTL\n"
+ "\tTLS: __thread\n"
#else
"\tTLS: normal\n"
#endif /* HAVE_KW_THREAD */
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);
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);
if (mono_compile_aot || action == DO_EXEC) {
const guchar *error;
- mono_config_parse (config_file);
//mono_set_rootdir ();
error = mono_check_corlib_version ();
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);
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;
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);
(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);
}