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
相关论文
共 50 条
  • [1] The direct cost of virtual function calls in C++
    Driesen, K
    Holzle, U
    ACM SIGPLAN NOTICES, 1996, 31 (10) : 306 - 323
  • [2] Compiler optimization of C++ virtual function calls
    Porat, S
    Bernstein, D
    Fedorov, Y
    Rodrigue, J
    Yahav, E
    PROCEEDINGS OF THE SECOND USENIX CONFERENCE ON OBJECT-ORIENTED TECHNOLOGIES AND SYSTEMS (COOTS), 1996, : 3 - 14
  • [3] Static analysis of C/C++ program for safety
    Software Engineering Inst., Xidian Univ., Xi'an 710071, China
    Xi Tong Cheng Yu Dian Zi Ji Shu/Syst Eng Electron, 2008, 6 (1155-1158):
  • [4] FULLY STATIC DIMENSIONAL ANALYSIS WITH C++
    UMRIGAR, ZD
    SIGPLAN NOTICES, 1994, 29 (09): : 135 - 139
  • [5] Fast analysis of source code in C and C++
    V. O. Savitskii
    D. V. Sidorov
    Programming and Computer Software, 2013, 39 : 49 - 55
  • [6] Static Analysis of dlsym-like Function Calls
    Kudryashov, Evgeny
    2018 IVANNIKOV MEMORIAL WORKSHOP (IVMEM 2018), 2018, : 15 - 18
  • [7] A static analysis method for safe comparison functors in C++
    Babati, Bence
    Pataki, Norbert
    ANNALES MATHEMATICAE ET INFORMATICAE, 2020, 52 : 5 - 18
  • [8] Research on method of static analysis for safety of C++ program
    Lai, Xiaochen
    Wang, Xiaoliang
    Zhou, Kuanjiu
    Yao, Yanshuang
    Tang, Lemin
    Li, Likun
    International Journal of Advancements in Computing Technology, 2012, 4 (21) : 337 - 345
  • [9] Static and dynamic C++ code analysis for the recovery of the object diagram
    Tonella, P
    Potrich, A
    INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE, PROCEEDINGS, 2002, : 54 - 63
  • [10] Static Analysis for Ada, C/C++ and Python: Different Languages, Different Needs
    Martignano M.
    Ada User Journal, 2021, 41 (02): : 199 - 202