Fast static analysis of C++ virtual function calls

被引:143
作者
Bacon, DF
Sweeney, PF
机构
[1] IBM Watson Research Center, Yorktown Heights, NY 10598
关键词
D O I
10.1145/236338.236371
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
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.
引用
收藏
页码:324 / 341
页数:18
相关论文
共 22 条
  • [1] AGESEN O, 1994, P 1 INT STAT AN S BE, P78
  • [2] AGESEN O, 1995, P 10 ANN C OBJ OR PR, P91
  • [3] AIGNER G, 1996, LECT NOTES COMPUTER, V1098, P142
  • [4] BACON DF, 1996, RAPID TYPE ANAL CPLU
  • [5] BURKE M, 1994, LECT NOTES COMPUTER, V892, P234
  • [6] Calder B., 1994, Conference Record of POPL '94: 21st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, P397, DOI 10.1145/174675.177973
  • [7] CARINI PR, 1995, 20267 RC IBM TJ WATS
  • [8] Chambers C., 1991, LISP and Symbolic Computation, V4, P283, DOI 10.1007/BF01806109
  • [9] Chambers C., 1991, LISP and Symbolic Computation, V4, P243, DOI 10.1007/BF01806108
  • [10] Holzle U, 1991, P EUR C OBJ OR PROGR, P21, DOI DOI 10.1007/BFB0057013