soot.jimple.toolkits.scalar.pre
Class LazyCodeMotion

java.lang.Object
  extended by soot.Transformer
      extended by soot.BodyTransformer
          extended by soot.jimple.toolkits.scalar.pre.LazyCodeMotion

public class LazyCodeMotion
extends BodyTransformer

Performs a partial redundancy elimination (= code motion). This is done, by introducing helper-vars, that store an already computed value, or if a compuation only arrives partially (not from all predecessors) inserts a new computation on these paths afterwards).

In order to catch every redundant expression, this transformation must be done on a graph without critical edges. Therefore the first thing we do, is removing them. A subsequent pass can then easily remove the synthetic nodes we have introduced.

The term "lazy" refers to the fact, that we move computations only if necessary.

See Also:
CriticalEdgeRemover

Constructor Summary
LazyCodeMotion(Singletons.Global g)
           
 
Method Summary
protected  void internalTransform(Body b, String phaseName, Map opts)
          performs the lazy code motion.
static LazyCodeMotion v()
           
 
Methods inherited from class soot.BodyTransformer
transform, transform, transform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LazyCodeMotion

public LazyCodeMotion(Singletons.Global g)
Method Detail

v

public static LazyCodeMotion v()

internalTransform

protected void internalTransform(Body b,
                                 String phaseName,
                                 Map opts)
performs the lazy code motion.

Specified by:
internalTransform in class BodyTransformer
Parameters:
b - the body on which to apply the transformation
phaseName - the phasename for this transform; not typically used by implementations.
opts - the actual computed options; a combination of default options and Scene specified options.