[cfe-dev] Fix for PR4701

David Chisnall csdavec at swansea.ac.uk
Sat Aug 15 15:52:16 PDT 2009


On 15 Aug 2009, at 20:50, Ken Ferry wrote:

> Why the exemption for isa?

No especially good reason, other than the fact that it is mentioned  
explicitly in all of the Objective-C (and Smalltalk) documentaiton  
I've seen.  The other fields are implementation details, while isa is  
part of the language.

> Isa is certainly more popular to access than other fields, but  
> there's no reason not to go through runtime functions.

Well, inside an instance you'll access it as just another ivar.  It's  
only when you're accessing it from outside, on an id rather than on  
something like an NSObject*, that you need this special handling.

Steve wanted to remove the isa pointer from the ivar lists of base  
classes too, which is a stronger motivation for having it treated  
separately.  This wouldn't be an incredibly invasive change, as there  
are very few Objective-C base classes in the wild (at least, in  
comparison with non-base classes), but it would break GCC  
compatibility quite severely, so it's something we'd have to introduce  
gradually.

I'm not particularly fussed either way.  I don't mind removing it now,  
with a view to potentially reintroducing it later, or leaving it in.

David



More information about the cfe-dev mailing list