static
gboolean mono_aot_mode_is_full (MonoAotOptions *opts)
{
- return opts->mode == MONO_AOT_MODE_FULL;
+ return opts->mode == MONO_AOT_MODE_FULL || opts->mode == MONO_AOT_MODE_INTERP;
+}
+
+static
+gboolean mono_aot_mode_is_interp (MonoAotOptions *opts)
+{
+ return opts->mode == MONO_AOT_MODE_INTERP;
}
static
#endif /* #ifdef MONO_ARCH_HAVE_FULL_AOT_TRAMPOLINES */
+ if (mono_aot_mode_is_interp (&acfg->aot_opts)) {
+ mono_arch_get_enter_icall_trampoline (&info);
+ emit_trampoline (acfg, acfg->got_offset, info);
+ }
+
/* Emit trampolines which are numerous */
/*
opts->mode = MONO_AOT_MODE_FULL;
} else if (str_begins_with (arg, "hybrid")) {
opts->mode = MONO_AOT_MODE_HYBRID;
+ } else if (str_begins_with (arg, "interp")) {
+ opts->mode = MONO_AOT_MODE_INTERP;
} else if (str_begins_with (arg, "threads=")) {
opts->nthreads = atoi (arg + strlen ("threads="));
} else if (str_begins_with (arg, "static")) {
}
}
- {
+ if (!mono_aot_mode_is_interp (&acfg->aot_opts)) {
int method_index;
for (method_index = 0; method_index < acfg->image->tables [MONO_TABLE_METHOD].rows; ++method_index) {
if (mono_aot_mode_is_full (&acfg->aot_opts) || mono_aot_mode_is_hybrid (&acfg->aot_opts))
mono_set_partial_sharing_supported (TRUE);
- res = collect_methods (acfg);
- if (!res)
- return 1;
+ if (!mono_aot_mode_is_interp (&acfg->aot_opts)) {
+ res = collect_methods (acfg);
+
+ if (!res)
+ return 1;
+ }
{
GList *l;
}
#endif
+ if (mono_aot_mode_is_interp (&acfg->aot_opts)) {
+ MonoMethod *wrapper;
+ MonoMethodSignature *sig;
+
+ /* object object:interp_in_static (object,intptr,intptr,intptr) */
+ sig = mono_create_icall_signature ("object object ptr ptr ptr");
+ wrapper = mini_get_interp_in_wrapper (sig);
+ add_method (acfg, wrapper);
+
+ /* int object:interp_in_static (intptr,int,intptr) */
+ sig = mono_create_icall_signature ("int32 ptr int32 ptr");
+ wrapper = mini_get_interp_in_wrapper (sig);
+ add_method (acfg, wrapper);
+
+ /* void object:interp_in_static (object,intptr,intptr,intptr) */
+ sig = mono_create_icall_signature ("void object ptr ptr ptr");
+ wrapper = mini_get_interp_in_wrapper (sig);
+ add_method (acfg, wrapper);
+ }
+
TV_GETTIME (atv);
compile_methods (acfg);
ref->method = mono_marshal_get_gsharedvt_in_wrapper ();
} else if (subtype == WRAPPER_SUBTYPE_GSHAREDVT_OUT) {
ref->method = mono_marshal_get_gsharedvt_out_wrapper ();
+ } else if (subtype == WRAPPER_SUBTYPE_INTERP_IN) {
+ ref->method = mini_get_interp_in_wrapper (target->signature);
} else if (subtype == WRAPPER_SUBTYPE_GSHAREDVT_IN_SIG) {
MonoMethodSignature *sig = decode_signature (module, p, &p);
if (!sig)
}
}
if (!sofile) {
- if (mono_aot_only && assembly->image->tables [MONO_TABLE_METHOD].rows) {
+ if (mono_aot_only && !mono_use_interpreter && assembly->image->tables [MONO_TABLE_METHOD].rows) {
aot_name = g_strdup_printf ("%s%s", assembly->image->name, MONO_SOLIB_EXT);
g_error ("Failed to load AOT module '%s' in aot-only mode.\n", aot_name);
g_free (aot_name);
}
if (!usable) {
- if (mono_aot_only) {
+ if (mono_aot_only && !mono_use_interpreter) {
g_error ("Failed to load AOT module '%s' while running in aot-only mode: %s.\n", found_aot_name, msg);
} else {
mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_AOT, "AOT: module %s is unusable: %s.", found_aot_name, msg);
g_assert (!frame->runtime_method);
if (!mono_interp_enter_icall_trampoline) {
- MonoTrampInfo *info;
- mono_interp_enter_icall_trampoline = mono_arch_get_enter_icall_trampoline (&info);
- // TODO:
- // mono_tramp_info_register (info, NULL);
+ if (mono_aot_only) {
+ mono_interp_enter_icall_trampoline = mono_aot_get_trampoline ("enter_icall_trampoline");
+ } else {
+ MonoTrampInfo *info;
+ mono_interp_enter_icall_trampoline = mono_arch_get_enter_icall_trampoline (&info);
+ // TODO:
+ // mono_tramp_info_register (info, NULL);
+ }
}
InterpMethodArguments *margs = build_args_from_sig (sig, frame);
* rgctx register using a trampoline.
*/
- // FIXME: AOT
- g_assert (!mono_aot_only);
- addr = mono_arch_get_static_rgctx_trampoline (ftndesc, jit_wrapper);
+ if (mono_aot_only)
+ addr = mono_aot_get_static_rgctx_trampoline (ftndesc, jit_wrapper);
+ else
+ addr = mono_arch_get_static_rgctx_trampoline (ftndesc, jit_wrapper);
mono_memory_barrier ();
rmethod->jit_entry = addr;