This paper discusses call forwarding, a simple interprocedural optimization technique for dynamically typed languages. The basic idea behind the optimization is straightforward: nd an ordering for the \entry actions" of a procedure, and generate multiple entry points for the procedure, so as to maximize the savings realized from di erent call sites bypassing di erent sets of entry actions. We show that the problem of computing optimal solutions to arbitrary call forwarding problems is NP-complete, and describe an e cient greedy algorithm for the problem. Experimental results indicate that (i) this algorithm is e ective, in that the solutions produced are generally close to optimal; and (ii) the resulting optimization leads to signi cant performance improvements for a number of benchmarks tested.
Koenraad De Bosschere, Saumya K. Debray, David Gud