[Mono-list] mono_enter_method/mono_leave_method

Paolo Molaro lupus@ximian.com
Mon, 19 Apr 2004 13:04:47 +0200

On 04/15/04 Miguel de Icaza wrote:
> > I note in the code in the CVS, that the formerly arch dependent code
> > contained within enter_method and leave_method has been "made" platform
> > independent and placed in mini.c in the routines mono_enter_method and

I assume you mean mono_trace_enter_method/mono_trace_leave_method in

> > mono_leave_method. However, the method of decoding parameters and results is
> > very ABI-specific. The generic stuff just won't work for S/390 for example.

Yes. Miguel moved the code from the arch-specific files to trace.c, but
it's obviously incorrect.

> > If you want to have a generic mechanism then I'd suggest the first call
> > should be to mono_arch_enter_method/mono_arch_leave_method which could
> > return TRUE or FALSE which would indicate whether the rest of the generic
> > path should be taken. The mono_arch_xxxx_method routines could either do all
> > the processing themselves or just return to the generic to allow it to do
> > the work.

I think the enter/leave methods should be kept internal to the
arch-specific files and the general code should use a different
interface, probably similar to the runtime_invoke() one.
Basically, the function should look like:

void enter_method_callback (MonoMethod *method, void **args);

where the values in the args array are as usual (reference types
or pointers to the valuetype data).
This interface should be exported with a profiler flag: there is already
a patch posted to the list that does some of the work. I'll review it


lupus@debian.org                                     debian/rules
lupus@ximian.com                             Monkeys do it better