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

LockAnalysis Class Reference

List of all members.

Public Methods

 LockAnalysis (MethodInfo methodInfo, AnnotationManager cfanns)
Hashtable dependOnMonitorPairs (Stmt stmt)
List dependOnMonitors (Stmt stmt)
BitSet dependOnMonitorSet (Stmt stmt)
Set exitMonitorsIn (MonitorPair mp)
Value getActualLock (Stmt monitorStmt)
List getLockPairList ()
MonitorPair getMonitorPair (Stmt monitor)
List getNotifyStmtList ()
List getWaitStmtList ()
BitSet reachableStmtFrom (Stmt stmt)
Set readyDependOnEnters (Stmt stmt)
BitSet readyDependOnWaits (Stmt stmt)
boolean safeLock (Stmt monitor)
boolean safeLock (MonitorPair monitorPair)
boolean stmtSynchroDependOn (Stmt stmt, Stmt monitor)
boolean stmtSynchroDependOn (Stmt stmt, MonitorPair monitorPair)

Private Methods

void buildLockPairList (AnnotationManager cfanns)
void collectWaitNotifyStmt ()
MonitorPair getMonitorPairFromEnter (Stmt enterMonitor)
MonitorPair getMonitorPairFromExit (Stmt exitMonitor)
Vector getSynchAnnotation (StmtList stmtList, Annotation annotation)
Set lockValueSet ()
BitSet stmtsBetween (MonitorPair monitorPair)

Private Attributes

StmtGraph stmtGraph
StmtList stmtList
BuildPDG pdgDom
MethodInfo mdInfo
List lockPairList
List waitStmtList
List notifyStmtList

Detailed Description

This class is for lock analysis: collecting and processing information of locks in one method.

Definition at line 51 of file LockAnalysis.java.


Constructor & Destructor Documentation

LockAnalysis::LockAnalysis MethodInfo   methodInfo,
AnnotationManager   cfanns
[inline]
 

Parameters:
methodInfo   method need be analysed.
cfanns   annotation manager.

Definition at line 74 of file LockAnalysis.java.


Member Function Documentation

void LockAnalysis::buildLockPairList AnnotationManager   cfanns [inline, private]
 

Build lock pair list of current method into lockPairList.

Definition at line 91 of file LockAnalysis.java.

Referenced by LockAnalysis().

void LockAnalysis::collectWaitNotifyStmt   [inline, private]
 

Collect wait/notify statement in current method into waitStmtList and notifyStmtList.

Definition at line 121 of file LockAnalysis.java.

Referenced by LockAnalysis().

Hashtable LockAnalysis::dependOnMonitorPairs Stmt   stmt [inline]
 

Get all monitor pairs on which given statement is synchronization dependent.
(1) Get a list of monitor pairs by dependOnMonitors();
(2) Build a table from EnterMonitorStmt to corresponding MonitorPair.

Parameters:
stmt   query statement.
Returns:
a table from EnterMonitorStmt to corresponding MonitorPair, on which given stmt is synchronization dependent.

Definition at line 161 of file LockAnalysis.java.

BitSet LockAnalysis::dependOnMonitorSet Stmt   stmt [inline]
 

Get all enter/exit monitor statements on which the given statement is synchronization dependent.

Parameters:
stmt   query statement.
Returns:
a list of enter/exit monitor statements indexed in a BitSet.

Definition at line 209 of file LockAnalysis.java.

Referenced by SlicingMethod::slicingMethod(), and SlicingMethod::slicingMethodAgain().

List LockAnalysis::dependOnMonitors Stmt   stmt [inline]
 

See if one statement is synchronization dependent on any monitor pair.
One statement is synchronization dependent on a monitor pair if the statement is in the monitor section. For example,
(1) entermonitor lock
... ...
(i) astatement;
... ...
(n) exitmonitor lock
Then astatement is synchronization dependent on the monitor pair (1) and (n).

Parameters:
stmt   query statement.
Returns:
a list of MonitorPair.

Definition at line 191 of file LockAnalysis.java.

Referenced by dependOnMonitorPairs(), and dependOnMonitorSet().

Set LockAnalysis::exitMonitorsIn MonitorPair   mp [inline]
 

Get all exit monitor statements in a MonitorPair.

Parameters:
mp   query monitor pair.
Returns:
a set of Stmt.

Definition at line 229 of file LockAnalysis.java.

Referenced by dependOnMonitorSet(), and getMonitorPairFromExit().

Value LockAnalysis::getActualLock Stmt   monitorStmt [inline]
 

Get the lock to which a given monitor statement is associated.

Parameters:
monitorStmt   enter/exit monitor statement.
Returns:
the value of the lock to which monitorStmt is associated.
Exceptions:
MonitorStmtInstanceException   if monitorStmt is not enter/exit monitor statement.

Definition at line 257 of file LockAnalysis.java.

Referenced by buildLockPairList().

List LockAnalysis::getLockPairList   [inline]
 

Get the lock pair list.

Returns:
lockPairList.

Definition at line 274 of file LockAnalysis.java.

Referenced by InterClassAnalysis::lookupReadyDependStmt(), InterClassAnalysis::readyDependence(), PostProcessOnAnnotation::removeEmptyBlock(), and PostProcess::removeEmptyBlock().

MonitorPair LockAnalysis::getMonitorPair Stmt   monitor [inline]
 

Get monitor pair from an enter/exit monitor statement.

Parameters:
monitor   an enter/exit monitor statement.
Returns:
a monitor pair such that one of the pair is the given monitor.
Exceptions:
StatementTypeException   if the given monitor is not an enter/exit monitor statement.

Definition at line 287 of file LockAnalysis.java.

Referenced by safeLock(), and stmtSynchroDependOn().

MonitorPair LockAnalysis::getMonitorPairFromEnter Stmt   enterMonitor [inline, private]
 

Get monitor pair from an enter monitor statement.

Parameters:
enterMonitor   query enter monitor statement.
Returns:
a monitor pair such that one of the pair is the given enterMonitor.
Exceptions:
CorrespondingMonitorNotFoundException   if such monitor pair can not be found.

Definition at line 305 of file LockAnalysis.java.

Referenced by getMonitorPair().

MonitorPair LockAnalysis::getMonitorPairFromExit Stmt   exitMonitor [inline, private]
 

Get monitor pair from an exit monitor statement.

Parameters:
exitMonitor   query exit monitor statement.
Returns:
a monitor pair such that one of the pair is the given exitrMonitor.
Exceptions:
CorrespondingMonitorNotFoundException   if such monitor pair can not be found.

Definition at line 323 of file LockAnalysis.java.

Referenced by getMonitorPair().

List LockAnalysis::getNotifyStmtList   [inline]
 

Get notity statement list.

Returns:
notifyStmtList.

Definition at line 337 of file LockAnalysis.java.

Referenced by InterClassAnalysis::lookupReadyDependStmt().

Vector LockAnalysis::getSynchAnnotation StmtList   stmtList,
Annotation   annotation
[inline, private]
 

Get all annotations of synchronization (enter/exit monitor) statement in the given statement list.

Parameters:
stmtList   statement list from which synchronization statements are to be selected.
annotation   annotation of current method.
Returns:
a vector of Annotation of all synchroniztion statements in the given stmtList.

Definition at line 350 of file LockAnalysis.java.

Referenced by buildLockPairList().

List LockAnalysis::getWaitStmtList   [inline]
 

Get wait statement list.

Returns:
waitStmtList.

Definition at line 374 of file LockAnalysis.java.

Referenced by MethodCallAnalysis::collectPossibleReadyDependCallSite(), and InterClassAnalysis::readyDependence().

Set LockAnalysis::lockValueSet   [inline, private]
 

Get lock value for every element in lockPairList.

Returns:
a set of lock Value.

Definition at line 383 of file LockAnalysis.java.

BitSet LockAnalysis::reachableStmtFrom Stmt   stmt [inline]
 

Get all (control flow) reachable statements from a given statement.

Parameters:
stmt   query statement.
Returns:
a list of statement indexed in a BitSet.

Definition at line 401 of file LockAnalysis.java.

Referenced by readyDependOnEnters(), and readyDependOnWaits().

Set LockAnalysis::readyDependOnEnters Stmt   stmt [inline]
 

Get all enter monitor statements on which a given statement is ready dependent. If the given statement is reachable from an entermonitor statement, then we say the given statement is ready dependent on the entermonitor statement.

Parameters:
stmt   query statement.
Returns:
a set of enter monitor statements.

Definition at line 429 of file LockAnalysis.java.

BitSet LockAnalysis::readyDependOnWaits Stmt   stmt [inline]
 

Get all wait statements on which a given statement is ready dependent. If the given statement is reachable from a wait statement, then we say the given statement is ready dependent on the wait statement.

Parameters:
stmt   query statement.
Returns:
a set of wait statements indexed in a BitSet.

Definition at line 452 of file LockAnalysis.java.

Referenced by SlicingMethod::slicingMethod(), and SlicingMethod::slicingMethodAgain().

boolean LockAnalysis::safeLock MonitorPair   monitorPair [inline]
 

See if a monitor pair is with a safe lock.
This method is currently empty, need to be filled with programs.

Parameters:
monitorPair   monitor pair
Returns:
boolean.

Definition at line 485 of file LockAnalysis.java.

boolean LockAnalysis::safeLock Stmt   monitor [inline]
 

See if an enter/exit monitor statement is with a safe lock.
This method is currently empty, need to be filled with programs.

Parameters:
monitor   enter/exit monitor statement
Returns:
boolean.

Definition at line 471 of file LockAnalysis.java.

Referenced by readyDependOnEnters().

boolean LockAnalysis::stmtSynchroDependOn Stmt   stmt,
MonitorPair   monitorPair
[inline]
 

See if a given statement is synchronization dependent on a monitor pair.
Algorithm: check if the given statement is in between the monitor pair.

Parameters:
stmt   query statement.
monitorPair   monitor pair.
Returns:
boolean.

Definition at line 554 of file LockAnalysis.java.

boolean LockAnalysis::stmtSynchroDependOn Stmt   stmt,
Stmt   monitor
[inline]
 

See if a given statement is synchronization dependent on an enter/exit monitor statement.
Algorithm: check if the given statement is in between the monitor pair.

Parameters:
stmt   query statement.
monitor   enter/exit monitor statement.
Returns:
boolean.

Definition at line 536 of file LockAnalysis.java.

BitSet LockAnalysis::stmtsBetween MonitorPair   monitorPair [inline, private]
 

Get all statements between a monitor pair.

Parameters:
monitorPair   monitor pair.
Returns:
a set of statements between the monitor pair indexed in a BitSet.

Definition at line 515 of file LockAnalysis.java.

Referenced by dependOnMonitors(), and stmtSynchroDependOn().


Member Data Documentation

List LockAnalysis::lockPairList [private]
 

A list of MonitorPair.

Definition at line 59 of file LockAnalysis.java.

List LockAnalysis::notifyStmtList [private]
 

A list of SynchroStmt.

Definition at line 69 of file LockAnalysis.java.

List LockAnalysis::waitStmtList [private]
 

A list of SynchroStmt.

Definition at line 65 of file LockAnalysis.java.


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