Portable run-time type description for conventional compilers

Citation
Sv. Kakkad et al., Portable run-time type description for conventional compilers, ACM SIGPL N, 34(3), 1999, pp. 146-153
Citations number
19
Categorie Soggetti
Computer Science & Engineering
Journal title
ACM SIGPLAN NOTICES
ISSN journal
15232867 → ACNP
Volume
34
Issue
3
Year of publication
1999
Pages
146 - 153
Database
ISI
SICI code
1523-2867(199903)34:3<146:PRTDFC>2.0.ZU;2-Q
Abstract
Many useful programming language extensions and system support libraries re quire knowledge of the locations of fields within objects at run time. Exam ples include orthogonal persistent object stores, precise garbage collector s, data structure picklers, and parameter marshaling schemes. For clean and efficient implementation as libraries, these systems require run-time knowledge of in-memory layouts of data objects, which is unavailab le in most traditionally compiled and linked programming languages, such as C, C++, and,Ada. Even the recently standardized nm-time type identificatio n (RTTI) feature in C++ is insufficient, because it describes only language -level features of the type hierarchy and not the compiler-dependent object layout decisions. We present a facility for run-time type description, or RTTD, which extract s low-level layout information from debugging information generated by conv entional compilers, and makes it available to user programs. We believe thi s to be the simplest and most portable approach to run-time type descriptio n, requiring no changes to existing compilers. In this paper, we describe t he basic strategies and present details of our implementation for C++. We a lso sketch some extensions that we have implemented, including special trea tment of C++'s virtual function table pointers to match persistent or forei gn data objects with the actual code in a particular application. Our implementation of run-time type description is freely available. It is in regular use with multiple operating systems and compilers, in both free and commercial products, including a highperformance persistent object stor age system for C++ and a realtime garbage collector.