|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object vasco.ContextTransitionTable<M,N,A>
M
- the type of a methodN
- the type of a node in the CFGA
- the type of a data flow valuepublic class ContextTransitionTable<M,N,A>
A record of transitions between contexts at call-sites.
The context transition table records a bidirectional one-to-many mapping of call-sites to called contexts parameterised by their methods.
If a call-site transition is not traversed in an analysis (e.g. a call to a native method) then it is listed as a "default site" which this table also records.
Field Summary | |
---|---|
protected Map<Context<M,N,A>,Set<CallSite<M,N,A>>> |
callers
A map from contexts to a set of call-sites that transition to it. |
protected Map<Context<M,N,A>,Set<CallSite<M,N,A>>> |
callSitesOfContexts
A map of contexts to call-sites present within their method bodies. |
protected Set<CallSite<M,N,A>> |
defaultCallSites
A set of call-sites from which transitions are unknown. |
protected Map<CallSite<M,N,A>,Map<M,Context<M,N,A>>> |
transitions
A map from call-sites to contexts, parameterised by the called method. |
Constructor Summary | |
---|---|
ContextTransitionTable()
Constructs a new context transition table with no initial entries. |
Method Summary | |
---|---|
void |
addTransition(CallSite<M,N,A> callSite,
Context<M,N,A> targetContext)
Adds a transition to the table. |
Map<Context<M,N,A>,Set<CallSite<M,N,A>>> |
getCallers()
Returns an unmodifiable view of the mapping from contexts to their callers. |
Set<CallSite<M,N,A>> |
getCallers(Context<M,N,A> target)
Returns the callers of a value context. |
Map<Context<M,N,A>,Set<CallSite<M,N,A>>> |
getCallSitesOfContexts()
Returns an unmodifiable view of a mapping from calling contexts to all their call-sites. |
Set<CallSite<M,N,A>> |
getDefaultCallSites()
Returns an unmodifiable view of the set of call-sites marked "default". |
Map<M,Context<M,N,A>> |
getTargets(CallSite<M,N,A> callSite)
Returns the targets of a call-site. |
Map<CallSite<M,N,A>,Map<M,Context<M,N,A>>> |
getTransitions()
Returns an unmodifiable view of context transitions. |
Set<Context<M,N,A>> |
reachableSet(Context<M,N,A> source,
boolean ignoreFree)
Computes a reachable set of value contexts from a particular source by traversing the context transition table. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Map<Context<M,N,A>,Set<CallSite<M,N,A>>> callers
protected Map<CallSite<M,N,A>,Map<M,Context<M,N,A>>> transitions
protected Map<Context<M,N,A>,Set<CallSite<M,N,A>>> callSitesOfContexts
protected Set<CallSite<M,N,A>> defaultCallSites
Constructor Detail |
---|
public ContextTransitionTable()
Method Detail |
---|
public void addTransition(CallSite<M,N,A> callSite, Context<M,N,A> targetContext)
If the target context is specified as null, the source call-site is considered a "default site" from which transitions are unknown. This is used to model unpredictable targets, for example, when encountering calls to native methods.
Any previous transitions from the source call site to other contexts of the same called method are deleted.
callSite
- the call-site which is the source of the transitiontargetContext
- the value context which is the target of the call-sitepublic Map<Context<M,N,A>,Set<CallSite<M,N,A>>> getCallers()
public Set<CallSite<M,N,A>> getCallers(Context<M,N,A> target)
target
- the target value context
public Map<Context<M,N,A>,Set<CallSite<M,N,A>>> getCallSitesOfContexts()
public Set<CallSite<M,N,A>> getDefaultCallSites()
public Map<M,Context<M,N,A>> getTargets(CallSite<M,N,A> callSite)
callSite
- the source of the transition
public Map<CallSite<M,N,A>,Map<M,Context<M,N,A>>> getTransitions()
public Set<Context<M,N,A>> reachableSet(Context<M,N,A> source, boolean ignoreFree)
source
- the source context
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |