Fast static analysis of C++ virtual function calls
- 1 October 1996
- journal article
- Published by Association for Computing Machinery (ACM) in ACM SIGPLAN Notices
- Vol. 31 (10) , 324-341
- https://doi.org/10.1145/236338.236371
Abstract
Virtual functions make code easier for programmers to reuse but also make it harder for compilers to analyze. We investigate the ability of three static analysis algorithms to improve C++ programs by resolving virtual function calls, thereby reducing compiled code size and reducing program complexity so as to improve both human and automated program understanding and analysis. In measurements of seven programs of significant size (5000 to 20000 lines of code each) we found that on average the most precise of the three algorithms resolved 71% of the virtual function calls and reduced compiled code size by 25%. This algorithm is very fast: it analyzes 3300 source lines per second on an 80 MHz PowerPC 601. Because of its accuracy and speed, this algorithm is an excellent candidate for inclusion in production C++ compilers.This publication has 13 references indexed in Scilit:
- Slicing class hierarchies in C++Published by Association for Computing Machinery (ACM) ,1996
- Simple and effective analysis of statically-typed object-oriented programsPublished by Association for Computing Machinery (ACM) ,1996
- Type feedback vs. concrete type inferencePublished by Association for Computing Machinery (ACM) ,1995
- Simple and effective link-time optimization of Modula-3 programsPublished by Association for Computing Machinery (ACM) ,1995
- Constraint-based type inference and parametric polymorphismPublished by Springer Nature ,1994
- Interprocedural modification side effect analysis with pointer aliasingPublished by Association for Computing Machinery (ACM) ,1993
- Unreachable procedures in object-oriented programmingACM Letters on Programming Languages and Systems, 1992
- Object, message, and performance: how they coexist in SelfComputer, 1992
- Iterative type analysis and extended message splitting: Optimizing dynamically-typed object-oriented programsHigher-Order and Symbolic Computation, 1991
- An efficient implementation of SELF, a dynamically-typed object-oriented language based on prototypesHigher-Order and Symbolic Computation, 1991