| | |
Summary: Andrew W. Appel 3
Princeton University
CSTR14288
March 1988
Abstract
Many modern programming environments use tag bits at runtime to
distinguish objects of different types. This is particularly common in sys
tems with garbage collection, since the garbage collector must be able to
distinguish pointers from nonpointers, and to learn the length of records
pointed to.
The use of tag bits leads to inefficiency. In addition to the obvious
space overhead (tag bits and record descriptors occupy memory space),
there is a time overhead: tag bits must be stripped off of data before
arithmetic operations are performed, and reattached to the data when it
is stored into memory. This takes either extra instructions at runtime, or
special taghandling hardware, or both.
This paper shows how the use of tag bits, record descriptor words,
explicit type parameters, and the like can be avoided in languages (like
ML) with static polymorphic typechecking. Though a form of tag will still
be required for userdefined variant records, all other type information can
|