2003-9-24 Bernie Solomon <bernard@ugsolutions.com>
authorBernie Solomon <bernard@mono-cvs.ximian.com>
Thu, 25 Sep 2003 06:17:21 +0000 (06:17 -0000)
committerBernie Solomon <bernard@mono-cvs.ximian.com>
Thu, 25 Sep 2003 06:17:21 +0000 (06:17 -0000)
* interp.c: I broke calling native delegates reinstate
old code for the moment.

svn path=/trunk/mono/; revision=18290

mono/interpreter/ChangeLog
mono/interpreter/interp.c

index fbcf219342b7c8c6e10b63d3eaefa7b077e3ff04..c8df0302d1d77b771dfd19959b401ba9c811f208 100644 (file)
@@ -1,3 +1,8 @@
+2003-9-24  Bernie Solomon  <bernard@ugsolutions.com>
+
+       * interp.c: I broke calling native delegates reinstate
+       old code for the moment.
+
 2003-9-22  Bernie Solomon  <bernard@ugsolutions.com>
 
        * interp.c: use mono_marshal_get_delegate_invoke to get delegate 
index ba09381183d2206a6cae0ee75c6591af2f5b826c..6f2230f0b6bb9c93391dd093fdd8574871a2edee 100644 (file)
@@ -745,6 +745,7 @@ ves_runtime_method (MonoInvocation *frame, ThreadContext *context)
 {
        const char *name = frame->method->name;
        MonoObject *obj = (MonoObject*)frame->obj;
+       MonoMulticastDelegate *delegate = (MonoMulticastDelegate*)frame->obj;
        MonoInvocation call;
        MonoMethod *nm;
 
@@ -757,10 +758,26 @@ ves_runtime_method (MonoInvocation *frame, ThreadContext *context)
                        return;
                }
                if (*name == 'I' && (strcmp (name, "Invoke") == 0)) {
-                       nm = mono_marshal_get_delegate_invoke (frame->method);
-                       INIT_FRAME(&call,frame,obj,frame->stack_args,frame->retval,nm);
-                       ves_exec_method_with_context (&call, context);
-                       frame->ex = call.ex;
+                       guchar *code;
+                       MonoJitInfo *ji;
+                       MonoMethod *method;
+               
+                       while (delegate) {
+
+                               code = (guchar*)delegate->delegate.method_ptr;
+                               if ((ji = mono_jit_info_table_find (mono_root_domain, code))) {
+                                       method = ji->method;
+                                       INIT_FRAME(&call,frame,delegate->delegate.target,frame->stack_args,frame->retval,method);
+                                       ves_exec_method_with_context (&call, context);
+                                       frame->ex = call.ex;
+                                       if (frame->ex)
+                                               return;
+                               } else {
+                                       g_assert_not_reached ();
+                               }
+
+                               delegate = delegate->prev;
+                       }
                        return;
                }
                if (*name == 'B' && (strcmp (name, "BeginInvoke") == 0)) {