#include "mono/metadata/verify.h"
#include "mono/metadata/profiler.h"
#include "mono/metadata/threadpool.h"
+#include "mono/metadata/mono-config.h"
#include <mono/metadata/profiler-private.h>
#include <mono/os/util.h>
-/**
- * mono_jit_image:
- * @image: reference to an image
- * @verbose: If true, print debugging information on stdout.
- *
- * JIT compilation of all methods in the image.
- */
-void
-mono_jit_compile_image (MonoImage *image, int verbose)
-{
- MonoMethod *method;
- MonoTableInfo *t = &image->tables [MONO_TABLE_METHOD];
- int i;
-
- for (i = 0; i < t->rows; i++) {
-
- method = mono_get_method (image,
- (MONO_TABLE_METHOD << 24) | (i + 1),
- NULL);
-
- if (verbose)
- g_print ("Compiling: %s:%s\n\n", image->assembly_name, method->name);
-
- if (method->flags & METHOD_ATTRIBUTE_ABSTRACT) {
- if (verbose)
- printf ("ABSTARCT\n");
- } else
- mono_compile_method (method);
-
- }
-
-}
-
static MonoClass *
find_class_in_assembly (MonoAssembly *assembly, const char *namespace, const char *name)
{
usage (char *name)
{
fprintf (stderr,
- "%s %s, the Mono ECMA CLI JIT Compiler, (C) 2001, 2002 Ximian, Inc.\n\n"
- "Usage is: %s [options] executable args...\n\n", name, VERSION, name);
+ "mono %s, the Mono ECMA CLI JIT Compiler, (C) 2001, 2002 Ximian, Inc.\n\n"
+ "Usage is: %s [options] executable args...\n\n", VERSION, name);
fprintf (stderr,
"Runtime Debugging:\n"
" -d debug the jit, show disassembler output.\n"
" --debug-args ARGS comma-separated list of additional arguments for the\n"
" symbol writer. See the manpage for details.\n"
" --profile record and dump profile info\n"
+ " --breakonex set a breakpoint for unhandled exception\n"
" --break NAME insert a breakpoint at the start of method NAME\n"
" (NAME is in `namespace.name:methodname' format)\n"
" --precompile name precompile NAME before executing the main application:\n"
" @imagename compile the given image\n"
"\n"
"Runtime:\n"
+ " --config filename Load specified config file instead of the default.\n"
" --fast-iconv Use fast floating point integer conversion\n"
" --noinline Disable code inliner\n"
+ " --nointrinsic Disable memcopy inliner\n"
" --nols disable linear scan register allocation\n"
" --share-code force jit to produce shared code\n"
" --workers n maximum number of worker threads\n"
int compile_times = 1000;
char *compile_class = NULL;
char *debug_args = NULL;
- char *file, *error;
+ char *file, *error, *config_file = NULL;
gboolean testjit = FALSE;
int verbose = FALSE;
GList *precompile_classes = NULL;
mono_jit_share_code = TRUE;
else if (strcmp (argv [i], "--noinline") == 0)
mono_jit_inline_code = FALSE;
+ else if (strcmp (argv [i], "--nointrinsic") == 0)
+ mono_inline_memcpy = FALSE;
else if (strcmp (argv [i], "--nols") == 0)
mono_use_linear_scan = FALSE;
+ else if (strcmp (argv [i], "--breakonex") == 0)
+ mono_break_on_exc = TRUE;
else if (strcmp (argv [i], "--print-vtable") == 0)
mono_print_vtable = TRUE;
else if (strcmp (argv [i], "--break") == 0) {
mono_debug_methods = g_list_append (mono_debug_methods, desc);
} else if (strcmp (argv [i], "--count") == 0) {
compile_times = atoi (argv [++i]);
+ } else if (strcmp (argv [i], "--config") == 0) {
+ config_file = argv [++i];
} else if (strcmp (argv [i], "--workers") == 0) {
mono_worker_threads = atoi (argv [++i]);
if (mono_worker_threads < 1)
if (!file)
usage (argv [0]);
+ mono_config_parse (config_file);
mono_set_rootdir (argv [0]);
domain = mono_jit_init (file);
mono_jit_compile_class (assembly, tmp->data, 1, verbose);
retval = mono_jit_exec (domain, assembly, argc - i, argv + i);
- printf ("RESULT: %d\n", retval);
}
mono_profiler_shutdown ();