65 ms·
You're assuming writable trampolines. objc_msgSend()'s trampoline works by caching the target lookup and having an extremely short fast-path in the case that th
by pbsdp 13y ago
You're assuming writable trampolines. objc_msgSend()'s trampoline works by caching the target lookup and having an extremely short fast-path in the case that the target method implementation is cached.
objc_msgSend is a trampoline in the sense that it leaves the frame/registers untouched and jumps straight to the target implementation.
That said, you can implement the kinds of trampolines you're referring to without writable code pages, it just requires more work: http://landonf.bikemonkey.org/2011/04/index.html http://landonf.bikemonkey.org/2011/04/index.html