harpoon.Analysis.Quads.DeepInliner
Class DeepInliner

java.lang.Object
  extended by harpoon.Analysis.Quads.DeepInliner.DeepInliner

public class DeepInliner
extends Object

DeepInliner contains the code responsible with inlining a set of InlineChains. Each InlineChain corresponds to a chain of several calls (simple inlining, when we inline call paths of length one, is a trivial special case). Clients of this class should invoke the static method DeepInliner.inline

The inlining is performed eagerly, by mutating the code of the affected methods, as cached by the CachingCodeFactory that is passed as the first argument of inline. The alternative would be to construct an HCodeFactory that generates the code of the affected methods on demand; however, the complications of inlining multiple InlineChains forces us to perform the inlining eagerly.

Among these complications, we mention the desire to inline the "best version" of a callee, i.e., the code of the callee after the callee-relevant inlining has already been performed. Hence, the order in which we process the inline chains is not irrelevant. Also, the implementation is careful to act efficiently if several calling chains contain the same call.

Version:
$Id: DeepInliner.java,v 1.2 2005/12/01 07:54:08 salcianu Exp $
Author:
Alexandru Salcianu <salcianu@alum.mit.edu>
See Also:
InlineChain

Method Summary
static void inline(CachingCodeFactory ccf, Collection<InlineChain> ics, CallGraph cg)
          Inline a set of InlineChains.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

inline

public static void inline(CachingCodeFactory ccf,
                          Collection<InlineChain> ics,
                          CallGraph cg)
Inline a set of InlineChains.

Parameters:
ccf - Caching code factory. Must produce either RSSx or QuadNoSSA (the code is simply too hard to generate for other intermediate representations, like SSA and SSI).
ics - Collection of desired InlineChain.
cg - Call-graph. DOES NOT need to be a whole-program call graph: it just needs to give us the callees for all the call sites involved in the inline chains from cs.
See Also:
InlineChain