[Mono-devel-list] Prevalence of pointer-integral-pointer casting in mono?

Paolo Molaro lupus at ximian.com
Thu Aug 5 06:26:02 EDT 2004


On 08/04/04 Peter Colson wrote:
> To clarify, the platform concerned is the AS/400. It's not a full-blown
> 128-bit platform as such, however pointers are represented as 128-bit
> entities.

How much of that is the compiler doing weird things or the cpu requiring
that setup (like, for example, how function descriptors are used on some
archs)? The code generated by mono can have different behaviour than
the code generated by the C compiler used to compile mono. There is a
more-or-less defined interface that deals with going from managed to
unmanaged code, so if you'd need conversion code between the two worlds
it could go there. Not saying this will be particularly easy, but it's doable.
A quick google search seems to suggest that on as/400 the address space
is 48 bits, there are flags to compile code so that pointers are 8 bytes
long (even if it might not be the default). So this is another path that
could be taken (note, I know nothing about as/400, so I may have got
things wrong).
If the above is not applicable, you'll have to support 128 bit pointers
in the jitted code, too. This requires a bit of work if a register can't
hold a pointer (similar to how 64 bit ints are handled on 32 bit archs).
Of course, the places where the runtime assumes a pointer can be stored
in a 64 bit int needs fixing.
Anyway, if I were you, I'd first look at how feasible is a libgc port,
since that is a requirement of mono anyway.

lupus

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



More information about the Mono-devel-list mailing list