soot.shimple.internal
Class PiNodeManager

java.lang.Object
  extended by soot.shimple.internal.PiNodeManager

public class PiNodeManager
extends Object

This class does the real high-level work. It takes a Jimple body or Jimple/Shimple hybrid body and produces pure Shimple.

The work is done in two main steps:

  1. Trivial Phi nodes are added.
  2. A renaming algorithm is executed.

This class can also translate out of Shimple by producing an equivalent Jimple body with all Phi nodes removed.

Note that this is an internal class, understanding it should not be necessary from a user point-of-view and relying on it directly is not recommended.

Author:
Navindra Umanee
See Also:
ShimpleBody, Efficiently Computing Static Single Assignment Form and the Control Dependence Graph

Field Summary
protected  ShimpleBody body
           
protected  ReversibleGraph cfg
           
protected  DominanceFrontier df
           
protected  DominatorTree dt
           
protected  ShimpleFactory sf
           
protected  boolean trimmed
           
protected  MultiMap varToBlocks
           
 
Constructor Summary
PiNodeManager(ShimpleBody body, boolean trimmed)
          Transforms the provided body to pure SSA form.
 
Method Summary
 void eliminatePiNodes(boolean smart)
           
static List getUseBoxesFromBlock(Block block)
           
 void insertPiNodes(Local local, Block frontierBlock)
           
 boolean insertTrivialPiNodes()
           
 void piHandleIfStmt(Local local, IfStmt u)
           
 void piHandleSwitchStmt(Local local, Unit u)
           
 void update()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

body

protected ShimpleBody body

sf

protected ShimpleFactory sf

dt

protected DominatorTree dt

df

protected DominanceFrontier df

cfg

protected ReversibleGraph cfg

trimmed

protected boolean trimmed

varToBlocks

protected MultiMap varToBlocks
Constructor Detail

PiNodeManager

public PiNodeManager(ShimpleBody body,
                     boolean trimmed)
Transforms the provided body to pure SSA form.

Method Detail

update

public void update()

insertTrivialPiNodes

public boolean insertTrivialPiNodes()

insertPiNodes

public void insertPiNodes(Local local,
                          Block frontierBlock)

piHandleIfStmt

public void piHandleIfStmt(Local local,
                           IfStmt u)

piHandleSwitchStmt

public void piHandleSwitchStmt(Local local,
                               Unit u)

eliminatePiNodes

public void eliminatePiNodes(boolean smart)

getUseBoxesFromBlock

public static List getUseBoxesFromBlock(Block block)