[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Mon Feb 1 10:14:48 1998 
Subject:Re: Garbage Collection and O-O 
From:Jonathan L Cunningham 
Volume-ID:980201.01 

In article <34c61a95.0@rcfnews.cs.umass.edu>,
pop@cs.umass.edu ( Robin Popplestone ) wrote:

>(1) In most implementations of LISP and its descendents, an object
>is characterised by one machine-word (32 bits in most cases). It is this
>one-word bit-pattern that is passed as a function-argument, returned as a
>function-result etc.  Usually this 32-bit pattern has been divided into
>tag-bits (commonly 8 in LISP implementations, 2 in Poplog) and the rest.
>The rest is either a pointer to an object or may represent an integer or
>possibly a float. The tag bits determine what the rest means. The Poplog
>convention is this:
>                                      TAG
>        |------30 bit address --------|00|
>        |------30 bit integer --------|01|
>        |------30 bit float  ---------|10|
>
>which has  the  advantage  that  the  "00"  combination  makes  the  32-bit
>bit-pattern  actually  -be-  a  machine   address,  without  the  cost   of
>de-tagging. A tagging-scheme like this has the advantage in LISP, which  is
>basically not statically typed, that the sort of integers you want for most
>purposes can represented as 32-bit items.

For some reason, I thought Poplog was like this:
                                       TAG
         |------30 bit address --------|10|
         |------30 bit integer --------|00|
         |------30 bit float  ---------|01|

Which has the advantage that you can add two integers using a single
machine instruction. Nor do you need to de-tag the address: you just
use an addressing mode with an appropriate offset. Since
most of the time you are accessing fields within a record by such
a mode anyway, it costs nothing, (e.g. to access the "back" of a
pair, the offset is 2 instead of 4). There may be a small cost
associated with accessing the key field (at nominal offset 0), which
now needs an offset of -2, relative to the tagged address. But this
cost will be a small fraction of the cost of de-tagging.

Am I imagining this? Did I see it in the implementation of something
other than Poplog?

Jonathan


-- 
Home: jlc@sofluc.demon.co.uk |
Work: jlc@bmtech.co.uk       |