Re: New ABI NSConstantString

2018-04-05 Thread David Chisnall
On 6 Apr 2018, at 00:25, Stefan Bidigaray wrote: > > I use the gmail web interface, which is not great. I'll just comment without > quoting. > > The thing I'm trying to address is the fact that all CF objects must start > with: > struct { > void *isa; >

Re: New ABI NSConstantString

2018-04-05 Thread Stefan Bidigaray
I use the gmail web interface, which is not great. I'll just comment without quoting. The thing I'm trying to address is the fact that all CF objects must start with: struct { void *isa; uint32_t info; }; That 32-bit info value includes the CFTypeID (a 16-bit value) and 16-bit for

Re: New ABI NSConstantString

2018-04-05 Thread David Chisnall
This might be slightly confusing, because your mail client doesn’t seem to do anything sane for quoting: On 5 Apr 2018, at 20:09, Stefan Bidigaray wrote: > > On Thu, Apr 5, 2018 at 1:41 PM, David Chisnall > wrote: > On 5 Apr 2018, at 17:27,

Re: New ABI NSConstantString

2018-04-05 Thread Stefan Bidigaray
On Thu, Apr 5, 2018 at 1:41 PM, David Chisnall wrote: > On 5 Apr 2018, at 17:27, Stefan Bidigaray wrote: > > > > Hi David, > > I forgot to make a comment when you originally posted the idea, and I > think this would be a great time to add my 2

Re: New ABI NSConstantString

2018-04-05 Thread Ivan Vučica
Thank you, this was very informative! On Thu, Apr 5, 2018 at 6:41 PM, David Chisnall wrote: > On 5 Apr 2018, at 17:01, Ivan Vučica wrote: >> >> Layman question: does it make sense to optimize for space, too, and have a >> smaller structure for tiny

Re: New ABI NSConstantString

2018-04-05 Thread David Chisnall
On 5 Apr 2018, at 17:01, Ivan Vučica wrote: > > Layman question: does it make sense to optimize for space, too, and have a > smaller structure for tiny constant strings? With the new ABI, we get much better deduplication across compilation units for selectors and protocols,

Re: New ABI NSConstantString

2018-04-05 Thread David Chisnall
On 5 Apr 2018, at 17:27, Stefan Bidigaray wrote: > > Hi David, > I forgot to make a comment when you originally posted the idea, and I think > this would be a great time to add my 2 cents. > > Regarding the structure: > * Would it not be better to add the flags bit field

Re: New ABI NSConstantString

2018-04-05 Thread Stefan Bidigaray
Hi David, I forgot to make a comment when you originally posted the idea, and I think this would be a great time to add my 2 cents. Regarding the structure: * Would it not be better to add the flags bit field immediately after the isa pointer? My thought here is that it can be checked for if

Re: New ABI NSConstantString

2018-04-05 Thread Ivan Vučica
Layman question: does it make sense to optimize for space, too, and have a smaller structure for tiny constant strings? For 32bit ptrs and longs, this would be 20 bytes without the string itself. I don't think that's a lot, but I thought I'd ask. On Thu, Apr 5, 2018, 16:25 David Chisnall

Re: New ABI NSConstantString

2018-04-05 Thread David Chisnall
On 1 Apr 2018, at 14:06, Richard Frith-Macdonald wrote: > > > I wasn't aware of that ... it would make sense for your new ABI, when > individual bits, to have them specified as particular bits rather than as a > bitfield, avoiding the possibility of