Object Format
Alan Kay
Alan.Kay at squeakland.org
Sun Oct 13 23:51:19 UTC 2002
Depends on who's flying the plane ...
Cheers,
Alan
-----
At 6:47 PM -0400 10/13/02, PhiHo Hoang wrote:
>Hi Ian,
>
>> You might also find the following useful:
>>
>> http://www-sor.inria.fr/~piumarta/esug98/slides.ps.gz
>>
>> starting around page 33.
>
> Indeed, the whole document is very useful and interesting to read.
>
> Thanks a lot, Ian.
>
> BTW, were you teasing ?
>
> On page 17 you mentioned a 'violently stripped' thingy. ;-)
>
> Where can I find such a beauty ?
>
> Of course, I would love to lay my hand on an 'eXtremely violently
>stripped' one.
>
> The smaller the more fun. Size does matter ;-)
>
> Again, many thanks for the explanation and the document.
>
> Cheers,
>
> PhiHo.
>
> P.S: Now I also understand what it means by Blue Plane and Pink Plane.
> Just wondering what colorful plane is Squeak now riding.
> (Are Grey or Black also considered colors ? )
>
>
>----- Original Message -----
>From: "Ian Piumarta" <ian.piumarta at inria.fr>
>To: <phiho.hoang at rogers.com>
>Cc: <squeak-dev at lists.squeakfoundation.org>
>Sent: Sunday, October 13, 2002 4:47 PM
>Subject: Re: Object Format
>
>
>> On Sun, 13 Oct 2002, PhiHo Hoang wrote:
>> > - 4 bits object format
>> >
>> > What is this 4-bit 'object format' field.
>>
>> It tells you about what the instance contains.
>>
>> The top bit (bit 3) is 1 for byte objects, 0 for word/pointer objects.
>>
>> If the top bit is zero (words/pointers) then:
>> Bit 2 is 0 for pointer objects, 1 for words.
>> Bit 1 is set if there are indexable fields, 0 if there are none.
>> Bit 0 is set if there are fixed fields (named inst vars), otherwise 0.
>>
>> A "word" object (bit 2 set) that has neither indexable nor fixed fields
>> (bits 1 and 0 clear) contains weak references and may have both fixed and
>> indexable fields. (Unless the object contains only fixed fields then you
>> have to follow the class pointer and look in the class's "instanceSize"
>> field to find out how many fixed fields are in it.)
>>
>> If bit 3 is set (byte object) then bit 2 tells you whether it's a compiled
>> method (set means it's compiled method). Methods start with an extra
>> header word (look in class CompiledMethod to see what it contains)
>> followed by zero or more real pointers (the literals of the method).
>> After the pointers they turn into byte objects again. Bits 1 and 0 (of
>> any byte object) are the number of bytes by which the size header (or size
>> field in the base header) is too large (since a bytes object might be 0,
>> 1, 2 or 3 bytes short of an integral number of words long).
>>
>> To summarise, if we consider the format as an integer from 0 to 15, we
>> get:
>>
>> 0 0000 no fields
>> 1 0001 fixed fields only (all containing pointers)
>> 2 0010 indexable fields only (all containing pointers)
>> 3 0011 both fixed and indexable fields (all containing pointers)
>> 4 0100 both fixed and indexable weak fields (all containing pointers).
>> 5 0101 unused
>> 6 0110 indexable word fields only (no pointers)
>> 7 0111 unused
>> 8-11 10xx indexable byte fields only (no pointers)
>> 12-15 11xx compiled methods: # of literal oops specified in method header
>>
>> > Where can I find further detailed information about this 'object
>format'.
>>
>> Browse class ObjectMemory in the image, and the object access primitives
>> in class Interpreter.
>>
>> You might also find the following useful:
>>
>> http://www-sor.inria.fr/~piumarta/esug98/slides.ps.gz
>>
>> starting around page 33.
>>
>> Regards,
>> Ian
>>
>>
>>
>>
>>
--
More information about the Squeak-dev
mailing list
|