[Vm-dev] #becomeUncompact not longer works in Cog/Stack VMs

stephane ducasse stephane.ducasse at gmail.com
Mon May 9 08:52:21 UTC 2011


Hi andreas

> I don't recall if Eliot has published all the details (we went over it during some lunch break once) but the basic idea is described here:
> 
> http://lists.squeakfoundation.org/pipermail/squeak-dev/2008-August/131167.html
> http://lists.squeakfoundation.org/pipermail/squeak-dev/2008-September/131206.html


I read the second link multiple times but I could not get the following:

"- sending a message to an object.  The object's class and the message's
selector are quertied for their identity hash.  If either object does not
have one it is assigned.  So the class object is identified from context; it
is the class of the receiver."

I could not understand the last sentence from the second link.


"One nice thing I didn't mention is that one can use "class index puns".
 There is nothing to prevent the VM from entering a class into the class
table more than once.  So I entered in WeakArray twice into the class table,
and used one as a hidden class index for the pages of the class table
itself.  When one does WeakArray allInstances, therefore, the class table
pages are not found.  Further, the finalization machinery can easily
identify a class table page, because it has a unique class index, and so the
maintennance of the first unused class table slot index is very cheap."

I could not understand the trick of entering the weakarray twice.



Stef


More information about the Vm-dev mailing list