[SqF]Report of VI4 Project for Apr '02

Rob Withers rwithers12 at attbi.com
Sat Apr 6 19:32:40 UTC 2002


Tim Rowledge <tim at sumeru.stanford.edu> wrote:
> Second report - Fri, 5th April 2002
> 
> 
> The initial report sparked some interesting duscussions on multiple
> tag-bits (to allow multiple immediate object classes) and extra
> hash-bits in the
> object headers. The tag-bit changes were not generally considered
> particularly interesting but the hash-bits seem to have some value. Also discussed
> was an immutable-bit that would make objects read-only or at least
> read-trap. No conclusions have been reached yet.

Tim,

I would like to make a brief comment about the Oops tag-bits.  Several
people discussed the fact that only 16 of the 32 compact classes are
assigned.  Since this means we have an unused bit, my suggestion would
be to use this bit as a special Oop flag.  When this flag is set, then
the other four compact class bits could be used for either 5 (each as a
flag) up to 16 different states.  These different states could include
read-only, custom lookup algorithm with special header including a
fn-ptr to the lookup method, promise with pointer to the msg queue, far
reference with uuid, stub for swapped out objects, etc.   We could also
include extra hash-bits.   Here is my proposal:

Of the 5 compact class bits (12-16 of the base header, I believe) let us
use bit 16 as a special oop flag.   Then I propose the following uses
for the other four:

16	15	14	13	12
0	x	x	x	x		normal oop maybe compact class
1	0	0	0	0		GC forwarder
1	0	0	0	1		read-only oop
1	0	0	1	0		custom lookup/structure
1	0	0	1	1		signal
1	0	1	0	0		foreign ref
1	0	1	0	1		promise
1	0	1	1	0		broken reference
1	0	1	1	1		unassigned
1	1	x	x	x		three extra hash bits (12-14)

I realize that every message send will have to check this.  Would this
hurt performance badly?  We could do: 

isSpecialOop: oop
	(self isIntegerObject: oop) ifTrue: [^false].
	^ (((self baseHeader: oop) >> 15) bitAnd: 16r2).

isSpecialHash: oop
	| flags |
	(self isIntegerObject: oop) ifTrue: [^false].
	flags := (self baseHeader: oop) >> 15.
	^ ((flags bitAnd: 16r2) and: [flags bitAnd: 16r1])


Rob



More information about the Squeak-dev mailing list