In the x86 mono_create_method_pointer routine there
is the following section of code:
/*
* Handle the return value storage area.
*/
x86_lea_membase (p, X86_EAX, X86_EBP, stackval_pos);
x86_mov_membase_reg (p, X86_EBP, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, retval)), X86_EAX, 4);
if (sig->ret->type == MONO_TYPE_VALUETYPE && !sig->ret->byref) {
MonoClass *klass = sig->ret->data.klass;
if (!klass->enumtype) {
x86_mov_reg_membase (p, X86_ECX, X86_EBP, 8, 4);
x86_mov_membase_reg (p, X86_EBP, stackval_pos, X86_ECX, 4);
}
}
* Handle the return value storage area.
*/
x86_lea_membase (p, X86_EAX, X86_EBP, stackval_pos);
x86_mov_membase_reg (p, X86_EBP, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, retval)), X86_EAX, 4);
if (sig->ret->type == MONO_TYPE_VALUETYPE && !sig->ret->byref) {
MonoClass *klass = sig->ret->data.klass;
if (!klass->enumtype) {
x86_mov_reg_membase (p, X86_ECX, X86_EBP, 8, 4);
x86_mov_membase_reg (p, X86_EBP, stackval_pos, X86_ECX, 4);
}
}
To my undestanding
this does:
- Get the address of
the return value and set this in the Monoinvocation
structure
- if we are
returning a structure (not by reference) and the structure isn't a simple type
then ?? [this is what I need an explanation
of]
Neale Ferguson
