2 * driver.c: The new mono JIT compiler.
5 * Paolo Molaro (lupus@ximian.com)
6 * Dietmar Maurer (dietmar@ximian.com)
8 * (C) 2002-2003 Ximian, Inc.
9 * (C) 2003-2004 Novell, Inc.
16 #include <mono/metadata/assembly.h>
17 #include <mono/metadata/loader.h>
18 #include <mono/metadata/cil-coff.h>
19 #include <mono/metadata/tabledefs.h>
20 #include <mono/metadata/class.h>
21 #include <mono/metadata/object.h>
22 #include <mono/metadata/exception.h>
23 #include <mono/metadata/opcodes.h>
24 #include <mono/metadata/mono-endian.h>
25 #include <mono/metadata/tokentype.h>
26 #include <mono/metadata/tabledefs.h>
27 #include <mono/metadata/threads.h>
28 #include <mono/metadata/marshal.h>
29 #include <mono/metadata/socket-io.h>
30 #include <mono/metadata/appdomain.h>
31 #include <mono/metadata/debug-helpers.h>
32 #include <mono/io-layer/io-layer.h>
33 #include "mono/metadata/profiler.h"
34 #include <mono/metadata/profiler-private.h>
35 #include <mono/metadata/mono-config.h>
36 #include <mono/metadata/environment.h>
37 #include <mono/metadata/verify.h>
38 #include <mono/metadata/mono-debug.h>
39 #include <mono/metadata/mono-debug-debugger.h>
48 static FILE *mini_stats_fd = NULL;
50 static void mini_usage (void);
52 typedef void (*OptFunc) (const char *p);
54 /* keep in sync with enum in mini.h */
63 {"peephole", "Peephole postpass"},
64 {"branch", "Branch optimizations"},
65 {"inline", "Inline method calls"},
66 {"cfold", "Constant folding"},
67 {"consprop", "Constant propagation"},
68 {"copyprop", "Copy propagation"},
69 {"deadce", "Dead code elimination"},
70 {"linears", "Linear scan global reg allocation"},
71 {"cmov", "Conditional moves"},
72 {"shared", "Emit per-domain code"},
73 {"sched", "Instruction scheduling"},
74 {"intrins", "Intrinsic method implementations"},
75 {"tailc", "Tail recursion and tail calls"},
76 {"loop", "Loop related optimizations"},
77 {"fcmov", "Fast x86 FP compares"},
78 {"leaf", "Leaf procedures optimizations"},
79 {"aot", "Usage of Ahead Of Time compiled code"},
80 {"precomp", "Precompile all methods before executing Main"},
81 {"abcrem", "Array bound checks removal"}
84 #define DEFAULT_OPTIMIZATIONS ( \
95 parse_optimizations (const char* p)
97 /* the default value */
98 guint32 opt = DEFAULT_OPTIMIZATIONS;
103 /* call out to cpu detection code here that sets the defaults ... */
104 opt |= mono_arch_cpu_optimizazions (&exclude);
116 for (i = 0; i < G_N_ELEMENTS (opt_names); ++i) {
117 n = opt_names [i].name;
119 if (strncmp (p, n, len) == 0) {
128 } else if (*p == '=') {
130 if (opt_names [i].func)
131 opt_names [i].func (p);
132 while (*p && *p++ != ',');
139 if (i == G_N_ELEMENTS (opt_names)) {
140 if (strncmp (p, "all", 3) == 0) {
144 opt = ~(MONO_OPT_SHARED | MONO_OPT_PRECOMP | exclude);
149 fprintf (stderr, "Invalid optimization name `%s'\n", p);
160 MonoGraphOptions value;
163 static const GraphName
165 {"cfg", "Control Flow Graph (CFG)" , MONO_GRAPH_CFG},
166 {"dtree", "Dominator Tree", MONO_GRAPH_DTREE},
167 {"code", "CFG showing code", MONO_GRAPH_CFG_CODE},
168 {"ssa", "CFG showing code after SSA translation", MONO_GRAPH_CFG_SSA},
169 {"optcode", "CFG showing code after IR optimizations", MONO_GRAPH_CFG_OPTCODE}
172 static MonoGraphOptions
173 mono_parse_graph_options (const char* p)
178 for (i = 0; i < G_N_ELEMENTS (graph_names); ++i) {
179 n = graph_names [i].name;
181 if (strncmp (p, n, len) == 0)
182 return graph_names [i].value;
185 fprintf (stderr, "Invalid graph name provided: %s\n", p);
190 mono_parse_default_optimizations (const char* p)
194 opt = parse_optimizations (p);
199 opt_descr (guint32 flags) {
200 GString *str = g_string_new ("");
204 for (i = 0; i < G_N_ELEMENTS (opt_names); ++i) {
205 if (flags & (1 << i)) {
207 g_string_append_c (str, ',');
208 g_string_append (str, opt_names [i].name);
212 return g_string_free (str, FALSE);
222 MONO_OPT_BRANCH | MONO_OPT_PEEPHOLE | MONO_OPT_INTRINS,
223 MONO_OPT_BRANCH | MONO_OPT_PEEPHOLE | MONO_OPT_LINEARS,
224 MONO_OPT_BRANCH | MONO_OPT_PEEPHOLE | MONO_OPT_LINEARS | MONO_OPT_COPYPROP,
225 MONO_OPT_BRANCH | MONO_OPT_PEEPHOLE | MONO_OPT_LINEARS | MONO_OPT_CFOLD,
226 MONO_OPT_BRANCH | MONO_OPT_PEEPHOLE | MONO_OPT_LINEARS | MONO_OPT_COPYPROP | MONO_OPT_CONSPROP | MONO_OPT_DEADCE,
227 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,
228 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
231 typedef int (*TestMethod) (void);
235 domain_dump_native_code (MonoDomain *domain) {
236 // need to poke into the domain, move to metadata/domain.c
237 // need to empty jit_info_table and code_mp
242 mini_regression (MonoImage *image, int verbose, int *total_run) {
243 guint32 i, opt, opt_flags;
247 int result, expected, failed, cfailed, run, code_size, total;
249 GTimer *timer = g_timer_new ();
252 fprintf (mini_stats_fd, "$stattitle = \'Mono Benchmark Results (various optimizations)\';\n");
254 fprintf (mini_stats_fd, "$graph->set_legend(qw(");
255 for (opt = 0; opt < G_N_ELEMENTS (opt_sets); opt++) {
256 opt_flags = opt_sets [opt];
257 n = opt_descr (opt_flags);
261 fprintf (mini_stats_fd, " ");
262 fprintf (mini_stats_fd, "%s", n);
266 fprintf (mini_stats_fd, "));\n");
268 fprintf (mini_stats_fd, "@data = (\n");
269 fprintf (mini_stats_fd, "[");
272 /* load the metadata */
273 for (i = 0; i < image->tables [MONO_TABLE_METHOD].rows; ++i) {
274 method = mono_get_method (image, MONO_TOKEN_METHOD_DEF | (i + 1), NULL);
275 mono_class_init (method->klass);
277 if (!strncmp (method->name, "test_", 5) && mini_stats_fd) {
278 fprintf (mini_stats_fd, "\"%s\",", method->name);
282 fprintf (mini_stats_fd, "],\n");
287 for (opt = 0; opt < G_N_ELEMENTS (opt_sets); ++opt) {
288 double elapsed, comp_time, start_time;
291 opt_flags = opt_sets [opt];
292 mono_set_defaults (verbose, opt_flags);
293 n = opt_descr (opt_flags);
294 g_print ("Test run: image=%s, opts=%s\n", image->name, n);
296 cfailed = failed = run = code_size = 0;
297 comp_time = elapsed = 0.0;
299 /* fixme: ugly hack - delete all previously compiled methods */
300 for (i = 0; i < image->tables [MONO_TABLE_METHOD].rows; ++i) {
301 method = mono_get_method (image, MONO_TOKEN_METHOD_DEF | (i + 1), NULL);
305 g_timer_start (timer);
307 fprintf (mini_stats_fd, "[");
308 for (i = 0; i < image->tables [MONO_TABLE_METHOD].rows; ++i) {
309 method = mono_get_method (image, MONO_TOKEN_METHOD_DEF | (i + 1), NULL);
310 if (strncmp (method->name, "test_", 5) == 0) {
311 expected = atoi (method->name + 5);
313 start_time = g_timer_elapsed (timer, NULL);
314 comp_time -= start_time;
315 cfg = mini_method_compile (method, opt_flags, mono_root_domain, TRUE, 0);
316 comp_time += g_timer_elapsed (timer, NULL);
319 g_print ("Running '%s' ...\n", method->name);
320 #ifdef MONO_USE_AOT_COMPILER
321 if ((jinfo = mono_aot_get_method (mono_root_domain, method)))
322 func = jinfo->code_start;
325 func = (TestMethod)cfg->native_code;
327 if (result != expected) {
330 g_print ("Test '%s' failed result (got %d, expected %d).\n", method->name, result, expected);
332 code_size += cfg->code_len;
333 mono_destroy_compile (cfg);
338 g_print ("Test '%s' failed compilation.\n", method->name);
341 fprintf (mini_stats_fd, "%f, ",
342 g_timer_elapsed (timer, NULL) - start_time);
346 fprintf (mini_stats_fd, "],\n");
347 g_timer_stop (timer);
348 elapsed = g_timer_elapsed (timer, NULL);
349 g_print ("Results: total tests: %d, failed: %d, cfailed: %d (pass: %.2f%%)\n",
350 run, failed, cfailed, 100.0*(run-failed-cfailed)/run);
351 g_print ("Elapsed time: %f secs (%f, %f), Code size: %d\n\n", elapsed,
352 elapsed - comp_time, comp_time, code_size);
353 total += failed + cfailed;
358 fprintf (mini_stats_fd, ");\n");
359 fflush (mini_stats_fd);
362 g_timer_destroy (timer);
367 mini_regression_list (int verbose, int count, char *images [])
369 int i, total, total_run, run;
372 total_run = total = 0;
373 for (i = 0; i < count; ++i) {
374 ass = mono_assembly_open (images [i], NULL);
376 g_warning ("failed to load assembly: %s", images [i]);
379 total += mini_regression (ass->image, verbose, &run);
381 mono_assembly_close (ass);
383 g_print ("Overall results: tests: %d, failed: %d, opt combinations: %d (pass: %.2f%%)\n",
384 total_run, total, G_N_ELEMENTS (opt_sets), 100.0*(total_run-total)/total_run);
396 typedef struct CompileAllThreadArgs {
399 } CompileAllThreadArgs;
402 compile_all_methods_thread_main (CompileAllThreadArgs *args)
404 MonoAssembly *ass = args->ass;
405 int verbose = args->verbose;
406 MonoImage *image = ass->image;
410 for (i = 0; i < image->tables [MONO_TABLE_METHOD].rows; ++i) {
411 method = mono_get_method (image, MONO_TOKEN_METHOD_DEF | (i + 1), NULL);
412 if (method->flags & METHOD_ATTRIBUTE_ABSTRACT)
414 if (method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL)
419 char * desc = mono_method_full_name (method, TRUE);
420 g_print ("Compiling %d %s\n", count, desc);
423 mono_compile_method (method);
429 compile_all_methods (MonoAssembly *ass, int verbose)
431 CompileAllThreadArgs args;
434 args.verbose = verbose;
437 * Need to create a mono thread since compilation might trigger
438 * running of managed code.
440 mono_thread_create (mono_domain_get (), compile_all_methods_thread_main, &args);
442 mono_thread_manage ();
447 * @assembly: reference to an assembly
448 * @argc: argument count
449 * @argv: argument vector
451 * Start execution of a program.
454 mono_jit_exec (MonoDomain *domain, MonoAssembly *assembly, int argc, char *argv[])
456 MonoImage *image = assembly->image;
458 guint32 entry = mono_image_get_entry_point (image);
461 g_print ("Assembly '%s' doesn't have an entry point.\n", image->name);
462 /* FIXME: remove this silly requirement. */
463 mono_environment_exitcode_set (1);
467 method = mono_get_method (image, entry, NULL);
469 return mono_runtime_run_main (method, argc, argv, NULL);
481 static void main_thread_handler (gpointer user_data)
483 MainThreadArgs *main_args = user_data;
484 MonoAssembly *assembly;
486 assembly = mono_domain_assembly_open (main_args->domain, main_args->file);
488 fprintf (stderr, "Can not open image %s\n", main_args->file);
492 if (mono_compile_aot) {
493 int res = mono_compile_assembly (assembly, main_args->opts);
494 printf ("AOT RESULT %d\n", res);
497 * This must be done in a thread managed by mono since it can invoke
500 if (main_args->opts & MONO_OPT_PRECOMP)
501 mono_precompile_assemblies ();
503 mono_jit_exec (main_args->domain, assembly, main_args->argc, main_args->argv);
513 "Usage is: mono [options] assembly\n\n"
514 "Runtime and JIT debugging:\n"
515 " --compile METHOD Just compile METHOD in assembly\n"
516 " --ncompile N Number of times to compile METHOD (default: 1)\n"
517 " --regression Runs the regression test contained in the assembly\n"
518 " --print-vtable Print the vtable of all used classes\n"
519 " --trace[=EXPR] Enable tracing, use --help-trace for details\n"
520 " --compile-all Compiles all the methods in the assembly\n"
521 " --breakonex Inserts a breakpoint on exceptions\n"
522 " --break METHOD Inserts a breakpoint at METHOD entry\n"
523 " --debug Enable debugging support\n"
524 " --stats Print statistics about the JIT operations\n"
527 " --statfile FILE Sets the stat file to FILE\n"
528 " --aot Compiles the assembly to native code\n"
529 " --profile[=profiler] Runs in profiling mode with the specified profiler module\n"
530 " --graph[=TYPE] METHOD Draws a graph of the specified method:\n");
532 for (i = 0; i < G_N_ELEMENTS (graph_names); ++i) {
533 fprintf (stdout, " %-10s %s\n", graph_names [i].name, graph_names [i].desc);
539 " --config FILE Loads FILE as the Mono config\n"
540 " --verbose, -v Increases the verbosity level\n"
541 " --help, -h Show usage information\n"
542 " --version, -V Show version information\n"
543 " --optimize=OPT Turns on a specific optimization:\n");
545 for (i = 0; i < G_N_ELEMENTS (opt_names); ++i)
546 fprintf (stdout, " %-10s %s\n", opt_names [i].name, opt_names [i].desc);
550 mini_trace_usage (void)
554 " --trace[=EXPR] Trace every call, optional EXPR controls the scope\n"
556 "EXPR is composed of:\n"
557 " all All assemblies\n"
558 " none No assemblies\n"
559 " program Entry point assembly\n"
560 " assembly Specifies an assembly\n"
561 " M:Type:Method Specifies a method\n"
562 " N:Namespace Specifies a namespace\n"
563 " T:Type Specifies a type\n"
564 " +EXPR Includes expression\n"
565 " -EXPR Excludes expression\n");
568 static const char *info = ""
569 #ifdef HAVE_KW_THREAD
573 #endif /* HAVE_KW_THREAD */
575 #ifdef USE_INCLUDED_LIBGC
576 "\tGC: Included Boehm (with typed GC)\n"
578 #if HAVE_GC_GCJ_MALLOC
579 "\tGC: System Boehm (with typed GC)\n"
581 "\tGC: System Boehm (no typed GC available)\n"
586 #endif /* HAVE_BOEHM_GC */
587 #ifdef MONO_ARCH_SIGSEGV_ON_ALTSTACK
588 "\tSIGSEGV : altstack\n"
590 "\tSIGSEGV : normal\n"
593 "\tGlobalization: ICU\n"
595 "\tGlobalization: none\n"
596 #endif /* HAVE_ICU */
600 mono_main (int argc, char* argv[])
602 MainThreadArgs main_args;
603 MonoAssembly *assembly;
604 MonoMethodDesc *desc;
608 const char* aname, *mname = NULL;
609 char *config_file = NULL;
611 int enable_debugging = FALSE;
612 guint32 opt, action = DO_EXEC;
613 MonoGraphOptions mono_graph_options = 0;
614 int mini_verbose = 0;
615 char *trace_options = NULL;
617 setlocale (LC_ALL, "");
618 g_log_set_always_fatal (G_LOG_LEVEL_ERROR);
619 g_log_set_fatal_mask (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR);
621 opt = parse_optimizations (NULL);
623 for (i = 1; i < argc; ++i) {
624 if (argv [i] [0] != '-')
626 if (strcmp (argv [i], "--regression") == 0) {
627 action = DO_REGRESSION;
628 } else if (strcmp (argv [i], "--verbose") == 0 || strcmp (argv [i], "-v") == 0) {
630 } else if (strcmp (argv [i], "--version") == 0 || strcmp (argv [i], "-V") == 0) {
631 g_print ("Mono JIT compiler version %s, (C) 2002-2004 Novell, Inc and Contributors. www.go-mono.com\n", VERSION);
634 const guchar *cerror;
635 const guchar *clibpath;
637 cerror = mono_check_corlib_version ();
638 clibpath = mono_defaults.corlib? mono_defaults.corlib->name: "unknown";
640 g_print ("The currently installed mscorlib doesn't match this runtime version.\n");
641 g_print ("The error is: %s\n", cerror);
642 g_print ("mscorlib.dll loaded at: %s\n", clibpath);
647 } else if (strcmp (argv [i], "--help") == 0 || strcmp (argv [i], "-h") == 0) {
650 } else if (strcmp (argv [i], "--help-trace") == 0){
653 } else if (strncmp (argv [i], "--statfile", 10) == 0) {
654 mini_stats_fd = fopen (argv [++i], "w+");
655 } else if (strncmp (argv [i], "--optimize=", 11) == 0) {
656 opt = parse_optimizations (argv [i] + 11);
657 } else if (strncmp (argv [i], "-O=", 3) == 0) {
658 opt = parse_optimizations (argv [i] + 3);
659 } else if (strcmp (argv [i], "--config") == 0) {
660 config_file = argv [++i];
661 } else if (strcmp (argv [i], "--ncompile") == 0) {
662 count = atoi (argv [++i]);
664 } else if (strcmp (argv [i], "--trace") == 0) {
666 } else if (strncmp (argv [i], "--trace=", 8) == 0) {
667 trace_options = &argv [i][8];
668 } else if (strcmp (argv [i], "--breakonex") == 0) {
669 mono_break_on_exc = TRUE;
670 } else if (strcmp (argv [i], "--break") == 0) {
671 if (!mono_debugger_insert_breakpoint (argv [++i], FALSE))
672 g_error ("Invalid method name '%s'", argv [i]);
673 } else if (strcmp (argv [i], "--print-vtable") == 0) {
674 mono_print_vtable = TRUE;
675 } else if (strcmp (argv [i], "--stats") == 0) {
676 mono_jit_stats.enabled = TRUE;
677 } else if (strcmp (argv [i], "--aot") == 0) {
678 mono_compile_aot = TRUE;
679 } else if (strcmp (argv [i], "--compile-all") == 0) {
681 } else if (strcmp (argv [i], "--profile") == 0) {
682 mono_profiler_load (NULL);
683 } else if (strncmp (argv [i], "--profile=", 10) == 0) {
684 mono_profiler_load (argv [i] + 10);
685 } else if (strcmp (argv [i], "--compile") == 0) {
688 } else if (strncmp (argv [i], "--graph=", 8) == 0) {
689 mono_graph_options = mono_parse_graph_options (argv [i] + 8);
692 } else if (strcmp (argv [i], "--graph") == 0) {
694 mono_graph_options = MONO_GRAPH_CFG;
696 } else if (strcmp (argv [i], "--debug") == 0) {
697 enable_debugging = TRUE;
699 fprintf (stderr, "Unknown command line option: '%s'\n", argv [i]);
709 if (mono_compile_aot || action == DO_EXEC) {
710 g_set_prgname (argv[i]);
713 mono_set_defaults (mini_verbose, opt);
714 domain = mini_init (argv [i]);
718 if (mini_regression_list (mini_verbose, argc -i, argv + i)) {
719 g_print ("Regression ERRORS!\n");
720 mini_cleanup (domain);
723 mini_cleanup (domain);
726 if (argc - i != 1 || mname == NULL) {
727 g_print ("Usage: mini --ncompile num --compile method assembly\n");
728 mini_cleanup (domain);
736 mini_cleanup (domain);
742 if (argc - i != 1 || mname == NULL) {
744 mini_cleanup (domain);
752 mini_cleanup (domain);
759 if (enable_debugging)
760 mono_debug_init (domain, MONO_DEBUG_FORMAT_MONO);
762 /* Parse gac loading options before loading assemblies. */
763 if (mono_compile_aot || action == DO_EXEC) {
764 mono_config_parse (config_file);
767 assembly = mono_assembly_open (aname, NULL);
769 fprintf (stderr, "cannot open assembly %s\n", aname);
770 mini_cleanup (domain);
774 if (trace_options != NULL){
775 mono_jit_trace_calls = mono_trace_parse_options (assembly, trace_options);
776 if (mono_jit_trace_calls == NULL)
780 if (enable_debugging)
781 mono_debug_init_2 (assembly);
783 if (mono_compile_aot || action == DO_EXEC) {
786 //mono_set_rootdir ();
788 error = mono_check_corlib_version ();
790 fprintf (stderr, "Corlib not in sync with this runtime: %s\n", error);
791 fprintf (stderr, "Download a newer corlib or a newer runtime at http://www.go-mono.com/daily.\n");
795 main_args.domain = domain;
796 main_args.file = aname;
797 main_args.argc = argc - i;
798 main_args.argv = argv + i;
799 main_args.opts = opt;
801 mono_runtime_exec_managed_code (domain, main_thread_handler, &main_args);
802 mini_cleanup (domain);
804 /* Look up return value from System.Environment.ExitCode */
805 i = mono_environment_exitcode_get ();
807 } else if (action == DO_COMPILE) {
808 compile_all_methods (assembly, mini_verbose);
809 mini_cleanup (domain);
812 desc = mono_method_desc_new (mname, 0);
814 g_print ("Invalid method name %s\n", mname);
815 mini_cleanup (domain);
818 method = mono_method_desc_search_in_image (desc, assembly->image);
820 g_print ("Cannot find method %s\n", mname);
821 mini_cleanup (domain);
825 if (action == DO_DRAW) {
828 switch (mono_graph_options) {
829 case MONO_GRAPH_DTREE:
831 opt |= MONO_OPT_LOOP;
833 case MONO_GRAPH_CFG_CODE:
836 case MONO_GRAPH_CFG_SSA:
839 case MONO_GRAPH_CFG_OPTCODE:
846 cfg = mini_method_compile (method, opt, mono_root_domain, FALSE, part);
847 if ((mono_graph_options & MONO_GRAPH_CFG_SSA) && !(cfg->comp_done & MONO_COMP_SSA)) {
848 g_warning ("no SSA info available (use -O=deadce)");
851 mono_draw_graph (cfg, mono_graph_options);
852 mono_destroy_compile (cfg);
854 } else if (action == DO_BENCH) {
857 double no_opt_time = 0.0;
858 GTimer *timer = g_timer_new ();
859 fprintf (mini_stats_fd, "$stattitle = \'Compilations times for %s\';\n",
860 mono_method_full_name (method, TRUE));
861 fprintf (mini_stats_fd, "@data = (\n");
862 fprintf (mini_stats_fd, "[");
863 for (i = 0; i < G_N_ELEMENTS (opt_sets); i++) {
868 fprintf (mini_stats_fd, "\"%s\",", n);
870 fprintf (mini_stats_fd, "],\n[");
872 for (i = 0; i < G_N_ELEMENTS (opt_sets); i++) {
876 g_timer_start (timer);
877 for (j = 0; j < count; ++j) {
878 cfg = mini_method_compile (method, opt, mono_root_domain, FALSE, 0);
879 mono_destroy_compile (cfg);
881 g_timer_stop (timer);
882 elapsed = g_timer_elapsed (timer, NULL);
884 no_opt_time = elapsed;
885 fprintf (mini_stats_fd, "%f, ", elapsed);
887 fprintf (mini_stats_fd, "]");
888 if (no_opt_time > 0.0) {
889 fprintf (mini_stats_fd, ", \n[");
890 for (i = 0; i < G_N_ELEMENTS (opt_sets); i++)
891 fprintf (mini_stats_fd, "%f,", no_opt_time);
892 fprintf (mini_stats_fd, "]");
894 fprintf (mini_stats_fd, ");\n");
896 for (i = 0; i < count; ++i) {
897 if ((method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) ||
898 (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL))
899 method = mono_marshal_get_native_wrapper (method);
901 cfg = mini_method_compile (method, opt, mono_root_domain, FALSE, 0);
902 mono_destroy_compile (cfg);
906 cfg = mini_method_compile (method, opt, mono_root_domain, FALSE, 0);
907 mono_destroy_compile (cfg);
910 mini_cleanup (domain);
915 mono_jit_init (const char *file)
917 return mini_init (file);
921 mono_jit_cleanup (MonoDomain *domain)
923 mini_cleanup (domain);