discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ffcall on Darwin/PPC


From: Wolfgang Lux
Subject: Re: ffcall on Darwin/PPC
Date: Mon, 19 Mar 2007 10:38:05 +0100

Lars Sonchocky-Helldorf wrote:

Did you file a bug with gcc on this?

http://gcc.gnu.org/bugzilla/

Andrew Pinski wrote:

You know I have not see any bug reports from you about libffi.  In
fact I rather have GNUStep always use libffi because it is more
supported with more targets (and the semi official base code is inside
GCC).  I am about to review the patch which used libffi instead of
__builtin_apply (etc.) inside libobjc also.

Looks like you misunderstood my email (okay, that's what I deserve for
writing mails on saturday evening :-). I do not think there is a bug in
gcc or libffi. It is even worse than that: I was thinking that libffi
is inappropriate or at least is used inappropriately for implementing
message forwarding in GNUstep.

The point is that the implementation of message forwarding in GSFFIInvocation.m
copies the incoming message arguments into a malloc'ed buffer. In order
to do so, it somehow needs to know the size of the argument frame. In
order to get this information, GSFFIInvocation uses the message signature supplied to the callback and falls back to the signature of a method with no arguments and an id result if the selector passed to the callback cannot
provide type information.

Now, I'm not saying that it is the fault of either libobjc or gcc that the
exact signature type is not available. There are situations where it is
difficult or maybe even impossible to determine this information. Have a
careful look at the example from Issac Trotts' posting:
http://lists.gnu.org/archive/html/discuss-gnustep/2006-04/ msg00107.html The receiver of the message is a proxy and does not even declare the methods it is forwarding. I may be wrong, but to me it looks hard to determine the
right message signature here (even with Andrew Ruder's patch).

Compare this with the implementation of message forwarding in
GSFFCallInvocation.m. The code appears to use only information about the
return type of a message, so it can handle missing type information more
gracefully in a lot more cases than GSFFIInvocation. This led me to the
(admittedly provocative) question, why GNUstep needs to maintain two
different implementations of message forwarding.

Regards
Wolfgang





reply via email to

[Prev in Thread] Current Thread [Next in Thread]