> -----Urspr�ngliche Nachricht----- > Von: Vivek, Bharath Varma (IE10) [mailto:[EMAIL PROTECTED] > Gesendet: Freitag, 04. Juli 2003 18:23 > An: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Betreff: [Mono-list] Why mono_marshal_get_runtime_invoke() ? > > > Hi, > > I noticed that there is some dynamic generation of IL wrapper > code happening within the runtime when I run a managed > application using mono. > > For the "Main" of my HelloWorld.exe application, this > dynamically generated IL code gets compiled to a function > that in turn makes a call to the runtime's function called > "mono_ldftn"(load function token), which eventually goes on > to compile my HelloWorld.exe's "Main". > If we know the managed application's entry point > method("Main") why don't we compile and call it directly? Why > do we create a function which in turn calls the entry point method?
For example we need to support exceptions, and this is also handled in the wrapper. The genersated wrapper has the following signature: MonoObject *runtime_invoke (MonoObject *this, void **params, MonoObject **exc) So this is a way to call managed function with different signatures, using an single API. For more information take a look at mono/mono/metadata/marshal.c - Dietmar > > I found that this mechanism is used for certain other > functions too(some of which are functions that support opcode > emulation). What's basis for deciding which functions in the > runtime will need this dynamic IL wrapper mechanism? > > Any pointers to this please.. > Hope the question is clear, if not I guess I'll write a > longer email with more details.... > > TIA > Vivek > > _______________________________________________ > Mono-list maillist - [EMAIL PROTECTED] > http://lists.ximian.com/mailman/listinfo/mono-> list > _______________________________________________ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
