Data-flow-based virtual function resolution
Determining the type of an object to which a receiver may point at a virtual call site is crucial for compile time virtual function resolution in C++ programs. We show the close interdependence of type determination and pointer-induced aliasing in C++ and present the first data-flow-based algorithm to solve these problems simultaneously. Our polynomial-time approximation method incorporates information about program flow. Initial experiences with our prototype implementation have shown our technique to be more effective than others that use only inheritance hierarchy information. We present initial empirical results demonstrating the precision of our approach and state the intrinsic difficulty (i.e., NP-hardness) of the type determination problem for programming languages with general-purpose pointers and dynamic binding.
KeywordsType Determination Program Point Dynamic Binding Call Site Exit Node
Unable to display preview. Download preview PDF.
- [CG94]B. Calder and D. Grunwald. Reducing indirect function call overhead in C++ programs. In Conference Record of the Twenty-first Annual ACM Symposium on Principles of Programming Languages, pages 397–408, January 1994.Google Scholar
- [CGZ95]B. Calder, D. Grunwald, and B. Zorn. Quantifying behavioural differences between C and C++ programs. Journal of Programming Languages, 2:313–351, 1995.Google Scholar
- [LR91]W. Landi and B. G. Ryder. Pointer-induced aliasing: A problem classification. In Conference Record of the Eighteenth Annual ACM Symposium on Principles of Programming Languages, pages 93–103, January 1991.Google Scholar
- [LR92]W. Landi and B. G. Ryder. A safe approximation algorithm for interprocedural pointer aliasing. In Proceedings of the SIGPLAN '92 Conference on Programming Language Design and Implementation, pages 235–248, June 1992.Google Scholar
- [Pan96]H. Pande. Compile Time Analysis of C and C ++ Systems. PhD thesis, Rutgers University, May 1996.Google Scholar
- [PR94a]H. Pande and B. G. Ryder. Static type determination for C++. In Proceedings of the Sixth USENIX C ++ Technical Conference, pages 85–97, April 1994.Google Scholar
- [PR94b]H. D. Pande and B. G. Ryder. Static type determination and aliasing for C++. Laboratory for Computer Science Research Technical Report LCSRTR-236, Rutgers University, December 1994.Google Scholar
- [RHS95]T. Reps, S. Horwitz, and M. Sagiv. Precise interprocedural dataflow analysis via graph reachability. In Conference Record of the Twenty-second Annual ACM Symposium on Principles of Programming Languages, pages 49–61, January 1995.Google Scholar
- [SP81]M. Sharir and A. Pnueli. Two approaches to interprocedural data flow analysis. In S. Muchnick and N. Jones, editors, Program Flow Analysis: Theory and Applications, pages 189–234. Prentice Hall, 1981.Google Scholar