3 ms·
You can't use jump tables in Objective-C because methods can be added to objects at runtime.
by tcard 7y ago
You can't use jump tables in Objective-C because methods can be added to objects at runtime.
- masklinn 7y agoThat doesn't preclude using jump tables. You can also add methods to objects at runtime in JS and modern runtimes use jump tables. I expect you can't use jump tables in objc because you can't really "patch in" jump tables at runtime as it's AOT-compiled rather than JIT-ed.
- tcard 7y agoRight, but that's no longer "just" jump tables, you need additional JIT logic for those tables to be correct. Plus, in a JIT you can go even further and just do direct calls, no need for the indirection of tables.