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 条
  • [11] LAZY EVALUATION OF C++ STATIC CONSTRUCTORS
    SABATELLA, M
    SIGPLAN NOTICES, 1992, 27 (06): : 29 - 36
  • [12] C++: function adaptors
    Koenig, Andrew
    Journal of Object-Oriented Programming, 1996, 8 (08):
  • [13] TIME-INVARIANT VIRTUAL MEMBER FUNCTION DISPATCHING FOR C++ EVOLVABLE CLASSES
    VOSS, R
    JOURNAL OF OBJECT-ORIENTED PROGRAMMING, 1994, 7 (07): : 23 - 33
  • [14] Orion: High-precision methods for static error analysis of C and C++ programs
    Dams, Dennis R.
    Namjoshi, Kedar S.
    FORMAL METHODS FOR COMPONENTS AND OBJECTS, 2006, 4111 : 138 - 160
  • [15] Global and Local Virtual Functions in C++
    Heinlein, Christian
    JOURNAL OF OBJECT TECHNOLOGY, 2005, 4 (10):
  • [16] Static analysis of function calls in Erlang Refining the static function call graph with dynamic call information by using data-flow analysis
    Horpacsi, Daniel
    Koszegi, Judit
    E-INFORMATICA SOFTWARE ENGINEERING JOURNAL, 2013, 7 (01) : 65 - 76
  • [17] Client/server C++: Write fast, run fast
    Grehan, R
    BYTE, 1997, 22 (03): : 139 - &
  • [18] Exceptions in remote procedure calls using C++ template metaprogramming
    Rintala, Matti
    SOFTWARE-PRACTICE & EXPERIENCE, 2007, 37 (03): : 231 - 246
  • [19] vfGuard: Strict Protection for Virtual Function Calls in COTS C plus plus Binaries
    Prakash, Aravind
    Hu, Xunchao
    Yin, Heng
    22ND ANNUAL NETWORK AND DISTRIBUTED SYSTEM SECURITY SYMPOSIUM (NDSS 2015), 2015,
  • [20] Study of State-of-the-art Open-source C/C++ Static Analysis Tools
    Li G.-W.
    Yuan T.
    Li L.
    Ruan Jian Xue Bao/Journal of Software, 2022, 33 (06): : 2061 - 2081