[Vm-dev] ImageSegment, objects header and addresses

K. K. Subramaniam kksubbu.ml at gmail.com
Thu Jul 29 13:14:20 UTC 2010


On Thursday 29 Jul 2010 1:57:03 pm Mariano Martinez Peck wrote:
> On Tue, Jul 27, 2010 at 6:10 PM, K. K. Subramaniam > > 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.
Yes, 4-word should actually read 4-byte word. Mea culpa :-(.

> > 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?
No. Because an oop is a 4-byte aligned pointer. Its last two bits will always 
be zero. The choice and position of bits in an oop and special bits in an 
object header gives us a quick way to compute byte offsets into object memory.

HTH .. Subbu


More information about the Vm-dev mailing list