AC_DEFINE(HAVE_DEPRECATED, 1, [Support for the deprecated attribute])
fi
+AC_ARG_WITH(interpreter, [ --with-interpreter=yes|no Interpreter, default=no],[buildinterpreter=$with_interpreter],[buildinterpreter=no])
+if test "x$buildinterpreter" = "xyes"; then
+ AC_DEFINE(ENABLE_INTERPRETER, 1, [Enable interpreter in the runtime.])
+ AC_MSG_NOTICE([Enable interpreter in the runtime.])
+fi
+
+AM_CONDITIONAL([ENABLE_INTERPRETER], [test x$buildinterpreter != xno])
+
+
dnl
dnl Simple Generational checks (sgen)
dnl
BigArrays: $enable_big_arrays
DTrace: $enable_dtrace
LLVM Back End: $enable_llvm (dynamically loaded: $enable_loadedllvm)
+ Interpreter: $buildinterpreter
Libraries:
.NET 4.x: $with_profile4_x
MINI_RUNTIME = MONO_PATH=$(CLASS) $(RUNTIME_EXECUTABLE)
TOOLS_RUNTIME = MONO_PATH=$(mcs_topdir)/class/lib/build $(top_builddir)/runtime/mono-wrapper
+INTERPRETER_RUNTIME = $(MINI_RUNTIME) --interpreter
RUNTIME_AOTCHECK = MONO_PATH="$(CLASS)$(PLATFORM_PATH_SEPARATOR)." $(RUNTIME_EXECUTABLE)
MCS = CSC_SDK_PATH_DISABLED= $(TOOLS_RUNTIME) $(CSC) -unsafe -nowarn:0162 -nologo -noconfig -r:$(CLASS)/mscorlib.dll -r:$(CLASS)/System.dll -r:$(CLASS)/System.Core.dll
endif
endif
+if ENABLE_INTERPRETER
+interpreter_sources = \
+ interpreter/hacks.h \
+ interpreter/interp.h \
+ interpreter/interp.c \
+ interpreter/mintops.h \
+ interpreter/mintops.def \
+ interpreter/mintops.c \
+ interpreter/transform.c
+endif
+
if ENABLE_LLVM
llvm_runtime_sources = \
llvm-runtime.cpp
monobin_platform_ldflags=-framework CoreFoundation -framework Foundation
endif
-libmini_la_SOURCES = $(common_sources) $(llvm_sources) $(llvm_runtime_sources) $(arch_sources) $(os_sources)
+libmini_la_SOURCES = $(common_sources) $(llvm_sources) $(llvm_runtime_sources) $(interpreter_sources) $(arch_sources) $(os_sources)
libmini_la_CFLAGS = $(mono_CFLAGS)
libmonoboehm_2_0_la_SOURCES =
rcheck: mono $(regtests)
$(MINI_RUNTIME) --regression $(regtests)
+richeck: mono basic.exe
+ $(INTERPRETER_RUNTIME) --regression basic.exe
+
if ARM
check-seq-points:
else
#include "mini.h"
#include "jit.h"
#include "aot-compiler.h"
+#include "interpreter/interp.h"
#include <string.h>
#include <ctype.h>
#endif
} else if (strcmp (argv [i], "--nollvm") == 0){
mono_use_llvm = FALSE;
+#ifdef ENABLE_INTERPRETER
+ } else if (strcmp (argv [i], "--interpreter") == 0) {
+ mono_use_interpreter = TRUE;
+#endif
+
#ifdef __native_client__
} else if (strcmp (argv [i], "--nacl-mono-path") == 0){
nacl_mono_path = g_strdup(argv[++i]);
}
mono_set_defaults (mini_verbose, opt);
+#if ENABLE_INTERPRETER
+ if (mono_use_interpreter)
+ domain = mono_interp_init (argv [i]);
+ else
+#endif
domain = mini_init (argv [i], forced_version);
mono_gc_set_stack_end (&domain);
case DO_SINGLE_METHOD_REGRESSION:
mono_do_single_method_regression = TRUE;
case DO_REGRESSION:
+#ifdef ENABLE_INTERPRETER
+ if (mono_use_interpreter) {
+ if (interp_regression_list (2, argc -i, argv + i)) {
+ g_print ("Regression ERRORS!\n");
+ // mini_cleanup (domain);
+ return 1;
+ }
+ // mini_cleanup (domain);
+ return 0;
+ }
+#endif
if (mini_regression_list (mini_verbose, argc -i, argv + i)) {
g_print ("Regression ERRORS!\n");
mini_cleanup (domain);
aname = argv [i];
break;
default:
+#ifdef ENABLE_INTERPRETER
+ if (mono_use_interpreter)
+ g_error ("not yet");
+#endif
if (argc - i < 1) {
mini_usage ();
mini_cleanup (domain);
static gint *abort_requested;
/* If true, then we output the opcodes as we interpret them */
-static int global_tracing = 0;
+static int global_tracing = 1;
static int global_no_pointers = 0;
int mono_interp_traceopt = 0;
MINT_IN_CASE(MINT_MONO_FREE)
++ip;
--sp;
+ g_error ("that doesn't seem right");
g_free (sp->data.p);
MINT_IN_BREAK;
MINT_IN_CASE(MINT_MONO_RETOBJ)
MonoRuntimeExceptionHandlingCallbacks ecallbacks;
MonoError error;
- g_set_prgname (file);
-
g_log_set_always_fatal (G_LOG_LEVEL_ERROR);
g_log_set_fatal_mask (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR);
mono_error_cleanup (&error); /* FIXME: don't swallow the error */
mono_thread_attach (domain);
- fprintf (stderr, "INTERPRETER: INIT DONE\n");
return domain;
}
} else {
result = *(gint32 *) mono_object_unbox (result_obj);
expected = atoi (method->name + 5); // FIXME: oh no.
+ run++;
if (result != expected) {
failed++;
return total;
}
-static int
+int
interp_regression_list (int verbose, int count, char *images [])
{
int i, total, total_run, run;
return total;
}
-enum {
- DO_EXEC,
- DO_REGRESSION
-};
-
-int
-mono_main (int argc, char *argv [])
-{
- MonoDomain *domain;
- int retval = 0, i;
- char *file, *config_file = NULL;
- int enable_debugging = FALSE;
- MainThreadArgs main_args;
- const char *error;
- int action = DO_EXEC;
-
- setlocale (LC_ALL, "");
- if (argc < 2)
- usage ();
-
- for (i = 1; i < argc && argv [i][0] == '-'; i++){
- if (strcmp (argv [i], "--trace") == 0)
- global_tracing = 1;
- if (strcmp (argv [i], "--noptr") == 0)
- global_no_pointers = 1;
- if (strcmp (argv [i], "--regression") == 0)
- action = DO_REGRESSION;
- if (strcmp (argv [i], "--traceops") == 0)
- global_tracing = 2;
- if (strcmp (argv [i], "--traceopt") == 0)
- ++mono_interp_traceopt;
- if (strcmp (argv [i], "--dieonex") == 0) {
- die_on_exception = 1;
- enable_debugging = 1;
- }
- if (strcmp (argv [i], "--print-vtable") == 0)
- mono_print_vtable = TRUE;
- if (strcmp (argv [i], "--profile") == 0)
- mono_profiler_load (NULL);
- if (strcmp (argv [i], "--config") == 0)
- config_file = argv [++i];
- if (strcmp (argv [i], "--help") == 0)
- usage ();
-#if DEBUG_INTERP
- if (strcmp (argv [i], "--debug") == 0) {
- MonoMethodDesc *desc = mono_method_desc_new (argv [++i], FALSE);
- if (!desc)
- g_error ("Invalid method name '%s'", argv [i]);
- db_methods = g_list_append (db_methods, desc);
- }
- if (strcmp (argv [i], "--nested") == 0)
- nested_trace = 1;
-#endif
- }
-
- file = argv [i];
-
- if (!file)
- usage ();
-
- mono_set_rootdir ();
- domain = mono_interp_init (file);
- mono_config_parse (config_file);
-
- error = mono_check_corlib_version ();
- if (error) {
- fprintf (stderr, "Corlib not in sync with this runtime: %s\n", error);
- fprintf (stderr, "Download a newer corlib at http://www.go-mono.com/daily.\n");
- exit (1);
- }
-
- main_args.domain=domain;
- main_args.file=file;
- main_args.argc=argc-i;
- main_args.argv=argv+i;
- main_args.enable_debugging=enable_debugging;
-
- switch (action) {
- case DO_REGRESSION:
- if (interp_regression_list (2, argc -i, argv + i)) {
- g_print ("Regression ERRORS!\n");
- // mini_cleanup (domain);
- return 1;
- }
- // mini_cleanup (domain);
- return 0;
- }
-
- mono_runtime_exec_managed_code (domain, main_thread_handler, &main_args);
-
- quit_function (domain, NULL);
-
- /* Get the return value from System.Environment.ExitCode */
- retval=mono_environment_exitcode_get ();
-
-#if COUNT_OPS
- for (i = 0; i < 512; i++)
- if (opcode_counts[i] != 0)
- printf("%s %d\n", mono_interp_opname[i], opcode_counts[i]);
-#endif
- return retval;
-}