public class FinalVarContext<T extends AbstractValue<T>> extends ExitMap<VarContext<T>>
ExitMap.ExceptionKey, ExitMap.Key, ExitMap.LabeledBranchKey
exceptionTypes, KEY_BREAK, KEY_CONTINUE, KEY_DIVERGE, KEY_FALSE_RESULT, KEY_NORM_TERM, KEY_RETURN, KEY_TRUE_RESULT, map
Modifier | Constructor and Description |
---|---|
protected |
FinalVarContext(java.util.Map<ExitMap.Key,VarContext<T>> m,
java.util.Set<polyglot.types.ClassType> exTypes)
Create one from its parts
|
Modifier and Type | Method and Description |
---|---|
FinalVarContext<T> |
addToAll(VarContext<T> c)
Upper bound
c with the context for each key |
protected FinalVarContext<T> |
copy()
Returns a copy so that it is ok to modify the map.
|
protected FinalVarContext<T> |
create(java.util.Map<ExitMap.Key,VarContext<T>> m,
java.util.Set<polyglot.types.ClassType> exTypes)
Create a new map from the constituent parts
|
FinalVarContext<T> |
restoreContext(VarContext<T> toRestore,
boolean restoreLocalsAndStack)
Restore elements of the input context into the contexts in
this . |
java.lang.String |
toString() |
addKey, allItems, allKeys, branch, branch, branch, branchKey, branchKey, diverge, equals, exception, exception, exceptionKey, exceptionTypes, falseResult, falseResult, get, hasExceptionType, hasFalseResult, hashCode, hasTrueFalseResult, hasTrueResult, normalTermination, normalTermination, removeBranch, removeBranch, removeException, removeNormalTermination, removeReturnItem, removeTrueFalseResults, returnItem, returnItem, trueFalseResult, trueResult, trueResult, upperBound
protected FinalVarContext(java.util.Map<ExitMap.Key,VarContext<T>> m, java.util.Set<polyglot.types.ClassType> exTypes)
m
- map from exit key to variable contextexTypes
- types of exceptions that can be thrownprotected FinalVarContext<T> copy()
copy
in class ExitMap<VarContext<T extends AbstractValue<T>>>
protected FinalVarContext<T> create(java.util.Map<ExitMap.Key,VarContext<T>> m, java.util.Set<polyglot.types.ClassType> exTypes)
ExitMap
create
in class ExitMap<VarContext<T extends AbstractValue<T>>>
m
- map of exit type to contextexTypes
- Type of exceptions that can be thrown on exception exitExitMap
classpublic FinalVarContext<T> restoreContext(VarContext<T> toRestore, boolean restoreLocalsAndStack)
this
.
This should be called after a procedure call is processed to restore the
appropriate parts of the caller's context.
Restores the suspended execution stack.
If restoreLocalsAndStack
is true then this method also restores the local variables.
And restores execution stack into the normal termination context (if there is one).
This also serves as an extension point for subclasses to allow them to restore other parts of a context.
toRestore
- context used to get the elements to restorerestoreLocalsAndStack
- true if we want to restore local variables and the expression
stack (the expression stack is only restored in the normal
termination context)FinalVarContext
with certain elements restored from the
given contextpublic FinalVarContext<T> addToAll(VarContext<T> c)
ExitMap
c
with the context for each keyaddToAll
in class ExitMap<VarContext<T extends AbstractValue<T>>>
c
with the context for
each keypublic java.lang.String toString()
toString
in class ExitMap<VarContext<T extends AbstractValue<T>>>