[Vm-dev] About the image

Bert Freudenberg bert at freudenbergs.de
Tue Aug 17 12:38:48 UTC 2010


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 ;)

>>> - 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 -




More information about the Vm-dev mailing list