ObjFW runtime: Add objc_msg_lookup(_super)_{fp,st}ret

Eli Friedman eli.friedman at gmail.com
Mon Jul 8 14:47:29 PDT 2013


On Mon, Jul 8, 2013 at 2:38 PM, Jonathan Schleifer <js at webkeks.org> wrote:
> Am 08.07.2013 um 22:21 schrieb Eli Friedman:
>
>> If you ignore nil-messaging, you don't need any of these specialized
>> versions: objc_msg_lookup can always return a pointer to a function of
>> an appropriate type without any special knowledge of what that type
>> is.
>
> Actually, not quite. objc_msg_lookup does not know that the returned function returns a struct. Thus the normal forwarding handler is returned instead of the stret forwarding handler. This is why my patch adds objc_msg_send_stret, which returns the correct forwarding handler for stret.
>
> The question now is if there is need on any architecture for a special fpret forwarding handler. I can't think of any (I know x86, amd64, ppc, arm and mips don't need one), thus the question is if there is any architecture out there that would need a different forwarding handler for fret.

Err, sorry, I'm not familiar with the details of the forwarding
handler; I was sort of assuming objc_msg_lookup just returned the
function to call. :)  I'll assume since you wrote the relevant runtime
function, you know what you're doing.

Is this patch going to work correctly for other GNU-style runtimes
without an objc_msg_lookup_stret function?

-Eli




More information about the cfe-commits mailing list