A Simple Approach to Supporting Untagged Objects in Dynamically Typed Languages
Department of Computer Science
University of Arizona
Tucson, AZ 85721, U.S.A.
In many modern high-level programming languages, the exact low-level representation of data objects cannot always be predicted at compile time. Implementations usually get around this problem using descriptors (``tags'') and/or indirect (``boxed'') representations. However, the flexibility so gained can come at the cost of significant performance overheads. The problem is especially acute in dynamically typed languages, where both tagging and boxing are necessary in general. This paper discusses a straightforward approach to using untagged and unboxed values in dynamically typed languages. An implementation of our algorithms allows a dynamically typed language to attain performance close to that of highly optimized C code on a variety of benchmarks (including many floating-point intensive computations) and dramatically reduces heap usage.