reflection / D's function calling convention?
Thomas Kuehne
thomas-dloop at kuehne.cn
Wed Nov 1 12:15:50 PST 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Jarrett Billingsley schrieb am 2006-11-01:
> "Chris Miller" <chris at dprogramming.com> wrote in message
> news:op.tib3szvnpo9bzi at tanu...
>> Can you please explain some more...
>
> Here's all that I've researched:
>
> DMD FUNCTION CALLING CONVENTION:
Thanks.
> params are passed, in general, l-to-r.
>
> in functions with varargs, all params are passed r-to-l
<snip>
Wouldn't it be easier and less bug prone to use r-to-l for all?
Even unidirectional __cdecl/extern(C) seems hard to implement:
"Random Testing of C Calling Conventions"; Christian Lindig; 2005
http://www.st.cs.uni-sb.de/~lindig/papers/quest/quest.pdf
> > Bigger return types probably first push a pointer to a return buffer?
>
> Hmm, guess I didn't do much return type research :S
Defining that seems to be crucial.
The C++ people have serious problems with structs:
http://www.agner.org/optimize/calling_conventions.pdf
Table 7(methods for returning structure, class and union objects)
shows how everybody and his dog uses a different approach.
Thomas
-----BEGIN PGP SIGNATURE-----
iD8DBQFFSQ12LK5blCcjpWoRAqGRAKChAYjWAjB0BDAZonuVL7CIe2wgYgCeMCOM
R6Zzykj4FlI0OaOqvfJkraE=
=Vhbq
-----END PGP SIGNATURE-----
More information about the Digitalmars-d
mailing list