> On 29 Dec 2017, at 05:56, Josh Freeman <[email protected]> wrote:
>  When using the nonfragile ABI, the compiler emits code that calculates ivar 
> offsets using global variables - there's a global for each ivar, using the 
> naming convention:
> __objc_ivar_offset_[CLASS_NAME].[IVAR_NAME]
> 
>   For example, NSThread's _gcontext has a corresponding global in the emitted 
> code named, "__objc_ivar_offset_NSThread._gcontext".
> 
>   Nonfragile-ABI-compiled code calculates the address of an object's ivar by 
> adding the value of the ivar's __objc_ivar_offset* global to the object's 
> address.

This whole analysis is (like David’s work on the runtime and the compiler) 
black magic and wizardry — and reading it is an excellent learning experience.

Thank you for the writeup!

Attachment: signature.asc
Description: Message signed with OpenPGP

_______________________________________________
Discuss-gnustep mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep

Reply via email to