[Prev][Next][Index][Thread]

Re: Harlequin 1.2 still available?




Hugh Greene wrote in message ...

>An alternative is to reserve a few "tag" bits in the first word of each
>object to encode a very few possibilities like "integer", "character" or
>"other object".  Then you only need the extra word for "other objects".
>This possibility is why the DRM only guarantees 28 bits for integers, not
>32 (I believe FunDev provides 29 bits).  The trade-off here is that you
>get fewer bits for your integers, characters etc.  There may also be a
>little extra work for arithmetic (e.g., masking out the tag bits
>beforehand, then ORing them back in afterwards -- I'm not a low-level
>compiler guy :-) but probably much faster than pointer dereferencing and
>possibly not much at all, if your instruction set supports tagged integers
>(to bring us back to the point I think Neel was making).


FWIW, if the compiler is careful, you don't need to tag anything
until you write it into memory, and you don't need to untag except
when you read from memory.  If your compiler is a little more
careful than that, and your GC is "conservative", you don't even
need to tag everything in memory.

I think the FD Dylan compiler is good about not tagging intermediate
results, but everything in memory is always tagged.  This makes
it easier to do the runtime, and the GC can be made more precise.

But really, what with Java running on everything, in a sane world
all new architectures would have a few tags that represent all the
Java primitive types (or at least int, float, char, and "pointer").
Then you alias the primitive types to their object classes (int and
Integer, e.g.), and voila` -- you're back to Lisp and SmallTalk
circa 1980, putting Java only 20 years behind instead of 30.  :-(





References: