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

PostProcess Class Reference

List of all members.

Public Methods

 PostProcess (List ct, AnnotationManager cfs)
void resClassCons ()

Private Methods

void addCatchesToRemovedSet (Set removedSet, Vector catches, StmtList stmtList, Set linePropList, BitSet slcSet)
void addCatchesToSliceSet (BitSet slcSet, Vector catches, StmtList stmtList)
InvokeExpr buildNewInvokeExpr (InvokeExpr invokeExpr)
void callSiteInSlice (Map callSiteIndexMap, Map callSiteMap, Stmt stmt)
void changeTarget (StmtList stmtList, Stmt newTarget, Stmt oldTarget, Map jumpTargetMap)
boolean emptyBody (Stmt[] bodyStmts, BitSet sliceSet, StmtList stmtList)
boolean emptyBody (Set bodyStmts, BitSet sliceSet, StmtList stmtList)
Set fieldRefToField (Set fieldRefSet)
void filterOutFields (Set variableSet)
Set getAllVarsOf (MethodInfo mdInfo)
LinkedList getKeepedParaOriginalIndex (MethodInfo mdInfo)
int getNewJumpTarget (int currentTarget, BuildPDG bpdg, BitSet rmStmtSet)
Set getTrapHandlers (JimpleBody jimpBody)
boolean isImplementingOneAbstractMd (SootClass superClass, SootMethod sm)
boolean isImplementingOneAbstractMd (SootMethod sm)
boolean isImplementingOneInterfaceMd (SootClass interfaceClass, SootMethod sm)
boolean isPublicAndStatic (int modifier)
void keepParasOfMainMd (MethodInfo mdInfo, Map relevantVars, StmtList stmtList, BitSet sliceSet)
void makeMethodEmpty (MethodInfo methodInfo, Annotation annForSm)
void modifyJumpTargetMap (StmtList stmtList, Map changedStmtMap, Map jumpTargetMap)
void modifyMethod (MethodInfo mdInfo)
void relevantExceptionClasses ()
void relevantFDClass ()
void removeEmptyBlock (MethodInfo mdInfo, Set rmedStmtByEmptBlck, Vector currentCFANNs, StmtList stmtList, JimpleBody jimpleBody)
void removeEmptyConditionalBlock (Vector currentCfanns, BitSet slcSet, Set linePropList, Set removedStmtByEmptyB, StmtList stmtList)
void removeEmptyLock (List lockPairList, BitSet slcSet, Set linePropList, Set removedStmtByEmptyB, StmtList stmtList)
void removeEmptyTry (Vector currentCfanns, BitSet slcSet, Set linePropList, Set removedStmtByEmptyB, StmtList stmtList, JimpleBody jimpleBody)
void removeEmptyTryFinally (Vector currentCfanns, BitSet slcSet, Set linePropList, Set removedStmtByEmptyB, StmtList stmtList, JimpleBody jimpleBody)
void removeFieldInClinit (SootClass sootClass, SootField sootField)
void removeIrrelevantFields (ClassInfo classInfo)
void removeSourceFor (Map jumpTarMap, int removingStmtIndex)
void removeTrapsOf (Stmt[] bodyStmts, JimpleBody jimpleBody)
void residualParameters (MethodInfo mdInfo)
void returnToVoid ()
void rmIrrelevantFds ()
void rmIrrelevantParasForInvoke ()
void rmIrrelevantParasForMd ()
void rmMethodAndClass (Map removableMdMap)
void rmParasOfInvokeExpr (MethodInfo mdInfo)

Static Private Methods

Set allVarsOf (Stmt stmt)
Set getAllVarsOf (StmtList ostmtList, BitSet stmtIndexSet)
Set getRelevantLocals (StmtList stmtList, BitSet sliceSet, Map relevantVars)

Private Attributes

List classList
List removableClasses = new ArrayList()
List changeReturnTypeToVoidMds = new ArrayList()
Set relevantFields = new ArraySet()
Set relevantExceptionClassNames = new ArraySet()
AnnotationManager cfanns = null

Detailed Description

This class is for constructing residual program for each sliced class and method.

Definition at line 53 of file PostProcess.java.


Constructor & Destructor Documentation

PostProcess::PostProcess List   ct,
AnnotationManager   cfs
[inline]
 

Parameters:
ct   a list of ClassInfo.
cfs   annotation manager.

Definition at line 81 of file PostProcess.java.


Member Function Documentation

void PostProcess::addCatchesToRemovedSet Set   removedSet,
Vector   catches,
StmtList   stmtList,
Set   linePropList,
BitSet   slcSet
[inline, private]
 

Add all statements in catch block into a set removedSet except for those in the given slice set.

Parameters:
removedSet   a set of Stmt which is the result of this method.
catches   a vector of Annotation which is that of catch clause.
stmtList   statement list for indexing.
linePropList   a set of Stmt which is slice point.
slcSet   slice set indexed in a BitSet.

Definition at line 99 of file PostProcess.java.

Referenced by removeEmptyTry(), and removeEmptyTryFinally().

void PostProcess::addCatchesToSliceSet BitSet   slcSet,
Vector   catches,
StmtList   stmtList
[inline, private]
 

Add all statements in catch blocks into the given slice set.

Parameters:
slcSet   slice set indexed in a BitSet.
catches   a vector of Annotation.
stmtList   statement list for indexing.

Definition at line 121 of file PostProcess.java.

Referenced by removeEmptyTry(), and removeEmptyTryFinally().

Set PostProcess::allVarsOf Stmt   stmt [inline, static, private]
 

Get all variables appeared in one statement.

Returns:
a set of Value.
Parameters:
stmt   query statement.

Definition at line 159 of file PostProcess.java.

Referenced by getAllVarsOf().

InvokeExpr PostProcess::buildNewInvokeExpr InvokeExpr   invokeExpr [inline, private]
 

Chang arguments of an invoke expression.
Since parameters of the invoked method has been changed because of slicing: some of the parameter has been discarded due to irrelevance, correspondingly all invoke expression to that method should also be changed in arguments.
For example, given one sliced method like:
method(farg1, farg3)
, the original invoke expression is
obj.method(aarg1, aarg2, aarg3)
and it has been modified, in terms of sliced method declaration, into
obj.method(aarg1, aarg3, aarg3)
This mehtod is to change the argument number from 3 to 2, for example, to make the invoke expression be consistent with the method declaration:
obj.method(aarg1, aarg3)

Parameters:
inovkeExpr   invoke expression.

Definition at line 185 of file PostProcess.java.

Referenced by rmParasOfInvokeExpr().

void PostProcess::callSiteInSlice Map   callSiteIndexMap,
Map   callSiteMap,
Stmt   stmt
[inline, private]
 

Process parameters of a call site in slice. Change parameters of an invoke expression in terms of changes in called method.

Parameters:
callSiteIndexMap   a map from Stmt to CallSite.
callSiteMap   a map from CallSite to SootMethod.
stmt   a statement with an invoke expression.

See also:
{buildNewInvokeExpr(InvokeExpr)}

Definition at line 232 of file PostProcess.java.

Referenced by modifyMethod().

void PostProcess::changeTarget StmtList   stmtList,
Stmt   newTarget,
Stmt   oldTarget,
Map   jumpTargetMap
[inline, private]
 

Change the target of a control transferring statement, if that target is not in slice. For example,
...;
goto label-1;
....
label-1: stmt;
.....
if the statement label-1: stmt is not in slice, while goto label-1 is in slice, then label-1 should be changed to its immediate postdominator.

Parameters:
stmtList   statement list for indexing.
newTarget   new target.
oldTarget   old target.
jumpTargetMap   a map from jump target Stmt to jump sources of the target BitSet.

Definition at line 272 of file PostProcess.java.

Referenced by modifyJumpTargetMap(), and modifyMethod().

boolean PostProcess::emptyBody Set   bodyStmts,
BitSet   sliceSet,
StmtList   stmtList
[inline, private]
 

See if all statements in a set of statement are not in a slice set.

Returns:
true if all statements in the set are not in the slice set, false otherwise.
Parameters:
bodyStmts   a set of statement.
sliceSet   slice set.
stmtList   statement list for indexing.

Definition at line 318 of file PostProcess.java.

boolean PostProcess::emptyBody Stmt   bodyStmts[],
BitSet   sliceSet,
StmtList   stmtList
[inline, private]
 

See if all statements in an array of statement are not in a slice set.

Returns:
true if all statements in the array are not in the slice set, false otherwise.
Parameters:
bodyStmts   an array of statement.
sliceSet   slice set.
stmtList   statement list for indexing.

Definition at line 302 of file PostProcess.java.

Referenced by removeEmptyConditionalBlock(), removeEmptyLock(), removeEmptyTry(), and removeEmptyTryFinally().

Set PostProcess::fieldRefToField Set   fieldRefSet [inline, private]
 

Collect soot fields from a set of field references.

Parameters:
fieldRefSet   a set of FieldRef.
Returns:
a set of SootField.

Definition at line 332 of file PostProcess.java.

Referenced by removeIrrelevantFields().

void PostProcess::filterOutFields Set   variableSet [inline, private]
 

Collect all FieldRef from a set of Value into the field relevantFields.

Parameters:
variableSet   a set of Value.

Definition at line 345 of file PostProcess.java.

Referenced by modifyMethod(), and resClassCons().

Set PostProcess::getAllVarsOf MethodInfo   mdInfo [inline, private]
 

Get all Value used/defined in a method body.

Parameters:
mdInfo   query method.
Returns:
a set Value

Definition at line 375 of file PostProcess.java.

Set PostProcess::getAllVarsOf StmtList   ostmtList,
BitSet   stmtIndexSet
[inline, static, private]
 

Get all Value used/defined in a set of statements.

Parameters:
ostmtList   statement list for indexing.
stmtIndexSet   a set of statements.
Returns:
a set of Value

Definition at line 359 of file PostProcess.java.

Referenced by modifyMethod(), resClassCons(), and residualParameters().

LinkedList PostProcess::getKeepedParaOriginalIndex MethodInfo   mdInfo [inline, private]
 

Get residual parameters for a method.

Parameters:
mdInfo   query method.
Returns:
a LinkedList of Integer which is the index of parameter.

Definition at line 391 of file PostProcess.java.

Referenced by callSiteInSlice().

int PostProcess::getNewJumpTarget int   currentTarget,
BuildPDG   bpdg,
BitSet   rmStmtSet
[inline, private]
 

Get new jump target from a given current target. The new target should be the immediate postdominator of current target.

Parameters:
currentTarget   index of current target (statement).
bpdg   PDG for the method for getting immediate postdominator.
rmStmtSet   a set statement which should not be in residual program.
Returns:
the index of new target.

Definition at line 413 of file PostProcess.java.

Referenced by modifyMethod().

Set PostProcess::getRelevantLocals StmtList   stmtList,
BitSet   sliceSet,
Map   relevantVars
[inline, static, private]
 

Get all relevant variables in given slice set.

Parameters:
stmtList   statement list for indexing.
sliceSet   slice set indexed with statement list.
relevantVars   a map of relevant variables for every statement, from Stmt to a Set of Value.

Definition at line 435 of file PostProcess.java.

Referenced by getKeepedParaOriginalIndex(), and modifyMethod().

Set PostProcess::getTrapHandlers JimpleBody   jimpBody [inline, private]
 

Get all trap hanlders from jimple body.

Parameters:
jimpBody   jimple body
Returns:
a set of Stmt which is trap handler.

Definition at line 452 of file PostProcess.java.

Referenced by modifyMethod().

boolean PostProcess::isImplementingOneAbstractMd SootMethod   sm [inline, private]
 

Insert the method's description here. Creation date: (00-11-14 10:59:21)

Returns:
boolean
Parameters:
sm   ca.mcgill.sable.soot.SootMethod

Definition at line 490 of file PostProcess.java.

boolean PostProcess::isImplementingOneAbstractMd SootClass   superClass,
SootMethod   sm
[inline, private]
 

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

Returns:
boolean
Parameters:
superClass   ca.mcgill.sable.soot.SootClass
sm   ca.mcgill.sable.soot.SootMethod

Definition at line 469 of file PostProcess.java.

Referenced by isImplementingOneAbstractMd(), and resClassCons().

boolean PostProcess::isImplementingOneInterfaceMd SootClass   interfaceClass,
SootMethod   sm
[inline, private]
 

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

Returns:
boolean
Parameters:
interfaceClas   ca.mcgill.sable.soot.SootClass
sm   ca.mcgill.sable.soot.SootMethod

Definition at line 521 of file PostProcess.java.

Referenced by isImplementingOneAbstractMd().

boolean PostProcess::isPublicAndStatic int   modifier [inline, private]
 

See if a given modifier is public and static.

Parameters:
modifier   modifier.
Returns:
boolean.

Definition at line 538 of file PostProcess.java.

Referenced by keepParasOfMainMd().

void PostProcess::keepParasOfMainMd MethodInfo   mdInfo,
Map   relevantVars,
StmtList   stmtList,
BitSet   sliceSet
[inline, private]
 

Keep all parameters for main method, even those parameters are irrelevant.

Parameters:
mdInfo   query method.
relevantVars   relevant variables map.
stmtList   statement list
sliceSet   slice set.

Definition at line 553 of file PostProcess.java.

Referenced by modifyMethod().

void PostProcess::makeMethodEmpty MethodInfo   methodInfo,
Annotation   annForSm
[inline, private]
 

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

Parameters:
sm   ca.mcgill.sable.soot.SootMethod

Definition at line 572 of file PostProcess.java.

Referenced by resClassCons().

void PostProcess::modifyJumpTargetMap StmtList   stmtList,
Map   changedStmtMap,
Map   jumpTargetMap
[inline, private]
 

Modify jump target map in terms of a changed statement map.

Parameters:
stmtList   statement list.
changedStmtMap   a map from Stmt to Stmt.
jumpTargetMap   jump target map.

Definition at line 655 of file PostProcess.java.

Referenced by modifyMethod(), and residualParameters().

void PostProcess::modifyMethod MethodInfo   mdInfo [inline, private]
 

Construct residual method.

Parameters:
mdInfo   method to be constructed.

Definition at line 670 of file PostProcess.java.

Referenced by resClassCons().

void PostProcess::relevantExceptionClasses   [inline, private]
 

Insert the method's description here. Creation date: (00-11-10 9:18:31)

Definition at line 911 of file PostProcess.java.

Referenced by resClassCons().

void PostProcess::relevantFDClass   [inline, private]
 

Filter out the classes such that there is no method left in the class, but there are some fields are relevant, i.e., accessible by other relvant classes. So those classes are not removable.

Definition at line 938 of file PostProcess.java.

Referenced by resClassCons().

void PostProcess::removeEmptyBlock MethodInfo   mdInfo,
Set   rmedStmtByEmptBlck,
Vector   currentCFANNs,
StmtList   stmtList,
JimpleBody   jimpleBody
[inline, private]
 

Remove all empty block in one method. It's including: removeEmptyLock, removeEmeptyTry, removeEmptyTryFinally, removeEmptyConditionalBlock.

Parameters:
mdInfo   query method.
rmedStmtByEmptBlck   a set of statement removed.
currentCFANNS   a vector of annotations need to be analysed.
stmtList   statement list.

Definition at line 965 of file PostProcess.java.

Referenced by modifyMethod().

void PostProcess::removeEmptyConditionalBlock Vector   currentCfanns,
BitSet   slcSet,
Set   linePropList,
Set   removedStmtByEmptyB,
StmtList   stmtList
[inline, private]
 

Remove empty conditional block.

Parameters:
currentCfanns   a vector of annotations need to be analysed.
slcSet   slice set.
linePropList   a set of statement.
removedStmtByEmptyB   removed statements.
stmtList   statement list.

Definition at line 988 of file PostProcess.java.

Referenced by removeEmptyBlock().

void PostProcess::removeEmptyLock List   lockPairList,
BitSet   slcSet,
Set   linePropList,
Set   removedStmtByEmptyB,
StmtList   stmtList
[inline, private]
 

Remove empty lock.

Parameters:
lockPairList   a list of LockPair.
slcSet   slice set.
linePropList   a set of statement.
removedStmtByEmptyB   removed statements.
stmtList   statement list.

Definition at line 1070 of file PostProcess.java.

Referenced by removeEmptyBlock().

void PostProcess::removeEmptyTry Vector   currentCfanns,
BitSet   slcSet,
Set   linePropList,
Set   removedStmtByEmptyB,
StmtList   stmtList,
JimpleBody   jimpleBody
[inline, private]
 

Remove empty try block.

Parameters:
currentCfanns   a vector of annotations need to be analysed.
slcSet   slice set.
linePropList   a set of statement.
removedStmtByEmptyB   removed statements.
stmtList   statement list.

Definition at line 1112 of file PostProcess.java.

Referenced by removeEmptyBlock().

void PostProcess::removeEmptyTryFinally Vector   currentCfanns,
BitSet   slcSet,
Set   linePropList,
Set   removedStmtByEmptyB,
StmtList   stmtList,
JimpleBody   jimpleBody
[inline, private]
 

Remove empty try finally block.

Parameters:
currentCfanns   a vector of annotations need to be analysed.
slcSet   slice set.
linePropList   a set of statement.
removedStmtByEmptyB   removed statements.
stmtList   statement list.

Definition at line 1155 of file PostProcess.java.

Referenced by removeEmptyBlock().

void PostProcess::removeFieldInClinit SootClass   sootClass,
SootField   sootField
[inline, private]
 

Insert the method's description here. Creation date: (00-12-20 13:56:57)

Parameters:
sootClass   ca.mcgill.sable.soot.SootClass
sootField   ca.mcgill.sable.soot.SootField

Definition at line 1203 of file PostProcess.java.

Referenced by removeIrrelevantFields().

void PostProcess::removeIrrelevantFields ClassInfo   classInfo [inline, private]
 

Remove irrelevant fileds for a class.

Parameters:
classInfo   query class.

Definition at line 1253 of file PostProcess.java.

Referenced by rmIrrelevantFds().

void PostProcess::removeSourceFor Map   jumpTarMap,
int   removingStmtIndex
[inline, private]
 

Remove one jump source from a jump target map.

Parameters:
jumpTarMap   a map from target Stmt to source BitSet.
removingStmtIndex   the source need to be removed.

Definition at line 1278 of file PostProcess.java.

Referenced by modifyMethod().

void PostProcess::removeTrapsOf Stmt   bodyStmts[],
JimpleBody   jimpleBody
[inline, private]
 

Insert the method's description here. Creation date: (00-11-7 18:30:48)

Parameters:
bodyStmts   ca.mcgill.sable.soot.jimple.Stmt[]
stmtList   ca.mcgill.sable.soot.jimple.StmtList

Definition at line 1297 of file PostProcess.java.

Referenced by removeEmptyTry().

void PostProcess::resClassCons   [inline]
 

Construct residual classes.

Definition at line 1318 of file PostProcess.java.

Referenced by Slicer::postProcessing().

void PostProcess::residualParameters MethodInfo   mdInfo [inline, private]
 

Construct residual parameter for a given method.

Parameters:
mdInfo   query method.

Definition at line 1402 of file PostProcess.java.

Referenced by rmIrrelevantParasForMd().

void PostProcess::returnToVoid   [inline, private]
 

Change return types of methods in changeReturnTypeToVoidMds into void.

Definition at line 1456 of file PostProcess.java.

Referenced by resClassCons().

void PostProcess::rmIrrelevantFds   [inline, private]
 

Remove irrelevant fields in every classes.

Definition at line 1466 of file PostProcess.java.

Referenced by resClassCons().

void PostProcess::rmIrrelevantParasForInvoke   [inline, private]
 

Remove irrelevant parameters for invoke expression.

Definition at line 1479 of file PostProcess.java.

Referenced by resClassCons().

void PostProcess::rmIrrelevantParasForMd   [inline, private]
 

Remove irrelevant parameters for method declaration.

Definition at line 1498 of file PostProcess.java.

Referenced by resClassCons().

void PostProcess::rmMethodAndClass Map   removableMdMap [inline, private]
 

Remove methods and classes in terms of given removable method map.

Parameters:
removableMdMap   a map from SootClass to a List of SootMethod.

Definition at line 1526 of file PostProcess.java.

Referenced by resClassCons().

void PostProcess::rmParasOfInvokeExpr MethodInfo   mdInfo [inline, private]
 

Remove irrelevant parameters of invoke expressions in a given method.

Parameters:
mdInfo   query method.

Definition at line 1558 of file PostProcess.java.

Referenced by rmIrrelevantParasForInvoke().


Member Data Documentation

List PostProcess::changeReturnTypeToVoidMds = new ArrayList() [private]
 

A list of SootMethod such that return value should be changed to return void due to the irrelevance of return value.

Definition at line 68 of file PostProcess.java.

List PostProcess::classList [private]
 

A list of ClassInfo for each class.

Definition at line 58 of file PostProcess.java.

Set PostProcess::relevantFields = new ArraySet() [private]
 

A set of Value which is relevant in the residual program.

Definition at line 73 of file PostProcess.java.

List PostProcess::removableClasses = new ArrayList() [private]
 

A list of ClassInfo which is sliced away.

Definition at line 62 of file PostProcess.java.


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