[Mono-devel-list] problem with passing RuntimeTypeHandle args to the runtime

Laurent Morichetti l_m at pacbell.net
Sat Jul 26 21:31:20 EDT 2003


Hi

I'm having a problem with the trampoline code when passing a
RuntimeTypeHandle argument. It is assumed by the callee method that a
RuntimeTypeHandle is equivalent to a MonoType*.

On most platforms this assumption is correct but on HP-UX IPF 32bit (big
endian) it is not.

The calling convention on IPF states that aggregate types (if ordering is
big endian) are passed left aligned while scalar types are passed right
aligned. For (struct { int a; int b}) where a == 1 and b == 2 the argument
would be 0x0000000100000002, for (struct { int a; } where a == 1 the
argument would be 0x0000000100000000 and for (MonoType*) the argument would
be 0x00000000XXXXXXXX.

Now if I take the example of Type:internal_from_handle (RuntimeTypeHandle)
the trampoline code is going to encode the argument as 0xXXXXXXXX00000000
(vt:{IntPtr}) but the callee method (ves_icall_type_from_handle (MonoType*)
is expecting 0x00000000XXXXXXXX.


Should the trampoline code convert a RuntimeTypeHandle vt argument to a
scalar argument or should it be handled by the runtime? If handled by the
trampoline code, is there any other types assumed to be equivalent to their
unboxed representation?

Thanks,
-Laurent




More information about the Mono-devel-list mailing list