harpoon.Analysis.Quads.DeepInliner
Class OneLevelInliner
java.lang.Object
harpoon.Analysis.Quads.DeepInliner.OneLevelInliner
public class OneLevelInliner
- extends Object
OneLevelInliner contains the code that inlines a single
CALL instruction. This class is used by
DeepInliner, but can also be used separately, for
inlining call paths of length 1.
To perform inlining, use the static method
OneLevelInliner.inline.
- Version:
- $Id: OneLevelInliner.java,v 1.1 2005/08/09 22:40:35 salcianu Exp $
- Author:
- Alexandru Salcianu <salcianu@alum.mit.edu>
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
inline
public static Map<Quad,Quad> inline(CALL cs,
HMethod callee,
CachingCodeFactory ccf)
- Parameters:
cs - The call instruction to be inlined.callee - The callee whose body should replace
cs. In case of a virtual call with a single
possible callee, this callee is not obvious from the structure
of the call (it may require a full-program call graph).
Therefore, we require that the callee is passed explicitly.ccf - The caching code factory that generates the code
for callee and for the caller of
callee (the method that cs belongs
to). We perform the inlining by mutating the cached code for
the caller. Must produce QuadNoSSA or
QuadRSSx IR (otehr IRs are too complex to
generate code for).
- Returns:
- A map that assigns to each quad from the code of
callee (as provided by ccf), the
corresponding quad from the copy of callee's body
that replaces cs.