public class NullnessAnalysis extends ForwardBranchedFlowAnalysis
BranchedRefVarsAnalysis which is known to have bugs.| Modifier and Type | Class and Description |
|---|---|
protected class |
NullnessAnalysis.AnalysisInfo
The analysis info is a simple mapping of type
Value to
any of the constants BOTTOM, NON_NULL, NULL or TOP. |
| Modifier and Type | Field and Description |
|---|---|
protected static int |
BOTTOM |
protected static int |
NON_NULL |
protected static int |
NULL |
protected static int |
TOP |
protected int |
used |
protected java.util.HashMap<Value,java.lang.Integer> |
valueToIndex |
unitToAfterBranchFlow, unitToAfterFallFlowfilterUnitToBeforeFlow, graph, unitToBeforeFlow| Constructor and Description |
|---|
NullnessAnalysis(UnitGraph graph)
Creates a new analysis for the given graph/
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
copy(java.lang.Object source,
java.lang.Object dest)
Creates a copy of the
source flow object in dest. |
protected java.lang.Object |
entryInitialFlow()
Returns the initial flow value for entry/exit graph nodes.
|
protected void |
flowThrough(java.lang.Object flowin,
Unit u,
java.util.List fallOut,
java.util.List branchOuts)
Given the merge of the
in sets,
compute the fallOut and branchOuts
set for s. |
protected boolean |
isAlwaysNonNull(Value v)
This can be overwritten by sublasses to mark a certain value
as constantly non-null.
|
boolean |
isAlwaysNonNullBefore(Unit s,
Immediate i)
Returns
true if the analysis could determine that i is always non-null
before the statement s. |
boolean |
isAlwaysNullBefore(Unit s,
Immediate i)
Returns
true if the analysis could determine that i is always null
before the statement s. |
protected void |
merge(java.lang.Object in1,
java.lang.Object in2,
java.lang.Object out)
Compute the merge of the
in1 and in2 sets, putting the result into out. |
protected java.lang.Object |
newInitialFlow()
Returns the flow object corresponding to the initial values for
each graph node.
|
doAnalysis, isForwardgetBranchFlowAfter, getFallFlowAfter, getFlowBeforemerge, mergeInto, treatTrapHandlersAsEntriesprotected static final int BOTTOM
protected static final int NULL
protected static final int NON_NULL
protected static final int TOP
protected final java.util.HashMap<Value,java.lang.Integer> valueToIndex
protected int used
public NullnessAnalysis(UnitGraph graph)
graph - any unit graphprotected void flowThrough(java.lang.Object flowin,
Unit u,
java.util.List fallOut,
java.util.List branchOuts)
in sets,
compute the fallOut and branchOuts
set for s.flowThrough in class BranchedFlowAnalysisprotected boolean isAlwaysNonNull(Value v)
v - any valueprotected void copy(java.lang.Object source,
java.lang.Object dest)
source flow object in dest.copy in class AbstractFlowAnalysisprotected java.lang.Object entryInitialFlow()
entryInitialFlow in class AbstractFlowAnalysisprotected void merge(java.lang.Object in1,
java.lang.Object in2,
java.lang.Object out)
in1 and in2 sets, putting the result into out.
The behavior of this function depends on the implementation ( it may be necessary to check whether
in1 and in2 are equal or aliased ).
Used by the doAnalysis method.merge in class AbstractFlowAnalysisprotected java.lang.Object newInitialFlow()
newInitialFlow in class AbstractFlowAnalysispublic boolean isAlwaysNullBefore(Unit s, Immediate i)
true if the analysis could determine that i is always null
before the statement s.s - a statement of the respective bodyi - a local or constant of that bodypublic boolean isAlwaysNonNullBefore(Unit s, Immediate i)
true if the analysis could determine that i is always non-null
before the statement s.s - a statement of the respective bodyi - a local of that bodyCopyright © 2012-2019 RoboVM AB. All Rights Reserved.