ves_real_abort (int line, MonoMethod *mh,
const unsigned short *ip, stackval *stack, stackval *sp)
{
- MonoMethodNormal *mm = (MonoMethodNormal *)mh;
fprintf (stderr, "Execution aborted in method: %s::%s\n", mh->klass->name, mh->name);
fprintf (stderr, "Line=%d IP=0x%04x, Aborted execution\n", line,
- ip-(const unsigned short *)mm->header->code);
+ ip-(const unsigned short *)mono_method_get_header (mh)->code);
g_print ("0x%04x %02x\n",
- ip-(const unsigned short *)mm->header->code, *ip);
+ ip-(const unsigned short *)mono_method_get_header (mh)->code, *ip);
if (sp > stack)
printf ("\t[%d] 0x%08x %0.5f\n", sp-stack, sp[-1].data.i, sp[-1].data.f);
}
} while (0);
static gpointer
-interp_create_remoting_trampoline (MonoMethod *method)
+interp_create_remoting_trampoline (MonoMethod *method, MonoRemotingTarget target)
{
- return mono_interp_get_runtime_method (mono_marshal_get_remoting_invoke (method));
+ return mono_interp_get_runtime_method (mono_marshal_get_remoting_invoke_for_target (method, target));
}
static CRITICAL_SECTION runtime_method_lookup_section;
rtm = mono_mempool_alloc (domain->mp, sizeof (RuntimeMethod));
memset (rtm, 0, sizeof (*rtm));
rtm->method = method;
- rtm->param_count = method->signature->param_count;
- rtm->hasthis = method->signature->hasthis;
+ rtm->param_count = mono_method_signature (method)->param_count;
+ rtm->hasthis = mono_method_signature (method)->hasthis;
rtm->valuetype = method->klass->valuetype;
g_hash_table_insert (domain->jit_code_hash, method, rtm);
LeaveCriticalSection (&runtime_method_lookup_section);
esize = mono_array_element_size (ac);
ea = mono_array_addr_with_size (ao, esize, pos);
- mt = frame->runtime_method->method->signature->params [ac->rank];
+ mt = mono_method_signature (frame->runtime_method->method)->params [ac->rank];
stackval_to_data (mt, &sp [ac->rank], ea, FALSE);
}
esize = mono_array_element_size (ac);
ea = mono_array_addr_with_size (ao, esize, pos);
- mt = frame->runtime_method->method->signature->ret;
+ mt = mono_method_signature (frame->runtime_method->method)->ret;
stackval_from_data (mt, frame->retval, ea, FALSE);
}
}
static void
-interp_walk_stack (MonoStackWalk func, gpointer user_data)
+interp_walk_stack (MonoStackWalk func, gboolean do_il_offset, gpointer user_data)
{
ThreadContext *context = TlsGetValue (thread_context_id);
- if (!context) return;
-
- MonoInvocation *frame = context->current_frame;
+ MonoInvocation *frame;
int il_offset;
MonoMethodHeader *hd;
+ if (!context) return;
+
+ frame = context->current_frame;
+
while (frame) {
gboolean managed = FALSE;
MonoMethod *method = frame->runtime_method->method;
(method->iflags & (METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL | METHOD_IMPL_ATTRIBUTE_RUNTIME)))
il_offset = -1;
else {
- hd = ((MonoMethodNormal*)method)->header;
+ hd = mono_method_get_header (method);
il_offset = frame->ip - (const unsigned short *)hd->code;
if (!method->wrapper_type)
managed = TRUE;
{
GString *str = g_string_new ("");
int i;
- MonoMethodSignature *signature = inv->runtime_method->method->signature;
+ MonoMethodSignature *signature = mono_method_signature (inv->runtime_method->method);
if (signature->param_count == 0)
return g_string_free (str, FALSE);
dump_retval (MonoInvocation *inv)
{
GString *str = g_string_new ("");
- MonoType *ret = inv->runtime_method->method->signature->ret;
+ MonoType *ret = mono_method_signature (inv->runtime_method->method)->ret;
if (ret->type != MONO_TYPE_VOID)
dump_stackval (str, inv->retval, ret);
if ((method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) == 0 &&
(method->iflags & METHOD_IMPL_ATTRIBUTE_RUNTIME) == 0) {
- MonoMethodHeader *hd = ((MonoMethodNormal *)method)->header;
+ MonoMethodHeader *hd = mono_method_get_header (method);
if (hd != NULL) {
if (inv->ip) {
MonoInvocation frame;
ThreadContext * volatile context = TlsGetValue (thread_context_id);
MonoObject *retval = NULL;
- MonoMethodSignature *sig = method->signature;
+ MonoMethodSignature *sig = mono_method_signature (method);
MonoClass *klass = mono_class_from_mono_type (sig->ret);
int i, type, isobject = 0;
void *ret = NULL;
context->managed_code = 0;
switch (op) {
+ case MINT_ICALL_V_V: {
+ void (*func)() = ptr;
+ func ();
+ break;
+ }
case MINT_ICALL_P_V: {
void (*func)(gpointer) = ptr;
func (sp [-1].data.p);
* If it is a static P/Invoke method, we can just return the pointer
* to the method implementation.
*/
- if (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL && method->addr) {
+ if (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL && ((MonoMethodPInvoke*) method)->addr) {
ji = g_new0 (MonoJitInfo, 1);
ji->method = method;
ji->code_size = 1;
- ji->code_start = method->addr;
+ ji->code_start = addr = ((MonoMethodPInvoke*) method)->addr;
mono_jit_info_table_add (mono_get_root_domain (), ji);
-
- addr = method->addr;
}
else
addr = mono_arch_create_method_pointer (method);
#else
#define MINT_IN_BREAK { COUNT_OP(*ip); goto *in_labels[*ip]; }
#endif
-#define MINT_IN_DEFAULT mint_default:
+#define MINT_IN_DEFAULT mint_default: if (0) goto mint_default; /* make gcc shut up */
#else
#define MINT_IN_SWITCH(op) switch (op)
#define MINT_IN_CASE(x) case x:
MINT_IN_BREAK;
}
MINT_IN_CASE(MINT_CALLINT)
- ves_pinvoke_method (frame, frame->runtime_method->method->signature, frame->runtime_method->method->addr,
+ ves_pinvoke_method (frame, mono_method_signature (frame->runtime_method->method), ((MonoMethodPInvoke*) frame->runtime_method->method)->addr,
frame->runtime_method->method->string_ctor, context);
if (frame->ex) {
rtm = NULL;
ip += 2;
child_frame.runtime_method = rtm->data_items [token];
- csig = child_frame.runtime_method->method->signature;
+ csig = mono_method_signature (child_frame.runtime_method->method);
newobj_class = child_frame.runtime_method->method->klass;
/*if (profiling_classes) {
guint count = GPOINTER_TO_UINT (g_hash_table_lookup (profiling_classes, newobj_class));
}
goto handle_finally;
MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_ICALL_V_V)
MINT_IN_CASE(MINT_ICALL_P_V)
MINT_IN_CASE(MINT_ICALL_P_P)
MINT_IN_CASE(MINT_ICALL_PP_V)
MINT_IN_CASE(MINT_MONO_RETOBJ)
++ip;
sp--;
- stackval_from_data (frame->runtime_method->method->signature->ret, frame->retval, sp->data.p, frame->runtime_method->method->signature->pinvoke);
+ stackval_from_data (mono_method_signature frame->runtime_method->method)->ret, frame->retval, sp->data.p,
+ mono_method_signature (frame->runtime_method->method)->pinvoke);
if (sp > frame->stack)
g_warning ("retobj: more values on stack: %d", sp-frame->stack);
goto exit_frame;
clause = &inv->runtime_method->clauses [i];
if (clause->flags <= 1 && MONO_OFFSET_IN_CLAUSE (clause, ip_offset)) {
if (!clause->flags) {
- if (mono_object_isinst ((MonoObject*)frame->ex, mono_class_get (method->klass->image, clause->token_or_filter))) {
+ if (mono_object_isinst ((MonoObject*)frame->ex, clause->data.catch_class)) {
/*
* OK, we found an handler, now we need to execute the finally
* and fault blocks before branching to the handler code.
MonoExceptionClause *clause;
GSList *old_list = finally_ips;
MonoMethod *method = frame->runtime_method->method;
- MonoMethodHeader *header = ((MonoMethodNormal *)method)->header;
+ MonoMethodHeader *header = mono_method_get_header (method);
#if DEBUG_INTERP
if (tracing)
int i;
guint32 ip_offset;
MonoExceptionClause *clause;
- MonoMethodHeader *header = ((MonoMethodNormal *)frame->runtime_method->method)->header;
+ MonoMethodHeader *header = mono_method_get_header (frame->runtime_method->method);
#if DEBUG_INTERP
if (tracing)
thread_abort_handler (int signum)
{
ThreadContext *context = TlsGetValue (thread_context_id);
- MonoThread *thread;
MonoException *exc;
if (context == NULL)
mono_install_handler (interp_ex_handler);
mono_install_stack_walk (interp_walk_stack);
- mono_runtime_install_cleanup (quit_function);
+ mono_install_runtime_cleanup (quit_function);
abort_requested = mono_thread_interruption_request_flag ();
domain = mono_init_from_assembly (file, file);
#ifdef __hpux /* generates very big stack frames */
mono_threads_set_default_stacksize(32*1024*1024);
#endif
- mono_init_icall ();
+ mono_icall_init ();
mono_add_internal_call ("System.Diagnostics.StackFrame::get_frame_info", ves_icall_get_frame_info);
mono_add_internal_call ("System.Diagnostics.StackTrace::get_trace", ves_icall_get_trace);
mono_add_internal_call ("Mono.Runtime::mono_runtime_install_handlers", mono_runtime_install_handlers);
mono_add_internal_call ("System.Delegate::CreateDelegate_internal", ves_icall_System_Delegate_CreateDelegate_internal);
+ mono_register_jit_icall (mono_thread_interruption_checkpoint, "mono_thread_interruption_checkpoint", mono_create_icall_signature ("void"), FALSE);
+
mono_runtime_init (domain, NULL, NULL);
+
mono_thread_attach (domain);
return domain;
}