Sciweavers

SAC
1996
ACM

An enabling optimization for C++ virtual functions

14 years 4 months ago
An enabling optimization for C++ virtual functions
Gaining the code re-use advantages of object oriented programming requires dynamic function binding, which allows a new subclass to override a function of a superclass. Dynamic binding is obtained in C++ through the use of virtual functions. Unfortunately, virtual functions have two negative impacts on performance. First, they are traditionally compiled into indirect call instructions, which take longer to execute than direct call instructions. Second, it is difficult for the compiler to perform optimization since summary information from called procedures is hard or even impossible to obtain. The net effect is that C++ programmers avoid the use of virtual functions. We present a new optimization that (1) removes the indirect function calls used for virtual functions, (2) enables other compiler optimizations such as inlining and constant propagation, and (3) requires no extensive dataflow analysis or profile information and thus is easily implemented in an existing compiler. We includ...
Bradley M. Kuhn, David Binkley
Added 08 Aug 2010
Updated 08 Aug 2010
Type Conference
Year 1996
Where SAC
Authors Bradley M. Kuhn, David Binkley
Comments (0)