|
From: | Luboš Doležel |
Subject: | Re: objc_msgSendSuper implementation? |
Date: | Tue, 09 Oct 2012 11:44:07 +0200 |
User-agent: | Roundcube Webmail/0.5 |
On Tue, 9 Oct 2012 10:34:02 +0100, David Chisnall wrote:
On 9 Oct 2012, at 10:29, Luboš Doležel wrote:And what exactly is the fast path? objc_msg_lookup_super()?The fast path is the cached lookup, which involves no calls into the runtime at all and just checks that the cached lookup is valid before calling it.
Could you point me to how to do that in my code? Or at least tell me how to make Clang emit such code, since
clang objc_super.m -o objc_super -l:libobjc.so.4 -lgnustep-baseuses objc_msg_lookup_super(). With -fobjc-abi-version=2, it emits a objc_slot_lookup_super() call.
Because I wrote my own objc_msgSendSuper()/objc_msgSendSuper2() in assembly that passes the arguments on to objc_msg_lookup_super and then jumps to the return value of that.For what platform? This is indeed possible, but it's going to be slower than the existing mechanism because it won't play as well with the CPU's branch predictor...
x86/x86-64 only, in other words the platforms for which OS X apps exist (not including iOS).
-- Luboš Doležel
[Prev in Thread] | Current Thread | [Next in Thread] |