AW: [Mono-list] Why mono_marshal_get_runtime_invoke() ?
Thu, 10 Jul 2003 12:52:52 +0200
> -----Urspr=FCngliche Nachricht-----
> Von: Vivek, Bharath Varma (IE10) [mailto:Vivek.Varma@honeywell.com]=20
> Gesendet: Freitag, 04. Juli 2003 18:23
> An: email@example.com
> Cc: firstname.lastname@example.org
> Betreff: [Mono-list] Why mono_marshal_get_runtime_invoke() ?
> I noticed that there is some dynamic generation of IL wrapper=20
> code happening within the runtime when I run a managed=20
> application using mono.=20
> For the "Main" of my HelloWorld.exe application, this=20
> dynamically generated IL code gets compiled to a function=20
> that in turn makes a call to the runtime's function called=20
> "mono_ldftn"(load function token), which eventually goes on=20
> to compile my HelloWorld.exe's "Main".=20
> If we know the managed application's entry point=20
> method("Main") why don't we compile and call it directly? Why=20
> do we create a function which in turn calls the entry point method?=20
For example we need to support exceptions, and this is also handled in =
wrapper. The genersated wrapper has the following signature:
MonoObject *runtime_invoke (MonoObject *this, void **params, MonoObject
So this is a way to call managed function with different signatures, =
an single API.
For more information take a look at mono/mono/metadata/marshal.c
> I found that this mechanism is used for certain other=20
> functions too(some of which are functions that support opcode=20
> emulation). What's basis for deciding which functions in the=20
> 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=20
> longer email with more details....
> Mono-list maillist - Monoemail@example.com=20
> http://lists.ximian.com/mailman/listinfo/mono-> list