Run-time code generation (RTCG) enables program optimizations specific to values that are unknown until run time and improves the performance. This paper shows that object-oriented languages allow RTCG from a simple analysis of source programs. It also proposes an automatic, safe, and efficnet RTCG system implemented as a preprocessor of a C++ compiler. It can inline virtual member functions combined with other optimizations. Increases in speed have ranged from 1.2 to 2.3 times.
展开▼