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

SlicingMethod Class Reference

List of all members.

Public Methods

 SlicingMethod (MethodInfo mdInfo)

Static Public Methods

boolean isBanderaInvoke (Stmt nodeStmt)
CallSite isCallSite (Map callSiteMap, Stmt node)
List reachableStmtFrom (Stmt stmt, StmtGraph stmtGraphAsPara)
SliceTraceNode sliceTraceContains (SliceTraceNode traceNode)

Private Methods

void addCalledMdToWorkList (MethodInfo targetMdInfo, LinkedList workList, Set calculated)
void addToSliceTrace (Set stmtSet, Set callSites, Integer kind, MethodInfo mdin)
void addToSliceTrace (Set stmtSet, BitSet assgnSet, Integer kind, MethodInfo mdin)
void addToSliceTrace (SliceTraceNode stn, Stmt stmt, Integer kind, MethodInfo mdin)
void addToSliceTrace (SliceTraceNode stn, LinkedList stmts, Integer kind, MethodInfo mdin)
void addToSliceTrace (SliceTraceNode stn, Set stmtSet, Integer kind, MethodInfo mdin)
void addToSliceTrace (SliceTraceNode stn, BitSet stmtBitSet, Integer kind, MethodInfo mdin)
void addToWorkList (LinkedList wkList, BitSet nodes, Set calculatedNodes)
BitSet assToRelVars (Set varList, Map locAssMap, Map relVarMap)
BitSet assToVarsNoRelVars (int stmtListSize, List varList, Map locAssMap)
boolean callerIsRelevant (CallSite callSite)
List callSiteInSlice (Map callSiteIndexMap, BitSet sliceSet)
Set collectCallSitesFrom (Set readyCallSites)
Set collectCallSitesMdInfoFrom (Set readyCallSites)
void ctrlRelVarCompute (Map relVars, Stmt nodeControled, BitSet cdNodes)
Set dataRelVarCompute (Map relVars, Stmt refNode, Set dd)
boolean existCallPathFromOriginalMd (MethodInfo toMd)
List extractingAssertLine (Set lineList)
List extractingVarsInAssert (List assertList)
void generateNewCriterion (MethodInfo methodInfo, Stmt interStmt, Set newRelVars)
void generateNewCriterionForCaller (CallSite callSite, MethodInfo calleeMdInfo, Map relVarMapOfCallee)
void genNewCritForExit (CallSite callSite, Map relevantVarMap, Set relVarsInCaller, MethodInfo callerMdInfo, MethodInfo targetMdInfo, Set exitStmtSet, Set localCopiesInCaller)
Set getAllVariables (BitSet stmtIndexSet, StmtList localStmtList)
Value getBaseFrom (CallSite site)
Set getCompleteLocalCopiesList (MethodInfo mdInfo, Set linePropList)
Set getCopiesOfTheBase (Value base, Set localCopies)
Set getNewInsFieldRefSet (InstanceFieldRef insField, Set copiesOfBase)
Set getTraceNodeSetFrom (Set stmtSet, MethodInfo mdin)
String getValueString (Value value)
BitSet indexSetOf (Set dataBoxSet)
void instanceFdInTargetMd (Set relVarsAtCallSite, Set instanceFields, Set relVarsInTargetMd, InvokeExpr invokeExpr, Set localCopiesInCaller)
void mdCallsInSlice (MethodInfo methodInfo, BitSet sliceSet, Map relVarMap, Set localCopiesInCaller)
boolean oneParaFdIsRelevant (MethodInfo mdInfo, Map relMap, BitSet sSet)
void paraFdInTargetMd (Set paraFieldsInTargetMd, Set relVarsAtCallSite, Set relVarsInTargetMd, InvokeExpr invokeExpr, Local[] paraLocals, SimpleLocalCopies simpleLocalCopiesInTargetMd)
void putToRelVarMap (Object var, BitSet assToVar, Map relVarMap)
void putUsedVarIntoRelSet (Stmt stmt, Set varSet)
Set rmAssInSlice (Set relVarSet, BitSet keepedPoints, BitSet sliceSet, Map localAssMap)
void slicingMethod (boolean goingup)
void slicingMethodAgain ()
Stmt startNodeAfterSlicing (MethodInfo methodInfo)
void staticFdInTargetMd (Set relVarsAtCallSite, Set fdsInTargetMd, Set relVarsInTargetMd)
boolean varsContainArg (Set vars, CallSite cs)

Static Private Methods

Set allLocalVarsOf (Stmt stmt)
Set allMODREFFields (Set modFields, Set refFields)
Map callSiteIndex (Map callSiteMap)
Set defVarsOf (Stmt stmt)
Set reachableStmtSetFrom (Stmt stmt, StmtGraph stmtGraphAsPara)
Set refVarsOf (Stmt stmt)

Private Attributes

StmtList stmtList
int stmtListSize
IndexMaps indexMaps
MethodInfo methodInfo
Set originalMethodsFromReady = new ArraySet()

Static Private Attributes

boolean criterionChanged
Set alreadyGenCritByReadyCallSite
Set alreadyGenerateCriterionForExits

Detailed Description

This class is for slicing one method

Definition at line 53 of file SlicingMethod.java.


Constructor & Destructor Documentation

SlicingMethod::SlicingMethod MethodInfo   mdInfo [inline]
 

Parameters:
mdInfo   method to be sliced.

Definition at line 83 of file SlicingMethod.java.


Member Function Documentation

void SlicingMethod::addToWorkList LinkedList   wkList,
BitSet   nodes,
Set   calculatedNodes
[inline, private]
 

Add a set of statements into a work list.

Parameters:
wkList   work list.
nodes   a set of statements.
calculatedNodes   a set of statements which should not be added into the work list.

Definition at line 206 of file SlicingMethod.java.

Referenced by slicingMethod(), and slicingMethodAgain().

Set SlicingMethod::allLocalVarsOf Stmt   stmt [inline, static, private]
 

Get all local variables in one statement.

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

Definition at line 221 of file SlicingMethod.java.

Referenced by getAllVariables().

Set SlicingMethod::allMODREFFields Set   modFields,
Set   refFields
[inline, static, private]
 

Get all MOD and REF fields from given sets.

Parameters:
modField   a set of Value which is in MOD set.
refField   a set of Value which is in REF set.
Returns:
a set of Value.

Definition at line 233 of file SlicingMethod.java.

Referenced by genNewCritForExit(), and generateNewCriterionForCaller().

BitSet SlicingMethod::assToRelVars Set   varList,
Map   locAssMap,
Map   relVarMap
[inline, private]
 

Get all assignments to a list of varibles.

Parameters:
varList   a list variables.
locAssMap   a map from local to assignment, see IndexMaps.locAssIndex.
relVarMap   relevant variable map, see SliceCriterion.relVarMap.
Returns:
a set of assignments.

Definition at line 255 of file SlicingMethod.java.

Referenced by slicingMethod().

BitSet SlicingMethod::assToVarsNoRelVars int   stmtListSize,
List   varList,
Map   locAssMap
[inline, private]
 

Get all assignments to a list of varibles without considering relevant variables.

Parameters:
varList   a list variables.
locAssMap   a map from local to assignment, see IndexMaps.locAssIndex.
Returns:
a set of assignments.

Definition at line 276 of file SlicingMethod.java.

Referenced by slicingMethod().

List SlicingMethod::callSiteInSlice Map   callSiteIndexMap,
BitSet   sliceSet
[inline, private]
 

Get all call site in a set of statements.

Parameters:
callSiteIndexMap   a map from Stmt to CallSite.
sliceSet   a set of statement.
Returns:
a list of CallSite.

Definition at line 354 of file SlicingMethod.java.

Referenced by mdCallsInSlice().

Map SlicingMethod::callSiteIndex Map   callSiteMap [inline, static, private]
 

Get call sites indexed by call statements.

Parameters:
callSiteMap   call site map, see IndexMaps.callSiteMap.
Returns:
a map from Stmt to CallSite.

Definition at line 339 of file SlicingMethod.java.

Referenced by isCallSite(), and mdCallsInSlice().

boolean SlicingMethod::callerIsRelevant CallSite   callSite [inline, private]
 

Insert the method's description here. Creation date: (00-10-20 19:24:31)

Definition at line 291 of file SlicingMethod.java.

Set SlicingMethod::collectCallSitesFrom Set   readyCallSites [inline, private]
 

Collect call site statement from a set of CallSite.

Parameters:
readyCallSites   a set of CallSite.
Returns:
a set of statement corresponding to those call site.

Definition at line 374 of file SlicingMethod.java.

Referenced by slicingMethod().

Set SlicingMethod::collectCallSitesMdInfoFrom Set   readyCallSites [inline, private]
 

Collect all methods where call sites are.

Parameters:
readyCallSites   a set of CallSite.
Returns:
a set of MethodInfo.

Definition at line 390 of file SlicingMethod.java.

Referenced by slicingMethod().

void SlicingMethod::ctrlRelVarCompute Map   relVars,
Stmt   nodeControled,
BitSet   cdNodes
[inline, private]
 

Compute relevant variables for control dependence.
Put all used variables of control statement into relevant variables.

Parameters:
relVars   relevant variables map.
nodeControled   statement that is controlled by cdNodes.
cdNodes   a set of control statement.

Definition at line 409 of file SlicingMethod.java.

Referenced by slicingMethod(), and slicingMethodAgain().

Set SlicingMethod::dataRelVarCompute Map   relVars,
Stmt   refNode,
Set   dd
[inline, private]
 

Compute relevant variables for data dependence.

Parameters:
relVars   relevant variables map.
refNode   statement that is data dependent on dd.
dd   a set of DataBox on which refNode is data dependent.
Returns:
a set of DataBox on which refNode is data dependent with considering relevant variables.

Definition at line 443 of file SlicingMethod.java.

Referenced by slicingMethod(), and slicingMethodAgain().

Set SlicingMethod::defVarsOf Stmt   stmt [inline, static, private]
 

Get all variables defined in a given statement.

Parameters:
stmt   query statement.
Returns:
a set of Value which is defined in stmt.

Definition at line 520 of file SlicingMethod.java.

Referenced by allLocalVarsOf(), and dataRelVarCompute().

List SlicingMethod::extractingAssertLine Set   lineList [inline, private]
 

Extract the line like Bandera.assert from all slice points.

Parameters:
lineList   a set of Stmt which is slice point.
Returns:
a list of statement which is like Bandera.assert.

Definition at line 649 of file SlicingMethod.java.

Referenced by slicingMethod().

List SlicingMethod::extractingVarsInAssert List   assertList [inline, private]
 

Extract variables used in all Bandera.assert statements.

Parameters:
assertList   a list of Bandera.assert statements.
Returns:
a list of Value used in the set of statements.

Definition at line 664 of file SlicingMethod.java.

Referenced by slicingMethod().

void SlicingMethod::genNewCritForExit CallSite   callSite,
Map   relevantVarMap,
Set   relVarsInCaller,
MethodInfo   callerMdInfo,
MethodInfo   targetMdInfo,
Set   exitStmtSet,
Set   localCopiesInCaller
[inline, private]
 

Generate new slice criterion for a callee in terms of a call site.
The main work in this method is to calculate relevant variables in the exit point of callee according to relevant variables at the call site of the caller, and parameter binding.

Parameters:
callSite   call site.
relvarsInCaller   relevant variables in the call site.
callerMdInfo   the method of caller.
targetMdInfo   method which is called by the call site.
relevantVarMap   relevant variable map of callee, see SliceCriterion.relVarMap.
exitStmtSet   a set of Stmt which is exit point of callee.
localCopiesInCaller   a set of Local.

Definition at line 867 of file SlicingMethod.java.

Referenced by mdCallsInSlice().

void SlicingMethod::generateNewCriterion MethodInfo   methodInfo,
Stmt   interStmt,
Set   newRelVars
[inline, private]
 

Generate new slice criterion for given method from given statement and a set of relevant variables.

Parameters:
methodInfo   method to be generated new slice criterion.
interStmt   slice point in the new slice criterion.
newRelVars   slice variables in the new slice criterion.

Definition at line 686 of file SlicingMethod.java.

Referenced by genNewCritForExit(), generateNewCriterionForCaller(), slicingMethod(), and slicingMethodAgain().

void SlicingMethod::generateNewCriterionForCaller CallSite   callSite,
MethodInfo   calleeMdInfo,
Map   relVarMapOfCallee
[inline, private]
 

Generate new slice criterion for a caller in terms of a call site.
The main work in this method is to calculate relevant variables in the call site according to relevant variables at entry point of callee, and parameter binding.

Parameters:
callSite   call site which will be the new slice point.
calleeMdInfo   method which is called by the call site.
relVarmapOfCallee   relevant variable map of callee, see SliceCriterion.relVarMap.

Definition at line 764 of file SlicingMethod.java.

Referenced by slicingMethod().

Set SlicingMethod::getAllVariables BitSet   stmtIndexSet,
StmtList   localStmtList
[inline, private]
 

Get all variables appeared in a set statement..

Parameters:
stmtIndexSet   a set of statement.
localStmtList   statement list for indexing.

Definition at line 979 of file SlicingMethod.java.

Referenced by generateNewCriterion().

Value SlicingMethod::getBaseFrom CallSite   site [inline, private]
 

Get base value for a call site.

Returns:
base value of the call site.
Parameters:
site   call site.

Definition at line 995 of file SlicingMethod.java.

Referenced by ctrlRelVarCompute(), dataRelVarCompute(), slicingMethod(), and slicingMethodAgain().

Set SlicingMethod::getCompleteLocalCopiesList MethodInfo   mdInfo,
Set   linePropList
[inline, private]
 

Get all the local copies before all the slice points, using the work list algorithm.

Parameters:
mdInfo   method to be analysed.
linePropList   a list of Stmt which is slice point.
Returns:
a set of LocalCopy.

Definition at line 1009 of file SlicingMethod.java.

Referenced by slicingMethod(), and slicingMethodAgain().

Set SlicingMethod::getCopiesOfTheBase Value   base,
Set   localCopies
[inline, private]
 

Get all local copies of a value.

Parameters:
base   query value.
localCopies   a set of LocalCopy.
Returns:
a set Local which is local copy of base.

Definition at line 1047 of file SlicingMethod.java.

Referenced by instanceFdInTargetMd().

Set SlicingMethod::getNewInsFieldRefSet InstanceFieldRef   insField,
Set   copiesOfBase
[inline, private]
 

Change the base of given instance field reference into a set of give locals.

Parameters:
insField   instance field reference need to be changed.
copiesOfBase   a set of Local which will be new base of insField.
Returns:
a set of InstanceFieldRef with new base.

Definition at line 1080 of file SlicingMethod.java.

Referenced by instanceFdInTargetMd().

String SlicingMethod::getValueString Value   value [inline, private]
 

Get string representation of a value.

Parameters:
value   a value.
Returns:
the string representation of value.

Definition at line 1107 of file SlicingMethod.java.

BitSet SlicingMethod::indexSetOf Set   dataBoxSet [inline, private]
 

Get statement index set of a given data box set.

Parameters:
dataBoxSet   a set of DataBox.
Returns:
a set of statement indexed by statement list.

Definition at line 1131 of file SlicingMethod.java.

Referenced by slicingMethod(), and slicingMethodAgain().

void SlicingMethod::instanceFdInTargetMd Set   relVarsAtCallSite,
Set   instanceFields,
Set   relVarsInTargetMd,
InvokeExpr   invokeExpr,
Set   localCopiesInCaller
[inline, private]
 

Get all relevant instance field from a given instance field set.

Parameters:
relVarsAtCallSite   a set of Value which is relevant variable.
instanceFields   a set of InstanceFieldRef.
relVarsInTargetMd   relevant variables in target method.
invokeExpr   invoke expression of the call site.
localCopiesInCaller   local copies in caller.

Definition at line 1148 of file SlicingMethod.java.

Referenced by genNewCritForExit().

boolean SlicingMethod::isBanderaInvoke Stmt   nodeStmt [inline, static]
 

See if a statement is Bandera.assert.

Returns:
boolean.

Definition at line 1174 of file SlicingMethod.java.

Referenced by extractingAssertLine().

CallSite SlicingMethod::isCallSite Map   callSiteMap,
Stmt   node
[inline, static]
 

See if a statement is a call site.

Parameters:
callSiteMap   call site map.
node   a statement.
Returns:
call site if node is call site, null otherwise.

Definition at line 1195 of file SlicingMethod.java.

Referenced by ctrlRelVarCompute(), dataRelVarCompute(), slicingMethod(), and slicingMethodAgain().

void SlicingMethod::mdCallsInSlice MethodInfo   methodInfo,
BitSet   sliceSet,
Map   relVarMap,
Set   localCopiesInCaller
[inline, private]
 

Analyse method calls in slice.
Generate new criterion for exit node of every method call in slice.

Parameters:
methodInfo   current method.
sliceSet   slice set.
relVarMap   relevant variables map.
localCopiesInCaller   local copies in caller.

Definition at line 1211 of file SlicingMethod.java.

Referenced by slicingMethod(), and slicingMethodAgain().

boolean SlicingMethod::oneParaFdIsRelevant MethodInfo   mdInfo,
Map   relMap,
BitSet   sSet
[inline, private]
 

See if there is one parameter field is relevant.

Returns:
boolean
Parameters:
mdInfo   current method.
relMap   relevant variables map.
sSet   slice set.

Definition at line 1252 of file SlicingMethod.java.

void SlicingMethod::putToRelVarMap Object   var,
BitSet   assToVar,
Map   relVarMap
[inline, private]
 

Put a given variable into relevant variable map.

Parameters:
var   varible
assToVar   all assignment to var.
relVarMap   relevant variable map.

Definition at line 1301 of file SlicingMethod.java.

Referenced by assToRelVars().

void SlicingMethod::putUsedVarIntoRelSet Stmt   stmt,
Set   varSet
[inline, private]
 

Add all used variables in a statement into a set.

Parameters:
stmt   Stmt
varSet   a set of variables.

Definition at line 1320 of file SlicingMethod.java.

Referenced by genNewCritForExit().

List SlicingMethod::reachableStmtFrom Stmt   stmt,
StmtGraph   stmtGraphAsPara
[inline, static]
 

Calculate all reachable statements from a given statement.

Parameters:
stmt   Stmt
stmtGraphAsPara   statement graph.
Returns:
a list of Stmt.

Definition at line 1334 of file SlicingMethod.java.

Referenced by reachableStmtSetFrom().

Set SlicingMethod::reachableStmtSetFrom Stmt   stmt,
StmtGraph   stmtGraphAsPara
[inline, static, private]
 

Calculate all reachable statements from a given statement.

Parameters:
stmt   Stmt
stmtGraphAsPara   statement graph.
Returns:
a set of Stmt.

Definition at line 1360 of file SlicingMethod.java.

Set SlicingMethod::refVarsOf Stmt   stmt [inline, static, private]
 

Get all variables used in one statement.

Returns:
a set of Value.

Definition at line 1402 of file SlicingMethod.java.

Referenced by allLocalVarsOf(), ctrlRelVarCompute(), dataRelVarCompute(), slicingMethod(), and slicingMethodAgain().

void SlicingMethod::slicingMethod boolean   goingup [inline, private]
 

Slice one method.

Definition at line 1440 of file SlicingMethod.java.

Referenced by slicingMethodAgain(), and Slicer::slicingMethods().

void SlicingMethod::slicingMethodAgain   [inline, private]
 

Slice one method again because of new generated slice criterion.

Definition at line 1748 of file SlicingMethod.java.

Referenced by Slicer::slicingMethods().

boolean SlicingMethod::varsContainArg Set   vars,
CallSite   cs
[inline, private]
 

Insert the method's description here. Creation date: (00-8-3 7:22:29)

Returns:
boolean
Parameters:
vars   ca.mcgill.sable.util.Set
cs   edu.ksu.cis.bandera.pdgslicer.CallSite

Definition at line 2031 of file SlicingMethod.java.

Referenced by dataRelVarCompute().


Member Data Documentation

Set SlicingMethod::alreadyGenCritByReadyCallSite [static, private]
 

A Set of CallSite which has been generated slice criterion because of ready call site.

Definition at line 73 of file SlicingMethod.java.

Set SlicingMethod::alreadyGenerateCriterionForExits [static, private]
 

A Set of MethodInfo such that has been generated slice criterion for exit of the method.

Definition at line 79 of file SlicingMethod.java.

Set SlicingMethod::originalMethodsFromReady = new ArraySet() [private]
 

A Set of MethodInfo such that some statement in other method ready dependent on one statement in the method

Definition at line 63 of file SlicingMethod.java.


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