[Squeak-e] Programming the VM

Robert Withers rwithers12 at attbi.com
Mon Feb 3 13:37:28 CET 2003

Hi Stephen,

I cc'ed you since you have recent experience adding an extra header 
word to Squeak object headers.  The swiki is at http://squeake.net, if 
you would like to join the list and there are mail archives, of course.

On Monday, February 3, 2003, at 06:22 AM, cg at cdegroot.com wrote:

> Mark S. Miller <squeak-e at lists.squeakfoundation.org> said:
>> This is lexical scoping, not dynamic scoping, just as Alan's metaphor 
>> would
>> seem to demand. Object references stretch between "machines". 
>> Messages move
>> between "machines" riding references. Objects stay where they're born.
> Yeah, I figured that out for myself *after* I posted. Stupid me.
> <spank target="self"/>
> Anyway, that'd probably mean, or could mean, that you'd have an extra
> slot in these objects pointing to their 'machine', not? When they are
> instantiated, they get the parent's 'machine' reference unless the
> parent overrides it (either by setting it after the fact, or more 
> likely
> by a something like 'Foo newInNewEnvironment').
> SqueakVM specialists: how hard is it to add an extra reference to all
> objects? On Squeak level? On VM level?

I would like to hear a little more about what this 'machine' actually 
is.  Is it a lexical closure?  Would all objects need to have this 
'machine' reference?

Squeak object headers are of variable size.  there are 3 different 
sizes so it uses 2 bits in the baseHeader to define the header size.  1 
word, 2 words, or 3 words are the possibilities, and the fourth value 
is for dead objects, I believe.  Stephen added an extra word for his 
LOOM impl, and basically all the code that reads or writes the headers 
would need to be changed to deal with it.

In thinking about how my eventual contexts and this machine context 
could be combined, it may be best to give all objects this context 
structure, which the VM could pack appropriately, and let it be a 
dynamic descriptor of the state of the reference.   Near, Eventual, 
Persistent, and Private machine scope attribute could be packed inside 
of this context.


More information about the Squeak-e mailing list