soot.jimple.toolkits.scalar
Class CommonSubexpressionEliminator

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

public class CommonSubexpressionEliminator
extends BodyTransformer

Runs an available expressions analysis on a body, then eliminates common subexpressions. This implementation is especially slow, as it does not run on basic blocks. A better implementation (which wouldn't catch every single cse, but would get most) would use basic blocks instead. It is also slow because the flow universe is explicitly created; it need not be. A better implementation would implicitly compute the kill sets at every node.


Field Summary
static int cseCounter
           
 
Method Summary
 java.lang.String getDeclaredOptions()
           
 java.lang.String getDefaultOptions()
           
protected  void internalTransform(Body b, java.lang.String phaseName, java.util.Map options)
          Common subexpression eliminator.
static CommonSubexpressionEliminator 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
 

Field Detail

cseCounter

public static int cseCounter
Method Detail

v

public static CommonSubexpressionEliminator v()

getDeclaredOptions

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

getDefaultOptions

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

internalTransform

protected void internalTransform(Body b,
                                 java.lang.String phaseName,
                                 java.util.Map options)
Common subexpression eliminator.
Overrides:
internalTransform in class BodyTransformer
Tags copied from 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.