[SqF]Report of VI4 Project for Apr '02

Rob Withers rwithers12 at attbi.com
Wed Apr 10 04:23:53 UTC 2002

Peter Crowther <peter.crowther at networkinference.com> wrote:
> It does.  But SmallIntegers are never in headers, and headers (by
> definition) are never in object bodies where they can be confused with
> SmallIntegers.  So all is well.

I wish I had looked at the comment for ObjectMemory, before I crawled
through all that code to figure it out. :)  I had completely forgotten
about the existence of pointers as well, but sure enough we have them. 
I think I've passed another stage and am fast approaching my black belt.
  I was able to completely forget that pointers ever existed!

This must mean that there is a black hole in the address space since
only half of memory is addressable.  I'm at 1.5 GB and while I'm
comfortable there, I may want to run squeak in a larger address space.  
Do you know if anyone has done a 64-bit port?

> The GC does, indeed, trash three bits at the bottom of the headers; it also
> goes to considerable lengths to put them back correctly after collection.

Darn, then I can't blame the occasional glitch in my redirector vm on

> I looked into this stuff about three years ago when I wanted to add a
> security header to all/most object headers.  It reminds me of a very, very
> precisely engineered internal combustion engine: it all works reliably until
> you touch something.  Then it blows up and scatters bits all over the object
> memory (if you're lucky; I've had them land over a much wider range :-).

How did that work?   A 4th header word if some bit was set?  I was
thinking about adding the extra ccIndex bit to the header type, but then
I read about the suggestion to make Context a format type.  It sounds
like some special objects can be encoded there, and if we include this
check in #fetchClassOf: we could combine ccIndex and object format and
free up several bits in the process.  

For my needs I could use either a bit or a format, but a change in
header structure may warrent a bit.   So how about a bit for custom
lookup.  This would add an extra header word, that would be a pointer or
handle to a message lookup function.  We could use the same technique to 
specify a foreign address header word with a LOOM bit. One of these cases 
may be able to reuse the class pointer.  (and yes there is an extra hash bit 
as well :)

The base header layout could be:
29-31	3 bits	reserved for gc (mark, old, dirty)
16-28	13 bits	object hash (for HashSets)
15		1 bit	LOOM bit
14		1 bit	custom lookup
13		1 bit	read-only
8-12		5 bits	object format
2-7		6 bits	object size in 32-bit words
0-1		2 bits	header type (0: 3-word, 1: 2-word, 2: forbidden, 3: 1-word)


More information about the Squeak-dev mailing list