[Vm-dev] About the image

Eliot Miranda eliot.miranda at gmail.com
Wed Aug 18 01:24:40 UTC 2010


On Tue, Aug 17, 2010 at 5:38 AM, Bert Freudenberg <bert at freudenbergs.de>wrote:

>
> On 17.08.2010, at 13:27, stephane ducasse wrote:
>
> >>> Hi, I have just began to work at this low level and I have 2 questions:
> >>
> >> Nice. But you need to give us a little more context. What are you trying
> to do?
> >
> > Bootstrap
>
> Building an image from first principles? Nice :)
>
> > and shaking/documenting the hidden assumptions on the way.
>
> Excellent!
>
> >>> - What is the minimal object structure I should implement from VM
> perspective?
> >>
> >> Normally you do not have to implement this, as the interpreter is shared
> between all platforms.
> >
> > yes we know. Nicolas read the chapter of tim but we wanted to check if
> this is still up to date.
> > My original question was more: where can I find the class object VM
> interpretation (that the first slot should be superclass, format....)
> > because I remember that we could not add an instance variable into
> behavior when we did traits.
>
> Ah. That's a more concrete question :)
>
> I thought the three inst vars in Behavior was all the VM knew and cared
> about? I'd consider everything else a bug ;)
>

That's right.  See all implementors of initializeClassIndices:

BTW, you /can/ add an inst var to Behavior.  Try and evaluate

Object subclass: #Behavior
instanceVariableNames: 'superclass methodDict format extra'
classVariableNames: 'ObsoleteSubclasses'
poolDictionaries: ''
category: 'Kernel-Classes'

Works for me in a 4.1 derived image.


BTW Stéphane,  IMO the VM's Slang code is far friendlier than the generated
C.  The Slang translator is the thing that's unfriendly.  It doesn't do much
verification and so when it mistranslates it can be hard to figure out
what's going on.  but the Slang/Smalltalk that implements the VM is fine.

 >>> - Where are defined the 3 formats of objects representation?
> >>
> >> Not sure what you mean. ObjectMemory>>formatOf: defines the class format
> bits in the header.
> >
> > Yes we saw that.
> >
> >> Or do you mean the 3 header formats? Read the class comment of
> ObjectMemory.
> >>
> >> Also, there is a nice explanation in section A.1 of Tim's chapter in the
> NuBlue book:
> >>
> >> http://www.rowledge.org/tim/squeak/assets/OE-Tour.pdf
> >
> > Another question was where can we get a description of the image format.
> > I was planning to read the VM C code included the generated one.
>
> The image is just a header plus a memory dump of the object memory. The
> header is written in Interpreter>>writeImageFileIO: and read in
> Interpreter>>readImageFromFile:HeapSize:StartingAt:.
>
> - Bert -


best
Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20100817/75601b25/attachment.htm


More information about the Vm-dev mailing list