FYI: Mike Ash analyzes objc_msgsend


Mike Ash has been offline for a while, but his Friday Q&A is back with a detailed line-by-line analysis of the objc_msgsend function on ARM64. This is the core Objective-C runtime function that sends messages / calls methods on objects — every bracketed expression or property access turns into a call to this function (and so do Swift calls to @objc classes.) It’s written in assembly code to make it as fast as possible, and it’s very clever but it’s not magic; Mike explains it very well. I’m always fascinated to find out how these kinds of things work.