soot.jimple.toolkits.pointer
Class StrongLocalMustAliasAnalysis

java.lang.Object
  extended by soot.toolkits.scalar.AbstractFlowAnalysis<N,A>
      extended by soot.toolkits.scalar.FlowAnalysis<N,A>
          extended by soot.toolkits.scalar.ForwardFlowAnalysis<Unit,HashMap<Value,Object>>
              extended by soot.jimple.toolkits.pointer.LocalMustAliasAnalysis
                  extended by soot.jimple.toolkits.pointer.StrongLocalMustAliasAnalysis

public class StrongLocalMustAliasAnalysis
extends LocalMustAliasAnalysis

A special version of the local must-alias analysis that takes redefinitions within loops into account. For variable that is redefined in a loop, the must-alias information is invalidated and set to LocalMustAliasAnalysis.UNKNOWN. E.g. assume the following example: while(..) { c = foo(); //(1) c.doSomething(); //(2) } While it is certainly true that c at (2) must-alias c at (1) (they have the same value number), it is also true that in a second iteration, c at (2) may not alias the previous c at (2).

Author:
Eric Bodden

Field Summary
protected  Set<Integer> invalidInstanceKeys
           
 
Fields inherited from class soot.jimple.toolkits.pointer.LocalMustAliasAnalysis
container, localsAndFieldRefs, mergePointToValueToNumber, nextNumber, NOTHING, rhsToNumber, UNKNOWN, UNKNOWN_LABEL
 
Fields inherited from class soot.toolkits.scalar.FlowAnalysis
filterUnitToAfterFlow, unitToAfterFlow
 
Fields inherited from class soot.toolkits.scalar.AbstractFlowAnalysis
filterUnitToBeforeFlow, graph, unitToBeforeFlow
 
Constructor Summary
StrongLocalMustAliasAnalysis(UnitGraph g)
           
 
Method Summary
 String instanceKeyString(Local l, Stmt s)
          Returns a string (natural number) representation of the instance key associated with l at statement s or null if there is no such key associated or UNKNOWN if the value of l at s is LocalMustAliasAnalysis.UNKNOWN.
 boolean mustAlias(Local l1, Stmt s1, Local l2, Stmt s2)
          
 
Methods inherited from class soot.jimple.toolkits.pointer.LocalMustAliasAnalysis
copy, entryInitialFlow, flowThrough, hasInfoOn, merge, merge, newInitialFlow, parameterRefNumber, thisRefNumber
 
Methods inherited from class soot.toolkits.scalar.ForwardFlowAnalysis
constructWorklist, doAnalysis, isForward
 
Methods inherited from class soot.toolkits.scalar.FlowAnalysis
constructOrderer, getFlowAfter
 
Methods inherited from class soot.toolkits.scalar.AbstractFlowAnalysis
getFlowBefore, mergeInto, treatTrapHandlersAsEntries
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

invalidInstanceKeys

protected Set<Integer> invalidInstanceKeys
Constructor Detail

StrongLocalMustAliasAnalysis

public StrongLocalMustAliasAnalysis(UnitGraph g)
Method Detail

mustAlias

public boolean mustAlias(Local l1,
                         Stmt s1,
                         Local l2,
                         Stmt s2)

Overrides:
mustAlias in class LocalMustAliasAnalysis
Returns:
true if values of l1 (at s1) and l2 (at s2) have the exact same object IDs, i.e. at statement s1 the variable l1 must point to the same object as l2 at s2.

instanceKeyString

public String instanceKeyString(Local l,
                                Stmt s)
Returns a string (natural number) representation of the instance key associated with l at statement s or null if there is no such key associated or UNKNOWN if the value of l at s is LocalMustAliasAnalysis.UNKNOWN.

Overrides:
instanceKeyString in class LocalMustAliasAnalysis
Parameters:
l - any local of the associated method
s - the statement at which to check