[Vm-dev] ImageSegment, objects header and addresses

Mariano Martinez Peck marianopeck at gmail.com
Thu Jul 29 08:27:03 UTC 2010


On Tue, Jul 27, 2010 at 6:10 PM, K. K. Subramaniam <kksubbu.ml at gmail.com>wrote:

> On Tuesday 27 Jul 2010 8:02:29 pm Mariano Martinez Peck wrote:
> > Now....the line I don't understand is this:
> >
> >     self longAt: oop put: newOop + HeaderTypeFree.
> >
> > Because 'self longAt: oop'
> > will answer the object header of oop. And there, it stores a number (the
> > offset). Is this possible?
> >
> > In addition, it not only stores the offset, by it plus the flag
> > HeaderTypeFree.
> >
> > I really don't understand how you can plus an offset and the flag. What
> is
> > the result? how should I interpret that?
>

Hi Subbu.


> A oop is an offset. Since every oop is aligned to a 4-word boundary


ok.....each oop is 4-word -> 32 bits, 4 bytes. I am right?  One is used to
mark SmalltalkIntegers. But here, that doesn't matter.


> the least
> significant two bits are always zero.


why? I don't understand this. Why the last two bits are always zero? because
ImageSegment assumes that the size of the segment will be much smaller?


Sorry if this is a very newbie question.

yes, I noticed this

    "type field values"
    HeaderTypeSizeAndClass := 0.
    HeaderTypeClass := 1.
    HeaderTypeFree := 2.
    HeaderTypeShort := 3.

in initializeObjectHeaderConstants


> So these two bits are re-used for a
> typecode (0..3).
>
>
Thanks for the help

Mariano



> HTH .. Subbu
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20100729/5fa4c34f/attachment.htm


More information about the Vm-dev mailing list