Static Value-Flow Analysis
|
#include <LockAnalysis.h>
Public Attributes | |
double | lockTime |
u32_t | numOfTotalQueries |
u32_t | numOfLockedQueries |
double | lockQueriesTime |
Private Attributes | |
TCT * | tct |
TCT. | |
CxtStmtWorkList | cxtStmtList |
context-sensitive statement worklist | |
InstToCxtStmtSet | instToCxtStmtSet |
Map a statement to all its context-sensitive statements. | |
CxtLockSet | cxtLockset |
Context-sensitive locks. | |
CxtLockToSpan | cxtLocktoSpan |
CxtStmtToCxtLockSet | cxtStmtToCxtLockSet |
CxtLockProcVec | clpList |
Following data structures are used for collecting context-sensitive locks. | |
CxtLockProcSet | visitedCTPs |
CxtLockProc List. | |
InstSet | locksites |
Record all visited clps. | |
InstSet | unlocksites |
FunSet | lockcandidateFuncSet |
Candidate functions which relevant to locks/unlocks. | |
CILockToSpan | ciLocktoSpan |
Used for context-insensitive intra-procedural locks. | |
InstToInstSetMap | instCILocksMap |
InstToInstSetMap | instTocondCILocksMap |
Lock analysis
Definition at line 44 of file LockAnalysis.h.
Definition at line 63 of file LockAnalysis.h.
Definition at line 62 of file LockAnalysis.h.
Definition at line 56 of file LockAnalysis.h.
Definition at line 57 of file LockAnalysis.h.
Definition at line 78 of file LockAnalysis.h.
Definition at line 77 of file LockAnalysis.h.
Definition at line 70 of file LockAnalysis.h.
Definition at line 73 of file LockAnalysis.h.
Definition at line 72 of file LockAnalysis.h.
Definition at line 69 of file LockAnalysis.h.
Definition at line 76 of file LockAnalysis.h.
Definition at line 66 of file LockAnalysis.h.
Definition at line 67 of file LockAnalysis.h.
Definition at line 64 of file LockAnalysis.h.
Definition at line 61 of file LockAnalysis.h.
Definition at line 80 of file LockAnalysis.h.
Definition at line 75 of file LockAnalysis.h.
Definition at line 65 of file LockAnalysis.h.
Definition at line 60 of file LockAnalysis.h.
Definition at line 59 of file LockAnalysis.h.
Definition at line 74 of file LockAnalysis.h.
Definition at line 68 of file LockAnalysis.h.
semilattice Empty==>TDUnlocked==>TDLocked
Enumerator | |
---|---|
Empty | |
TDLocked | |
TDUnlocked |
Definition at line 49 of file LockAnalysis.h.
|
inline |
Definition at line 82 of file LockAnalysis.h.
|
inline |
Add intra-procedural lock.
Definition at line 120 of file LockAnalysis.h.
|
inline |
Context-sensitive locks.
Add inter-procedural context-sensitive lock
Definition at line 151 of file LockAnalysis.h.
Add context-sensitive statement.
Definition at line 232 of file LockAnalysis.h.
Add intra-procedural lock.
Definition at line 110 of file LockAnalysis.h.
|
inline |
Return true if two locksets has at least one alias lock.
Definition at line 179 of file LockAnalysis.h.
void LockAnalysis::analyze | ( | ) |
context-sensitive forward traversal from each lock site. Generate following results (1) context-sensitive lock site, (2) maps a context-sensitive lock site to its corresponding lock span.
Definition at line 41 of file LockAnalysis.cpp.
void LockAnalysis::analyzeIntraProcedualLock | ( | ) |
Analyze intraprocedural locks A lock is intraprocedural if its lock span is within a procedural
FIXME:Should we intersect forwardInsts and backwardInsts?
Definition at line 143 of file LockAnalysis.cpp.
void LockAnalysis::analyzeLockSpanCxtStmt | ( | ) |
Definition at line 330 of file LockAnalysis.cpp.
void LockAnalysis::buildCandidateFuncSetforLock | ( | ) |
Collect candidate functions for context-sensitive lock analysis
Definition at line 95 of file LockAnalysis.cpp.
|
inlineprivate |
Clear flags.
Definition at line 391 of file LockAnalysis.h.
void LockAnalysis::collectCxtLock | ( | ) |
Definition at line 259 of file LockAnalysis.cpp.
void LockAnalysis::collectLockUnlocksites | ( | ) |
Collect lock/unlock sites
Definition at line 69 of file LockAnalysis.cpp.
|
inline |
Definition at line 249 of file LockAnalysis.h.
|
inline |
Definition at line 225 of file LockAnalysis.h.
|
inline |
Definition at line 219 of file LockAnalysis.h.
|
inline |
Definition at line 208 of file LockAnalysis.h.
Definition at line 140 of file LockAnalysis.h.
Get lock value.
Definition at line 469 of file LockAnalysis.h.
|
inline |
Definition at line 316 of file LockAnalysis.h.
Definition at line 262 of file LockAnalysis.h.
|
inlineprivate |
Definition at line 474 of file LockAnalysis.h.
|
inline |
Handle call.
Definition at line 428 of file LockAnalysis.cpp.
|
private |
Handle call relations.
Handling call relations when collecting context-sensitive locks
Definition at line 308 of file LockAnalysis.cpp.
Handle intra.
Definition at line 502 of file LockAnalysis.cpp.
Handle return.
Definition at line 451 of file LockAnalysis.cpp.
Definition at line 287 of file LockAnalysis.h.
Get context-sensitive lock.
Definition at line 159 of file LockAnalysis.h.
Definition at line 214 of file LockAnalysis.h.
Context-sensitive statement and lock spans.
Get LockSet and LockSpan
Definition at line 203 of file LockAnalysis.h.
Check if one instruction's context stmt is in a lock span.
Definition at line 272 of file LockAnalysis.h.
Definition at line 258 of file LockAnalysis.h.
|
inlineprivate |
Definition at line 375 of file LockAnalysis.h.
|
inline |
Return true if the intersection of two locksets is not empty.
Definition at line 165 of file LockAnalysis.h.
Intra-procedural backward traversal
Definition at line 215 of file LockAnalysis.cpp.
bool LockAnalysis::intraForwardTraverse | ( | const ICFGNode * | lockSite, |
InstSet & | unlockSet, | ||
InstSet & | forwardInsts | ||
) |
Intra-procedural forward traversal
Definition at line 171 of file LockAnalysis.cpp.
Return true it a lock matches an unlock.
Definition at line 345 of file LockAnalysis.h.
todo: must alias
Definition at line 349 of file LockAnalysis.h.
Whether it is a callsite.
Definition at line 459 of file LockAnalysis.h.
Whether it is calling an external function.
Definition at line 464 of file LockAnalysis.h.
Return true if two instructions are inside same context-insensitive lock span
Definition at line 656 of file LockAnalysis.cpp.
Return true if two context-sensitive instructions are inside same context-insensitive lock spa
Definition at line 677 of file LockAnalysis.cpp.
Return true if two instructions are inside at least one common context-sensitive lock span
Definition at line 688 of file LockAnalysis.cpp.
Return true if two instructions are inside at least one common lock span
Definition at line 638 of file LockAnalysis.cpp.
Return true if a statement is inside a partial lock/unlock pair (conditional lock with unconditional unlock)
Definition at line 135 of file LockAnalysis.h.
Return true if a statement is inside an intra-procedural lock.
Definition at line 129 of file LockAnalysis.h.
Intraprocedural locks.
Return true if the lock is an intra-procedural lock
Definition at line 103 of file LockAnalysis.h.
|
inline |
Return true if it is a candidate function.
Definition at line 195 of file LockAnalysis.h.
bool LockAnalysis::isProtectedByCommonCxtLock | ( | const CxtStmt & | cxtStmt1, |
const CxtStmt & | cxtStmt2 | ||
) |
Protected by at least one common context-sensitive lock
Definition at line 602 of file LockAnalysis.cpp.
Protected by at least one common context-sensitive lock under each context
Definition at line 614 of file LockAnalysis.cpp.
Check if two Instructions are protected by common locks echo inst may have multiple cxt stmt we check whether every cxt stmt of instructions is protected by a common lock.
Protected by at least one common lock under every context
Definition at line 563 of file LockAnalysis.cpp.
Whether it is a lock site.
Definition at line 445 of file LockAnalysis.h.
Whether it is a lock site.
Definition at line 438 of file LockAnalysis.h.
Whether it is a unlock site.
Definition at line 452 of file LockAnalysis.h.
|
inlineprivate |
Definition at line 413 of file LockAnalysis.h.
Mark thread flags for cxtStmt.
Transfer function for marking context-sensitive statement
Definition at line 358 of file LockAnalysis.h.
|
private |
Match context.
partial match
Definition at line 535 of file LockAnalysis.cpp.
|
inlineprivate |
Definition at line 408 of file LockAnalysis.h.
|
inlineprivate |
Definition at line 425 of file LockAnalysis.h.
Print locks and spans.
Print context-insensitive and context-sensitive locks
Definition at line 394 of file LockAnalysis.cpp.
|
private |
Push calling context.
Definition at line 519 of file LockAnalysis.cpp.
|
inlineprivate |
WorkList helper functions.
Definition at line 399 of file LockAnalysis.h.
Worklist operations.
Definition at line 421 of file LockAnalysis.h.
Add context-sensitive statement.
Definition at line 238 of file LockAnalysis.h.
|
inline |
Touch this context statement.
Definition at line 254 of file LockAnalysis.h.
|
private |
Used for context-insensitive intra-procedural locks.
Definition at line 518 of file LockAnalysis.h.
|
private |
Following data structures are used for collecting context-sensitive locks.
Definition at line 501 of file LockAnalysis.h.
|
private |
Context-sensitive locks.
Definition at line 490 of file LockAnalysis.h.
|
private |
Map a context-sensitive lock to its lock span statements Map a context-sensitive statement to its context-sensitive lock
Definition at line 495 of file LockAnalysis.h.
|
private |
context-sensitive statement worklist
Definition at line 483 of file LockAnalysis.h.
|
private |
Definition at line 496 of file LockAnalysis.h.
|
private |
Definition at line 519 of file LockAnalysis.h.
|
private |
Definition at line 520 of file LockAnalysis.h.
|
private |
Map a statement to all its context-sensitive statements.
Definition at line 486 of file LockAnalysis.h.
|
private |
Candidate functions which relevant to locks/unlocks.
Definition at line 513 of file LockAnalysis.h.
double SVF::LockAnalysis::lockQueriesTime |
Definition at line 528 of file LockAnalysis.h.
|
private |
Record all visited clps.
Collecting lock/unlock sites
Definition at line 507 of file LockAnalysis.h.
double SVF::LockAnalysis::lockTime |
Definition at line 525 of file LockAnalysis.h.
u32_t SVF::LockAnalysis::numOfLockedQueries |
Definition at line 527 of file LockAnalysis.h.
u32_t SVF::LockAnalysis::numOfTotalQueries |
Definition at line 526 of file LockAnalysis.h.
|
private |
TCT.
Definition at line 480 of file LockAnalysis.h.
|
private |
Definition at line 508 of file LockAnalysis.h.
|
private |
CxtLockProc List.
Definition at line 502 of file LockAnalysis.h.