News for hackers. Stuff that matters.
Re:Dissecting objc_msgSend on ARM64 by panic on Saturday July 01, 2017 @07:26PM (#14679702)
Could you do it with a C++ variadic template?
Re:Dissecting objc_msgSend on ARM64 by mikeash on Saturday July 01, 2017 @08:33PM (#14680005)
Sort of. If you did it that way, then the message dispatch code would get compiled into the calling code rather than being a separate function. That would work, but it would greatly increase code size, and would also mean Apple couldn't make incompatible changes to how messaging works without breaking old code. This last part is fairly important: Apple does make such changes, and the fact that objc_msgSend is part of the system means that old programs just keep on working. They've introduced non-pointer isas and tagged pointers this way.
Re:Dissecting objc_msgSend on ARM64 by asveikau on Saturday July 01, 2017 @08:24PM (#14679963)
That requires knowing types at compile time, and expands to just the code with the specific types used in the instantiation. That doesn't work with a virtual method dispatch kind of scenario where the types in the target method are not known to the runtime.