A - Type of analysis resultsT - Value type for analysis items in the contextpublic abstract class AnalysisUtilVarContext<A extends Ordered<A>,T extends AbstractValue<T>> extends AnalysisUtil<A>
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
trackErrors
Should we track java.lang.Error
ExitMap.keys? |
extInfo, instanceInitializersChecked, workQueue| Constructor and Description |
|---|
AnalysisUtilVarContext(WorkQueue<A> workQueue,
AnalysisUnit currentAnalysisUnit,
AccrueExtensionInfo extInfo)
Create a new utility class
|
| Modifier and Type | Method and Description |
|---|---|
VarContext<T> |
addLocations(VarContext<T> c,
java.util.Set<AbstractLocation> locs,
T absVal)
Add a set of locations at the given value.
|
java.lang.String |
analysisName() |
abstract T |
bottomAbstractValue() |
FinalVarContext<T> |
call(polyglot.types.ConstructorInstance ci,
VarContext<T> input,
T receiverAbsVal,
polyglot.ast.New n,
DataFlowNodeIdentifier callSiteNode)
|
FinalVarContext<T> |
call(polyglot.types.MethodInstance mi,
VarContext<T> input,
polyglot.ast.Call n,
DataFlowNodeIdentifier callSiteNode)
|
protected java.util.Set<ExitMap.Key> |
computeExpectedExits(polyglot.ast.Term n) |
FinalVarContext<T> |
constructorCall(polyglot.types.ConstructorInstance ci,
VarContext<T> input,
polyglot.ast.ConstructorCall n,
DataFlowNodeIdentifier callSiteNode)
|
FinalVarContext<T> |
createFinalVarContext(VarContext<T> normalTermination)
Create a
FinalVarContext context from the given
VarContext for normal termination |
VarContext<T> |
createInitContext()
Create an initial variable context
|
FinalVarContext<T> |
emptyFinalVarContext() |
protected FinalVarContext<T> |
getAnalysisForMissingReceiver(polyglot.types.ProcedureInstance pi,
VarContext<T> input,
polyglot.ast.Term n,
DataFlowNodeIdentifier callSiteNode)
Provide a hook for subclasses to implementation functionality when
procedure pi is called (e.g., "e.m()") but there is an empty points to
set for the receiver expression.
|
protected abstract FinalVarContext<T> |
getAnalysisResultsFromWorkQueue(AnalysisUnit callee,
VarContext<T> beforeCall)
Get the analysis results for the given callee and variable context.
|
T |
getLocationAbsVal(VarContext<T> c,
java.util.Set<AbstractLocation> locs)
Compute the abstract values for the given abstract locations
|
protected LibrarySignature<A,T> |
getSignatureForMissingCode(polyglot.types.ProcedureInstance pi,
T receiverAbsVal,
java.util.List<T> argAbsVals)
Subclasses can override to provide signature for missing code.
|
protected FinalVarContext<T> |
guessAnalysisForMissingCode(polyglot.types.ProcedureInstance pi,
AnalysisContext calleeContext,
HContext receiver,
VarContext<T> input,
T receiverAbsVal,
java.util.List<T> argAbsVals,
java.util.Set<ExitMap.Key> expectedExits,
polyglot.ast.Node node)
Subclasses can override as a stop gap measure before they have signature.
|
protected abstract FinalVarContext<T> |
guessAnalysisForMissingReceiver(polyglot.types.ProcedureInstance pi,
VarContext<T> input,
T receiverAbsVal,
java.util.List<T> argAbsVals,
java.util.Set<ExitMap.Key> expectedExits,
DataFlowNodeIdentifier callSiteNode)
Subclasses should override as a stop gap measure if the receiver is missing,
i.e., if the points to set of the receiver expression is empty.
|
protected FinalVarContext<T> |
handleRecursiveCall(FinalVarContext<T> res,
VarContext<T> beforeCall,
AnalysisUnit callee)
The call to callee is potentially recursive.
|
protected VarContext<T> |
preCallNonVirtual(polyglot.types.ProcedureInstance pi,
AnalysisContext calleeContext,
VarContext<T> input,
polyglot.ast.Term n)
Allow extensions a chance to modify the input before the analysis of a
non-virtual procedure call.
|
void |
recordRead(AbstractLocation loc)
Record a location that has been read
|
void |
recordReads(java.util.Collection<AbstractLocation> locs) |
void |
recordWrite(AbstractLocation loc)
Record a location that has been written
|
void |
recordWrites(java.util.Collection<AbstractLocation> locs) |
protected java.util.List<java.lang.String> |
signatureAnalysisNames() |
abstractLocations, abstractLocations, abstractLocations, abstractLocations, abstractLocations, abstractLocations, abstractLocations, abstractLocations, abstractLocations, abstractLocationsForArray, abstractLocationsForArray, abstractLocationsForArray, abstractLocationsImplicitTarget, analyze, analyzeInitializers, analyzeStaticInitializers, createExitMap, currentAnalysisUnit, currentClass, currentContext, extensionInfo, instanceInitializers, leq, maybeRecursiveCall, pointsTo, pointsTo, pointsTo, pointsTo, pointsTo, pointsTo, pointsTo, pointsTo, pointsTo, pointsToGraph, pointsToThis, process, recordMissingCode, typeSystem, upperBound, workQueueprotected boolean trackErrors
ExitMap.keys?public AnalysisUtilVarContext(WorkQueue<A> workQueue, AnalysisUnit currentAnalysisUnit, AccrueExtensionInfo extInfo)
workQueue - Queue of analysis unitscurrentAnalysisUnit - Current analysis unit from the queueextInfo - compiler analysis unitpublic FinalVarContext<T> call(polyglot.types.MethodInstance mi, VarContext<T> input, polyglot.ast.Call n, DataFlowNodeIdentifier callSiteNode) throws polyglot.types.SemanticException
mi - method to analyzeinput - variable context before analyzing the methodn - the call to the methodcallSite - AST node (and context) for the call sitepolyglot.types.SemanticException - if analysis failspublic FinalVarContext<T> emptyFinalVarContext()
public FinalVarContext<T> createFinalVarContext(VarContext<T> normalTermination)
FinalVarContext context from the given
VarContext for normal terminationnormalTermination - VarContext for normal terminationFinalVarContext just containing the normal termination mappublic FinalVarContext<T> call(polyglot.types.ConstructorInstance ci, VarContext<T> input, T receiverAbsVal, polyglot.ast.New n, DataFlowNodeIdentifier callSiteNode) throws polyglot.types.SemanticException
ci - constructor to analyzeinput - variable context before analyzing the methodreceiverAbsVal - The abstract value to use for the newly created object, i.e.,
the abstract value that "this" will map to in the invoked constructor.n - the call to the constructorcallSite - AST node (and context) for the call sitepolyglot.types.SemanticException - if analysis failspublic FinalVarContext<T> constructorCall(polyglot.types.ConstructorInstance ci, VarContext<T> input, polyglot.ast.ConstructorCall n, DataFlowNodeIdentifier callSiteNode) throws polyglot.types.SemanticException
ci with VarContext
input. This is different from call(ConstructorInstance ci,
VarContextci - constructor to analyzeinput - variable context before analyzing the methodn - the call to the constructorcallSite - AST node (and context) for the call sitepolyglot.types.SemanticException - if analysis failsprotected java.util.Set<ExitMap.Key> computeExpectedExits(polyglot.ast.Term n)
n - Term on which to compute exit keysTermprotected abstract FinalVarContext<T> getAnalysisResultsFromWorkQueue(AnalysisUnit callee, VarContext<T> beforeCall) throws polyglot.types.SemanticException
callee - Code for a callee that is to be analyzedbeforeCall - variable context before the call to the calleepolyglot.types.SemanticException - thrown for an analysis errorprotected VarContext<T> preCallNonVirtual(polyglot.types.ProcedureInstance pi, AnalysisContext calleeContext, VarContext<T> input, polyglot.ast.Term n)
procedure - to be calledcalleeContext - Procedure analysis contextinput - variable context before the call to the calleen - the call to the procedureprotected LibrarySignature<A,T> getSignatureForMissingCode(polyglot.types.ProcedureInstance pi, T receiverAbsVal, java.util.List<T> argAbsVals)
pi - missing procedure instancereceiverAbsVal - analyis context value for the receiverargAbsVals - list of values for the procedure argumentsprotected FinalVarContext<T> guessAnalysisForMissingCode(polyglot.types.ProcedureInstance pi, AnalysisContext calleeContext, HContext receiver, VarContext<T> input, T receiverAbsVal, java.util.List<T> argAbsVals, java.util.Set<ExitMap.Key> expectedExits, polyglot.ast.Node node)
pi - missing procedurecalleeContext - procedure contextreceiver - receiver heap objectinput - variable context before analysisreceiverAbsVal - value for the receiverargAbsVals - list of values for the procedure argumentsexpectedExits - set of expected exit keysnode - calling nodeprotected FinalVarContext<T> getAnalysisForMissingReceiver(polyglot.types.ProcedureInstance pi, VarContext<T> input, polyglot.ast.Term n, DataFlowNodeIdentifier callSiteNode)
pi - called procedureinput - variable context before analysisn - calling termcallSite - AST node (and context) for the call siteprotected abstract FinalVarContext<T> guessAnalysisForMissingReceiver(polyglot.types.ProcedureInstance pi, VarContext<T> input, T receiverAbsVal, java.util.List<T> argAbsVals, java.util.Set<ExitMap.Key> expectedExits, DataFlowNodeIdentifier callSiteNode)
pi - missing procedureinput - variable context before analysisreceiverAbsVal - abstract value for the receiverargAbsVals - list of abstract values for the procedure argumentsexpectedExits - set of expected exit keyscallSite - AST node (and context) for the call siteprotected FinalVarContext<T> handleRecursiveCall(FinalVarContext<T> res, VarContext<T> beforeCall, AnalysisUnit callee)
res - Variable context resulting from calling the callesbeforeCall - variable context before analysiscallee - Recursive procedurepublic java.lang.String analysisName()
analysisName in class AnalysisUtil<A extends Ordered<A>>protected java.util.List<java.lang.String> signatureAnalysisNames()
public T getLocationAbsVal(VarContext<T> c, java.util.Set<AbstractLocation> locs)
c - variable contextlocs - set of abstract locationspublic void recordRead(AbstractLocation loc)
loc - location that was readpublic void recordReads(java.util.Collection<AbstractLocation> locs)
public void recordWrite(AbstractLocation loc)
loc - location that was writtenpublic void recordWrites(java.util.Collection<AbstractLocation> locs)
public VarContext<T> addLocations(VarContext<T> c, java.util.Set<AbstractLocation> locs, T absVal)
c - current context to add tolocs - locations to addabsVal - value for the locationspublic VarContext<T> createInitContext()
public abstract T bottomAbstractValue()