soot.jimple.toolkits.pointer
Class CastCheckEliminator

java.lang.Object
  |
  +--soot.toolkits.scalar.AbstractFlowAnalysis
        |
        +--soot.toolkits.scalar.BranchedFlowAnalysis
              |
              +--soot.toolkits.scalar.ForwardBranchedFlowAnalysis
                    |
                    +--soot.jimple.toolkits.pointer.CastCheckEliminator

public class CastCheckEliminator
extends ForwardBranchedFlowAnalysis

A flow analysis that detects redundant cast checks.


Fields inherited from class soot.toolkits.scalar.BranchedFlowAnalysis
unitToAfterBranchFlow, unitToAfterFallFlow
 
Fields inherited from class soot.toolkits.scalar.AbstractFlowAnalysis
graph, unitToBeforeFlow
 
Constructor Summary
CastCheckEliminator(BriefUnitGraph cfg)
           
 
Method Summary
protected  void copy(java.lang.Object source, java.lang.Object dest)
          Creates a copy of the source flow object in dest.
protected  java.lang.Object entryInitialFlow()
          Returns a new, aggressive (local,type) set.
protected  void flowThrough(java.lang.Object inValue, Unit unit, java.util.List outFallValues, java.util.List outBranchValues)
          This is the flow function as described in the assignment write-up.
protected  void makeInitialSet()
          Find all the locals of reference type and all the types used in casts to initialize the mapping from locals and types to bits in the bit vector in LocalTypeSet.
protected  void merge(java.lang.Object in1, java.lang.Object in2, java.lang.Object out)
          Compute the merge of the in1 and in2 sets, putting the result into out.
protected  java.lang.Object newInitialFlow()
          Returns a new, aggressive (local,type) set.
protected  void tagCasts()
          Put the results of the analysis into tags in cast statements.
 
Methods inherited from class soot.toolkits.scalar.ForwardBranchedFlowAnalysis
doAnalysis, isForward
 
Methods inherited from class soot.toolkits.scalar.BranchedFlowAnalysis
getBranchFlowAfter, getFallFlowAfter, getFlowBefore
 
Methods inherited from class soot.toolkits.scalar.AbstractFlowAnalysis
customizeInitialFlowGraph, getFlowBefore, treatTrapHandlersAsEntries
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CastCheckEliminator

public CastCheckEliminator(BriefUnitGraph cfg)
Method Detail

tagCasts

protected void tagCasts()
Put the results of the analysis into tags in cast statements.

makeInitialSet

protected void makeInitialSet()
Find all the locals of reference type and all the types used in casts to initialize the mapping from locals and types to bits in the bit vector in LocalTypeSet.

newInitialFlow

protected java.lang.Object newInitialFlow()
Returns a new, aggressive (local,type) set.
Overrides:
newInitialFlow in class AbstractFlowAnalysis

flowThrough

protected void flowThrough(java.lang.Object inValue,
                           Unit unit,
                           java.util.List outFallValues,
                           java.util.List outBranchValues)
This is the flow function as described in the assignment write-up.
Overrides:
flowThrough in class BranchedFlowAnalysis

copy

protected void copy(java.lang.Object source,
                    java.lang.Object dest)
Description copied from class: AbstractFlowAnalysis
Creates a copy of the source flow object in dest.
Overrides:
copy in class AbstractFlowAnalysis

merge

protected void merge(java.lang.Object in1,
                     java.lang.Object in2,
                     java.lang.Object out)
Description copied from class: AbstractFlowAnalysis
Compute the merge of the in1 and in2 sets, putting the result into out. The behavior of this function depends on the implementation ( it may be necessary to check whether in1 and in2 are equal or aliased ). Used by the doAnalysis method.
Overrides:
merge in class AbstractFlowAnalysis

entryInitialFlow

protected java.lang.Object entryInitialFlow()
Returns a new, aggressive (local,type) set.
Overrides:
entryInitialFlow in class AbstractFlowAnalysis