3 ms·
In "the obvious", note that the switch to ARM64 also allows a more efficient Obj-C runtime: there are more unused bits (due to alignment and effective pointer s
by masklinn 13y ago
In "the obvious", note that the switch to ARM64 also allows a more efficient Obj-C runtime: there are more unused bits (due to alignment and effective pointer sizes) in AArch64 than in AArch32, and more in ARM64 than x86-64.
This allows the obj-c runtime to smuggle significantly more information inline in the `isa` pointer on ARM64 than on ARM32 or x86-64 (via pointer tagging): http://www.sealiesoftware.com/blog/archive/2013/09/24/objc_explain_Non-pointer_isa.html http://www.sealiesoftware.com/blog/archive/2013/09/24/objc_e... http://www.mikeash.com/pyblog/friday-qa-2013-09-27-arm64-and-you.html http://www.mikeash.com/pyblog/friday-qa-2013-09-27-arm64-and...
(amongst other things, 19 bits of the pointer are now used to hold the object's reference count, for any object with less than half a million references an incref or decref is just an atomic increment or decrement of this field, instead of an indirection through a global refcount table with a bunch of locks involved)
- sorbits 13y ago> In "the obvious", note that the switch to ARM64 also allows a more efficient Obj-C runtime […] Why wouldn’t inline reference counts (as an extra 32 bit word in the object struct) be just as effective on a 32 bit architecture? Apple’s tagged pointer tricks are just making the best of a bad situation.
- mikeash 13y agoMost definitely. If you were building a new environment from scratch, there's no reason you couldn't do the same basic stuff in a 32-bit world. Apple just couldn't do it without the architecture transition because it would break everything.
- r00fus 13y agoHow are extra 32bit words considered "inline"? Wouldn't this completely miss using the register for count evaluation?