Main Page   Packages   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

IndexMaps Class Reference

List of all members.

Public Methods

 IndexMaps (SootMethod sm)
BitSet exitNodes ()
BitSet exitNodesWithoutThrow (BitSet exitNodeSet)
Map getCallSiteMap ()
Map getJumpTargetMap ()
StmtGraph getStmtGraph ()
Map localAssMap ()

Static Public Methods

SootClass lookupSootClassByName (String className)

Public Attributes

ca mcgill sable soot SootMethod sootMethod

Static Protected Attributes

final int ENTRY = -1
final int SPECIALEXIT = -2
final Integer specialExitNode = new Integer(SPECIALEXIT)
final java lang Integer EntryNode = new Integer(ENTRY)

Private Methods

boolean annotationContainsReturn (Annotation ann)
void buildCallSiteMap ()
void buildJumpTargetMap ()
void buildLocalAssIndexMap ()
void collectFieldReferences ()
void collectReturnAnnotations ()
void collectSpecialInvokes ()
BitSet getDefSetFrom (Value basev)
SootMethod getImplementedMd (InvokeExpr invokeExp)
SootMethod getImplementedMd (SootMethod abstractMd)
SootClass getImplementingClassByBOFA (Set impClasses)
InvokeExpr getInvokeExprFrom (Stmt stmt)
SootMethod getInvokeMethodForStart (InvokeExpr invokeExpr, Stmt invokeStmt)
Fields getMOD ()
StmtList getOriginalStmtList ()
Stmt[] getParaIdentityStmts ()
Local[] getParaLocalSet ()
Fields getREF ()
Set getReturnAnnotations ()
InvokeStmt getSpecialInvokeFor (Value base)
InvokeStmt getSpecialInvokeForThread (Value base, Stmt invokeStmt)
List getSpecialInvokeList ()
StmtList getStmtList ()
Local getThisRefLocal ()
Stmt getThisRefStmt ()
Integer getThisRefStmtIndex ()
BitSet indexSetWithoutExceptionHandling ()
boolean isParaField (InstanceFieldRef fieldRef, Stmt stmt)
boolean isParaField (Local baseLocal, Stmt stmt)
SootClass lookupSootClassByThread (NonStaticInvokeExpr startInvoke, Stmt invokeStmt)
void putTargetIntoMap (Stmt target, Stmt source)
List removeExceptionCaught (List actualSuccs)

Private Attributes

Map locAssIndex
JimpleBody jimpleBody
StmtGraph stmtGraph
StmtList stmtList
StmtList originalStmtList
Local paraLocalSet []
Stmt paraIdentityStmt []
Local thisRefLocal = null
Integer thisRefStmtIndex
Stmt thisRefStmt
Map callSiteMap
Fields MOD = new Fields()
Fields REF = new Fields()
List specialInvokeList = new ArrayList()
Map jumpTargetMap = new HashMap()
Set returnAnnotations = new ArraySet()

Detailed Description

This class is for collecting all necessary information for one method.

Definition at line 48 of file IndexMaps.java.


Constructor & Destructor Documentation

IndexMaps::IndexMaps SootMethod   sm [inline]
 

Analyse one method:
buildJumpTargetMap();
buildLocalAssIndexMap();
collectFieldReferences();
collectSpecialInvokes();
buildCallSiteMap().

Definition at line 120 of file IndexMaps.java.


Member Function Documentation

boolean IndexMaps::annotationContainsReturn Annotation   ann [inline, private]
 

Insert the method's description here. Creation date: (00-11-14 14:54:19)

Returns:
boolean
Parameters:
ann   edu.ksu.cis.bandera.annotation.Annotation

Definition at line 147 of file IndexMaps.java.

Referenced by collectReturnAnnotations().

void IndexMaps::buildCallSiteMap   [inline, private]
 

Build call site map into callSiteMap.

Definition at line 158 of file IndexMaps.java.

Referenced by IndexMaps().

void IndexMaps::buildJumpTargetMap   [inline, private]
 

Build a map from jump target to jump sources into jumpTargetMap.

Definition at line 207 of file IndexMaps.java.

Referenced by IndexMaps().

void IndexMaps::buildLocalAssIndexMap   [inline, private]
 

Build local assignments map into locAssIndex;
Fill the array paraLocalSet;
Fill the array paraIdentityStmt.

Definition at line 225 of file IndexMaps.java.

Referenced by IndexMaps().

void IndexMaps::collectFieldReferences   [inline, private]
 

Get MOD/REF information on field references for one method.

Definition at line 270 of file IndexMaps.java.

Referenced by IndexMaps().

void IndexMaps::collectReturnAnnotations   [inline, private]
 

Insert the method's description here. Creation date: (00-11-14 12:55:28)

Definition at line 393 of file IndexMaps.java.

Referenced by IndexMaps().

void IndexMaps::collectSpecialInvokes   [inline, private]
 

Collect all special invoke statement/expression into specialInvokeList.

Definition at line 411 of file IndexMaps.java.

Referenced by IndexMaps().

BitSet IndexMaps::exitNodes   [inline]
 

Get all exit nodes including throw statements in the control flow graph of the method.

Definition at line 437 of file IndexMaps.java.

Referenced by SlicingMethod::generateNewCriterion(), SlicingMethod::mdCallsInSlice(), and BuildPDG::prepareToBuild().

BitSet IndexMaps::exitNodesWithoutThrow BitSet   exitNodeSet [inline]
 

Exclude all throw statements in the exit nodes set.

Parameters:
exitNodeSet   a set of all exit nodes.
Returns:
a set of exit nodes without throws.

Definition at line 472 of file IndexMaps.java.

Referenced by SlicingMethod::generateNewCriterion(), SlicingMethod::mdCallsInSlice(), and BuildPDG::prepareToBuild().

Map IndexMaps::getCallSiteMap   [inline]
 

Get call site map.

Returns:
callSiteMap.

Definition at line 489 of file IndexMaps.java.

Referenced by SlicingMethod::ctrlRelVarCompute(), SlicingMethod::dataRelVarCompute(), BuildPDG::prepareToBuild(), SlicingMethod::slicingMethod(), and SlicingMethod::slicingMethodAgain().

BitSet IndexMaps::getDefSetFrom Value   basev [inline, private]
 

Get all assignments to a variable.

Parameters:
basev   query variable.
Returns:
a set of assignments defining values to basev.

Definition at line 499 of file IndexMaps.java.

Referenced by getSpecialInvokeForThread().

SootMethod IndexMaps::getImplementedMd SootMethod   abstractMd [inline, private]
 

Get the method that implements a given abstract method.

Returns:
the implementing method.
Parameters:
abstractMd   abstract method.

Definition at line 533 of file IndexMaps.java.

SootMethod IndexMaps::getImplementedMd InvokeExpr   invokeExp [inline, private]
 

Get the method that a invoke expression invokes: especially useful for methods rewrited in subclass or declared in an interface.

Returns:
the method invoked
Parameters:
invokeExp   invoke expression

Definition at line 517 of file IndexMaps.java.

Referenced by buildCallSiteMap().

SootClass IndexMaps::getImplementingClassByBOFA Set   impClasses [inline, private]
 

A temporary interface with BOFA.

Returns:
one class that implements the interface at current point.
Parameters:
impClasses   a set of classes that implements the same one interface.

Definition at line 548 of file IndexMaps.java.

Referenced by getImplementedMd().

InvokeExpr IndexMaps::getInvokeExprFrom Stmt   stmt [inline, private]
 

From all used value in one statement, extract one invoke expression, if any.
Suppose there is at most one invoke expression in one statement.

Returns:
an invoke expression in the statement.
Parameters:
stmt   query statement.

Definition at line 563 of file IndexMaps.java.

Referenced by buildCallSiteMap().

SootMethod IndexMaps::getInvokeMethodForStart InvokeExpr   invokeExpr,
Stmt   invokeStmt
[inline, private]
 

Get invoke method for start.
For example, a.start(); is actually calling run method in the class of a --- A, where A is subclass of java.lang.Thread or an implementation of java.lang.Runnable.
Special attention is going to the case such that
Thread T1;
T1 = new Thread(new CThread(...), ...);
... ...
T1.start();
In this case, T1's is java.lang.Thread. But in T1.start(), we should determine that T1's should be CThread which should be a subclass of java.lang.Thread, although T1 is declared as type of Thread.
The method (NonStaticInvokeExpr, Stmt) lookupSootClassByThread() is looking for type of T1 in this case.

Parameters:
invokeExpr   invoke expression calling start.
invokeStmt   invoke statement which involves invokeExpr.
Returns:
corresponding run method in an appropriate class. Null is returned if there is no such method is found.
Exceptions:
SlicerException   if the type of base value for an invoke expression is not a reference type.

Definition at line 600 of file IndexMaps.java.

Referenced by buildCallSiteMap().

Map IndexMaps::getJumpTargetMap   [inline]
 

Get jump target map.

Returns:
jumpTargetMap.

Definition at line 646 of file IndexMaps.java.

Referenced by PostProcess::residualParameters().

Fields IndexMaps::getMOD   [inline, private]
 

Get MOD information of this method.

Returns:
MOD.

Definition at line 655 of file IndexMaps.java.

Referenced by InfoAnalysis::InfoAnalysis().

StmtList IndexMaps::getOriginalStmtList   [inline, private]
 

Get original statement list before slicing.

Returns:
originalStmtList.

Definition at line 664 of file IndexMaps.java.

Referenced by InfoAnalysis::InfoAnalysis().

Stmt [] IndexMaps::getParaIdentityStmts   [inline, private]
 

Get the array of parameter identity statements.

Returns:
paraIdentityStmt.

Definition at line 672 of file IndexMaps.java.

Referenced by PostProcessOnAnnotation::makeMethodEmpty(), and PostProcess::makeMethodEmpty().

Local [] IndexMaps::getParaLocalSet   [inline, private]
 

Get the set of parameter locals.

Returns:
paraLocalSet.

Definition at line 681 of file IndexMaps.java.

Referenced by SlicingMethod::oneParaFdIsRelevant().

Fields IndexMaps::getREF   [inline, private]
 

Get REF information of the method.

Returns:
REF.

Definition at line 690 of file IndexMaps.java.

Referenced by InfoAnalysis::InfoAnalysis().

Set IndexMaps::getReturnAnnotations   [inline, private]
 

Insert the method's description here. Creation date: (00-11-14 13:06:01)

Returns:
ca.mcgill.sable.util.Set

Definition at line 699 of file IndexMaps.java.

Referenced by PostProcessOnAnnotation::makeMethodEmpty(), and PostProcess::makeMethodEmpty().

InvokeStmt IndexMaps::getSpecialInvokeFor Value   base [inline, private]
 

Get special invoke statement such that of with the same given base value and invoke the mehtod java.lang.Thread.init, i.e., the special invoke statement such that
specialinvoke base.[java.lang.Thread.init():void]();

Returns:
a special invoke statement. Null is returned if there is no such statement.

Definition at line 710 of file IndexMaps.java.

Referenced by getSpecialInvokeForThread().

InvokeStmt IndexMaps::getSpecialInvokeForThread Value   base,
Stmt   invokeStmt
[inline, private]
 

Get special invoke statement for a start invoke in the case such that
Thread T1;
T1 = new Thread(new CThread(...), ...);
... ...
T1.start();
This method is to get invoke statement for T1, which is T1 = new Thread(new CThread(...), ...); .
The idea is:
(1) Get all definitions of T1 before the given invoke statement.
(2) From those definitons of T1, extract one special invoke statement which satisfies the constrains given by base and invokeStmt.

Parameters:
base   the base value of the invokeStmt, e.g., T1.
invokeStmt   invoke statement for start(), e.g., T1.start();.
Returns:
a special invoke statement that assigns value to base, e.g., T1 = new Thread(new CThread(...), ...); .

Definition at line 741 of file IndexMaps.java.

Referenced by lookupSootClassByThread().

List IndexMaps::getSpecialInvokeList   [inline, private]
 

Get special invoke statement list.

Returns:
specialInvokeList.

Definition at line 793 of file IndexMaps.java.

Referenced by SlicingMethod::genNewCritForExit().

StmtGraph IndexMaps::getStmtGraph   [inline]
 

Get statement graph provided by Jimple.

Returns:
stmtGraph

Definition at line 802 of file IndexMaps.java.

StmtList IndexMaps::getStmtList   [inline, private]
 

Get statement list.

Returns:
stmtList.

Definition at line 811 of file IndexMaps.java.

Referenced by InfoAnalysis::InfoAnalysis().

Local IndexMaps::getThisRefLocal   [inline, private]
 

Get this reference local.

Returns:
thisRefLocal.

Definition at line 819 of file IndexMaps.java.

Referenced by SlicingMethod::genNewCritForExit().

Stmt IndexMaps::getThisRefStmt   [inline, private]
 

Get the index of this reference statement.

Returns:
thisRefStmtIndex

Definition at line 828 of file IndexMaps.java.

Integer IndexMaps::getThisRefStmtIndex   [inline, private]
 

Get the index of this reference statement.

Returns:
thisRefStmtIndex

Definition at line 836 of file IndexMaps.java.

Referenced by PostProcessOnAnnotation::makeMethodEmpty(), and PostProcess::makeMethodEmpty().

BitSet IndexMaps::indexSetWithoutExceptionHandling   [inline, private]
 

Get all statements exception those for exception handling.
Since we are not dealing with anything about exception handling, in some cases, we need to exclude those statements in exception handling block.

Returns:
a set of statement without those of exception handling.

Definition at line 847 of file IndexMaps.java.

boolean IndexMaps::isParaField InstanceFieldRef   fieldRef,
Stmt   stmt
[inline, private]
 

See if an instance field reference is based on parameter. This method will call the other overloaded method isParaField().
For example,
void md(A paraA, ...){
....;
x = paraA.fd+1;
...;
paraA.fd is a parameter field since the base value paraA is from parameter.

Parameters:
fieldRef   query instance field reference.
stmt   statement that use the reference.
Returns:
true if fieldRef is parameter field; false otherwise.
Exceptions:
BaseValueNonLocalException   if the base value is not local variable.

Definition at line 891 of file IndexMaps.java.

Referenced by collectFieldReferences().

Map IndexMaps::localAssMap   [inline]
 

Get the map from local to assignments.

Returns:
locAssIndex.

Definition at line 929 of file IndexMaps.java.

Referenced by MethodCallAnalysis::assignmentByMdCall(), SlicingMethod::generateNewCriterion(), and SlicingMethod::slicingMethod().

SootClass IndexMaps::lookupSootClassByName String   className [inline, static]
 

Look up sootclass by a given class name through Slicer.relevantClassArray.

Parameters:
className   query class name.
Returns:
a sootclass with the name className.
Exceptions:
SlicerException   if can not find the sootclass with name className.

Definition at line 942 of file IndexMaps.java.

Referenced by getInvokeMethodForStart(), and lookupSootClassByThread().

SootClass IndexMaps::lookupSootClassByThread NonStaticInvokeExpr   startInvoke,
Stmt   invokeStmt
[inline, private]
 

Get the type of a thread for the case such that
Thread T1;
T1 = new Thread(new CThread(...), ...);
... ...
T1.start();
In this case, T1's is java.lang.Thread. But in T1.start(), we should determine that T1's should be CThread which should be a subclass of java.lang.Thread, although T1 is declared as type of Thread.
The basic idea of this method is
(1) Get special invoke statement such that T1 = new Thread(new CThread(...), ...); from T1 by getSpecialInvokeForThread().
(2) Analyse the arguments of the special invoke statement to recognize one argument of it whose type is a reference type (e.g., CThread) and a subclass of java.lang.Thread or an implementing class of java.lang.Runnable.

Parameters:
startInvoke   the invoke expression which inovkes start(), e.g., T1.start().
invokeStmt   the invoke statement which invokes start(), e.g., T1.start().
Returns:
a soot class which is the thread type of T1, e.g., CThread. Null is returned is there is no such soot class can be found.
Exceptions:
SlicerExeption   if can not find the soot class by allocator.

Definition at line 978 of file IndexMaps.java.

Referenced by getInvokeMethodForStart().

void IndexMaps::putTargetIntoMap Stmt   target,
Stmt   source
[inline, private]
 

Put given jump target and source into the jump target map jumpTargetMap.

Parameters:
target   jump target statement.
source   jump source statement.

Definition at line 1037 of file IndexMaps.java.

Referenced by buildJumpTargetMap().

List IndexMaps::removeExceptionCaught List   actualSuccs [inline, private]
 

Remove exception caught statement from a list of statement.

Parameters:
actualSuccs   a list of Stmt.
Returns:
a list of Stmt without any statement for exception handling.

Definition at line 1053 of file IndexMaps.java.

Referenced by indexSetWithoutExceptionHandling().


Member Data Documentation

Map IndexMaps::callSiteMap [private]
 

a map from CallSite to SootMethod where SootMethod is called in the CallSite.

Definition at line 93 of file IndexMaps.java.

Map IndexMaps::jumpTargetMap = new HashMap() [private]
 

a map from Stmt to BitSet representing a set of (control flow transfer) statements from which they can goto the key statement of the map.

Definition at line 105 of file IndexMaps.java.

Map IndexMaps::locAssIndex [private]
 

a map from Value to BitSet representing all assignments for one local.

Definition at line 52 of file IndexMaps.java.

StmtList IndexMaps::originalStmtList [private]
 

StmtList before slicing, since slicing will change the contents of stmtList.

Definition at line 59 of file IndexMaps.java.

Stmt IndexMaps::paraIdentityStmt[] [private]
 

an array of parameter identity statements.
The index of the array is the index of parameters.
For example,
m:=

a0; </code>

n:=
a1; </code>

will make paraIdentityStmt = {m:=
a0,n:=@para1}</code>.

Definition at line 76 of file IndexMaps.java.

Local IndexMaps::paraLocalSet[] [private]
 

an array of all locals assigned value by parameters identity statements.
The index of the array is the index of parameters.
For example,
m:=

a0; </code>

n:=
a1; </code>

will make paraLocalSet = {m,n}.

Definition at line 68 of file IndexMaps.java.

List IndexMaps::specialInvokeList = new ArrayList() [private]
 

a list of SpecialInvokeStmt.

Definition at line 99 of file IndexMaps.java.

Local IndexMaps::thisRefLocal = null [private]
 

local variable for this reference.
For example,
JJJCTEMP$0:=@this;
will make thisRefLocal be JJJCTEMP$0.

Definition at line 83 of file IndexMaps.java.

Integer IndexMaps::thisRefStmtIndex [private]
 

statement index of this reference statement.

Definition at line 87 of file IndexMaps.java.


The documentation for this class was generated from the following file:
Generated at Thu Feb 7 07:13:39 2002 for Bandera by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001