The Mosner bit

Tim Rowledge tim at sumeru.stanford.edu
Fri Sep 1 17:49:58 UTC 2000


Bijan Parsia <bparsia at email.unc.edu> is widely believed to have written:

> Cool!
> 
> I had been wondering for a while if the extended tag scheme would
> work. Any VM implementers/object memory specialists want to weigh in?
VW has used two tag bits for years. IIRC it uses three of the patterns:-
smallinteger
oop
character

The cost is not just the reduction in range of SmallInteger - after all
the difference is pretty small - but the complexity of the tag checking.
at the moment, checking for SmallInteger/oop is a single test. Two tag
bits makes deriving the class more complex (check for SI, check for
other option, remainder is normal object) and affects any code that
needs to understand the class of the objects involved.

A restriction is that this is only really useful for manifest constant
objects; yes, you could use the data bits to index a list of classes for
example, but how is that an advantage over having the oop of the class?
Immediate Points, restricted range floats, colour values, anything where
the bits is the data, would all be plausible. Remember that such
manifest objects cannot be altered any more than a SmallInteger can, so
quite a bit of code in the image would be affected; for example you wuld
have to write
pt1 := pt1 x @ (pt1 y *2)
instead of
pt1 y: (pt1 y * 2)
... which is a poor example since I think I would prefer it anyway, but
you're smart enough to see what I mean.

So, yes it might be useful in some sense but I rather suspect the
runtime costs are unpleasant, especially once you go past a simple VW
like form.

tim

-- 
Tim Rowledge, tim at sumeru.stanford.edu, http://sumeru.stanford.edu/tim
Maybe Computer Science should be in the College of Theology.  - R. S. Barton





More information about the Squeak-dev mailing list