soot.jimple.toolkits.scalar.pre
Class BusyCodeMotion

java.lang.Object
  |
  +--soot.Transformer
        |
        +--soot.BodyTransformer
              |
              +--soot.jimple.toolkits.scalar.pre.BusyCodeMotion

public class BusyCodeMotion
extends BodyTransformer

Performs a partial redundancy elimination (= code motion). This is done, by moving everycomputation as high as possible (it is easy to show, that they are computationally optimal), and then replacing the original computation by a reference to this new high computation. This implies, that we introduce many new helper-variables (that can easily be eliminated 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 "busy" refers to the fact, that we always move computations as high as possible. Even, if this is not necessary.

See Also:
CriticalEdgeRemover

Method Summary
 java.lang.String getDeclaredOptions()
           
 java.lang.String getDefaultOptions()
           
protected  void internalTransform(Body b, java.lang.String phaseName, java.util.Map options)
          performs the busy code motion.
static BusyCodeMotion 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
 

Method Detail

v

public static BusyCodeMotion v()

getDeclaredOptions

public java.lang.String getDeclaredOptions()
Overrides:
getDeclaredOptions in class BodyTransformer

getDefaultOptions

public java.lang.String getDefaultOptions()
Overrides:
getDefaultOptions in class BodyTransformer
Returns:
the default options for this transform.

internalTransform

protected void internalTransform(Body b,
                                 java.lang.String phaseName,
                                 java.util.Map options)
performs the busy 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.
options - the actual computed options; a combination of default options and Scene specified options.