public final class SourceTypeFlow extends TypeFlow<BytecodePosition>
JavaReadNode or BytecodeExceptionNode. Also LoadHubNode,
GetClassNode, LoadVMThreadLocalNode.
The type state of this source is "empty" or "null" until the declared type is marked as
instantiated, depending on the null state of the node stamp. When this flow is initialized it
registers a callback with its declared type such that when the type is marked as instantiated it
propagates the source state. If the declared type is already instantiated when the source flow is
initialized then the callback is immediately triggered.
If the type is really never instantiated, i.e., AnalysisType.isInstantiated() is still
false at the end of the static analysis, then the callback is never triggered. That is correct,
because in this case that type can never be produced by this flow (and the only possible value is
null, if the stamp can be null, or empty).| Constructor and Description |
|---|
SourceTypeFlow(BytecodePosition position,
AnalysisType type,
boolean canBeNull) |
SourceTypeFlow(SourceTypeFlow original,
MethodFlowsGraph methodFlows) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canSaturate()
Can this type flow saturate? By default all type flows can saturate, with the exception of a
few ones that need to track all their types, e.g., AllInstantiated, AllSynchronized, etc.
|
TypeFlow<BytecodePosition> |
copy(PointsToAnalysis bb,
MethodFlowsGraph methodFlows)
By default a type flow is not cloneable.
|
void |
initFlow(PointsToAnalysis bb)
Initialization code for some type flow corner cases.
|
boolean |
needsInitialization()
Type flows that require initialization after the graph is created need to override this
method and return true.
|
protected void |
onInputSaturated(PointsToAnalysis bb,
TypeFlow<?> input)
Notified by an input that it is saturated and it will stop sending updates.
|
void |
onObservedSaturated(PointsToAnalysis bb,
TypeFlow<?> observed)
Notified by an observed flow that it is saturated.
|
protected void |
onSaturated(PointsToAnalysis bb)
Called when this type flow becomes saturated.
|
String |
toString() |
addInput, addObservee, addObserver, addObserver, addState, addState, addUse, addUse, clearInputs, clearObservees, clearObservers, clearUses, declaredTypeFilter, declaredTypeFilter, doAddUse, equals, filter, filterUncheckedInterface, format, formatSource, getDeclaredType, getInputs, getObservees, getObservers, getSlot, getSource, getState, getUses, graphRef, hashCode, id, invalidate, isAllInstantiated, isClone, isContextInsensitive, isSaturated, isValid, method, notifyObserverOfSaturation, notifyUseOfSaturation, onObservedUpdate, onSaturated, receiver, removeObserver, removeUse, replacedObservedWith, replaceObservedWith, setObserved, setSaturated, setSlot, setState, swapAtObserver, swapAtUse, swapOut, updatepublic SourceTypeFlow(BytecodePosition position,
AnalysisType type,
boolean canBeNull)
public SourceTypeFlow(SourceTypeFlow original, MethodFlowsGraph methodFlows)
public TypeFlow<BytecodePosition> copy(PointsToAnalysis bb, MethodFlowsGraph methodFlows)
TypeFlowpublic void initFlow(PointsToAnalysis bb)
TypeFlowTypeFlow.needsInitialization() also
needs to be overridden to enable type flow initialization.public boolean needsInitialization()
TypeFlowneedsInitialization in class TypeFlow<BytecodePosition>public void onObservedSaturated(PointsToAnalysis bb, TypeFlow<?> observed)
TypeFlowonObservedSaturated in class TypeFlow<BytecodePosition>protected void onInputSaturated(PointsToAnalysis bb, TypeFlow<?> input)
TypeFlowonInputSaturated in class TypeFlow<BytecodePosition>protected void onSaturated(PointsToAnalysis bb)
TypeFlowonSaturated in class TypeFlow<BytecodePosition>public boolean canSaturate()
TypeFlowcanSaturate in class TypeFlow<BytecodePosition>