I would not have thought I ever say that: lets have a new primitve (was: Re: [squeak-dev] The Trunk: System-cwp.660.mcz)

Tobias Pape Das.Linux at gmx.de
Sun Jan 12 17:47:34 UTC 2014


Hi all,
On 12.01.2014, at 18:26, Florin Mateoc <florin.mateoc at gmail.com> wrote:

> On 1/12/2014 9:22 AM, Colin Putney wrote:
>> 
>> 
>> 
>> On Sat, Jan 11, 2014 at 6:40 PM, Florin Mateoc <florin.mateoc at gmail.com> wrote:
>>  
>> No, by following the proxy's nextObject, we start iterating a different loop than the original one (constituted by the bunch of objects just created, the proxy being the oldest in the bunch) until we reach the newest one among them, which will return 0.
>> 
>> I'm pretty sure there's just one loop. #allObjectsDo has one #whileFalse: message, and it keeps iterating until we reach 0. 
>>  
> 
> There is no loop per se. #nextObject will always point to a newer object than self. If we, at some point send #nextObject to a newly created object, like in the case of a materialized proxy, this newly created object is already newer than the sentinel and the chain will never point back to before the sentinel. So once #nextObject gets sent to the newer object, it will only follow the chain of objects that are even newer than the former proxy, which is a finite bunch, and when we reach the newest of the bunch it will return 0.
> 
> Florin
> 

Let’s be frank here:
As long as the enumeration of all hitherto object is
non-atomic, we always have to be extremely careful as to what
to do about new objects, when to allocate etc.pp.
  I really don’t like to say it, but it seems to me, that a 
VM primitive (say #primAllObjectsDo:) would be apt here.
Yes, it is not as elegant as #someObject/#nextObject seems,
but we could surely get a behavior that
• does not depend (image-side) on GC behavior 
  (Currently, it seems really just coincidence, that the sentinel
   object is the last one enumerated),
• is more easy implemented by cousin VMs (say, Potato, SqueakJS, 
  SPy/RSqueakVM, SqueakMaxine† 
  as it does not make assumptions image-side on the Image layout,
• does not expose the sentinel (should there be one) to the image

The current logic could easily be the fallback assumption for VMs up to now.

I am not the person to shout “new primitives”, au contraire, I mostly favor 
moving stuff from the VM to the image, but in this instance—and clearly with
seeing the different SqueakVM implementations—I think a new primitive is fair.

Best
	-Tobiad



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 1665 bytes
Desc: Message signed with OpenPGP using GPGMail
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20140112/dd7f931f/signature.pgp


More information about the Squeak-dev mailing list