If you had money to place for a bounty, what would you choose?

Michel Fortin michel.fortin at michelf.ca
Wed Dec 4 03:43:40 PST 2013


On 2013-12-04 08:32:15 +0000, Jacob Carlborg <doob at me.com> said:

> On 2013-12-04 04:47, Michel Fortin wrote:
> 
>> - it's 32-bit-OS-X-only right now, iOS and 64-bit OS X both use a
>> different runtime which requires different codegen, and Apple has been
>> phasing out 32-bit for some time already
> 
> BTW, is there much difference between the modern runtime for 32bit and 
> 64bit? I'm thinking, is things like the optimization of using the 
> pointer for storing the data for types like NSNumber used on 32bit with 
> the modern runtime?

The pointer magic for NSNumber is pretty much inconsequential: it just 
means you need to use the runtime functions everywhere, such as 
objc_getClass to get a pointer to the class object instead of 
dereferencing the object yourself. But it's a detail to keep in mind.

A big change in the modern runtime is that classes are completely 
non-fragile, in that you can add a member in a superclass without 
breaking binary compatibility with derived classes. Which means that 
instance variables are accessed differently, by checking a global 
constant to find the right offset (initialized when first loading the 
class). I think the compiler also has to emit that constant that the 
runtime will initialize.

Another big change is exception handling which now piggyback on the C++ 
exception mechanism instead of using the inefficient longjump 
implementation of the previous runtime.

There's an optimized path for calling certain methods using a virtual 
table, but we can skip that in a first release as it's an optimisation 
(objc_msgSend still work fine in every case).

Beside that, they changed all the section names for the binary output, 
and probably did a some alterations to the binary structure I'm 
forgetting right now.

-- 
Michel Fortin
michel.fortin at michelf.ca
http://michelf.ca



More information about the Digitalmars-d mailing list