Description
Hi,
I was looking through your changes and found myself looking at the message forwarding. The current code can be simplified with the new forwarding interface, which moves slot maintenance into the runtime. If you use __objc_msg_forward2 as the forwarding hook, things are more efficient with the new runtime. The v2 ABI now has a single global version for whether caching is safe, rather than a per-method one (methods are sufficiently rare that it’s fine to invalidate all method caches when they change – at some point I’ll rewrite the LLVM pass that I had that did automatic method caching for loops, let me know if you have any workloads I can use for benchmarking…).
This test shows the new interface (which is actually the very old interface, because that one was already the right shape):
https://github.com/gnustep/libobjc2/blob/master/Test/Forward.m
Oh, and the comment on _NSWeakLoad is slightly wrong: There’s a third condition, this hook is used only for classes that implement their own retain / release / autorelease and don’t claim to be ARC compatible. It’s mostly dead code, so you might want to log a warning that a weak reference was used to a class that is not ARC-safe when this is reached.
David