public abstract class AnalysisPolicy extends Object
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
aliasArrayTypeFlows |
protected boolean |
allocationSiteSensitiveHeap |
protected boolean |
hybridStaticContext |
protected boolean |
limitObjectArrayLength |
protected int |
maxHeapContextDepth |
protected int |
maxObjectSetSize |
protected org.graalvm.compiler.options.OptionValues |
options |
protected boolean |
relaxTypeFlowConstraints |
protected boolean |
removeSaturatedTypeFlows |
protected int |
typeFlowSaturationCutoff |
| Constructor and Description |
|---|
AnalysisPolicy(org.graalvm.compiler.options.OptionValues options) |
| Modifier and Type | Method and Description |
|---|---|
abstract boolean |
addOriginalObserver(PointsToAnalysis bb,
TypeFlow<?> flow,
TypeFlow<?> observer) |
abstract boolean |
addOriginalUse(PointsToAnalysis bb,
TypeFlow<?> flow,
TypeFlow<?> use) |
boolean |
aliasArrayTypeFlows() |
abstract AnalysisContext |
allocationContext(PointsToAnalysis bb,
MethodFlowsGraph callerGraph) |
boolean |
allocationSiteSensitiveHeap() |
protected static boolean |
areTypesCompatibleForSystemArraycopy(AnalysisType srcType,
AnalysisType dstType)
System.arraycopy() type compatibility is defined as: can elements of the source array be
converted to the component type of the destination array by assignment conversion.
|
abstract TypeState |
cloneState(PointsToAnalysis bb,
TypeState currentState,
TypeState inputState,
BytecodePosition cloneSite,
AnalysisContext allocationContext)
Create type state for clone.
|
abstract TypeState |
constantTypeState(PointsToAnalysis bb,
JavaConstant constant,
AnalysisType exactType)
Wrap a constant into a type state abstraction.
|
abstract ArrayElementsTypeStore |
createArrayElementsTypeStore(AnalysisObject object,
AnalysisUniverse universe) |
abstract AnalysisObject |
createConstantObject(PointsToAnalysis bb,
JavaConstant constant,
AnalysisType exactType)
Create a constant object abstraction.
|
abstract InvokeTypeFlow |
createDeoptInvokeTypeFlow(BytecodePosition invokeLocation,
AnalysisType receiverType,
PointsToAnalysisMethod targetMethod,
TypeFlow<?>[] actualParameters,
ActualReturnTypeFlow actualReturn,
com.oracle.svm.common.meta.MultiMethod.MultiMethodKey callerMultiMethodKey) |
abstract FieldTypeStore |
createFieldTypeStore(PointsToAnalysis bb,
AnalysisObject object,
AnalysisField field,
AnalysisUniverse universe) |
abstract AnalysisObject |
createHeapObject(PointsToAnalysis bb,
AnalysisType objectType,
BytecodePosition allocationSite,
AnalysisContext allocationContext)
Create a heap allocated object abstraction.
|
abstract MethodTypeFlow |
createMethodTypeFlow(PointsToAnalysisMethod method) |
abstract AbstractSpecialInvokeTypeFlow |
createSpecialInvokeTypeFlow(BytecodePosition invokeLocation,
AnalysisType receiverType,
PointsToAnalysisMethod targetMethod,
TypeFlow<?>[] actualParameters,
ActualReturnTypeFlow actualReturn,
com.oracle.svm.common.meta.MultiMethod.MultiMethodKey callerMultiMethodKey)
Provides implementation for the special invoke type flow.
|
abstract AbstractStaticInvokeTypeFlow |
createStaticInvokeTypeFlow(BytecodePosition invokeLocation,
AnalysisType receiverType,
PointsToAnalysisMethod targetMethod,
TypeFlow<?>[] actualParameters,
ActualReturnTypeFlow actualReturn,
com.oracle.svm.common.meta.MultiMethod.MultiMethodKey callerMultiMethodKey)
Provides implementation for the static invoke type flow.
|
abstract AbstractVirtualInvokeTypeFlow |
createVirtualInvokeTypeFlow(BytecodePosition invokeLocation,
AnalysisType receiverType,
PointsToAnalysisMethod targetMethod,
TypeFlow<?>[] actualParameters,
ActualReturnTypeFlow actualReturn,
com.oracle.svm.common.meta.MultiMethod.MultiMethodKey callerMultiMethodKey)
Provides implementation for the virtual invoke type flow.
|
abstract TypeState |
doIntersection(PointsToAnalysis bb,
MultiTypeState s1,
MultiTypeState s2) |
abstract TypeState |
doIntersection(PointsToAnalysis bb,
MultiTypeState s1,
SingleTypeState s2) |
TypeState |
doIntersection(PointsToAnalysis bb,
SingleTypeState s1,
MultiTypeState s2) |
TypeState |
doIntersection(PointsToAnalysis bb,
SingleTypeState s1,
SingleTypeState s2) |
abstract TypeState |
doSubtraction(PointsToAnalysis bb,
MultiTypeState s1,
MultiTypeState s2) |
abstract TypeState |
doSubtraction(PointsToAnalysis bb,
MultiTypeState s1,
SingleTypeState s2) |
TypeState |
doSubtraction(PointsToAnalysis bb,
SingleTypeState s1,
MultiTypeState s2) |
TypeState |
doSubtraction(PointsToAnalysis bb,
SingleTypeState s1,
SingleTypeState s2) |
abstract TypeState |
doUnion(PointsToAnalysis bb,
MultiTypeState s1,
MultiTypeState s2) |
abstract TypeState |
doUnion(PointsToAnalysis bb,
MultiTypeState s1,
SingleTypeState s2) |
abstract TypeState |
doUnion(PointsToAnalysis bb,
SingleTypeState s1,
SingleTypeState s2) |
abstract TypeState |
dynamicNewInstanceState(PointsToAnalysis bb,
TypeState currentState,
TypeState newState,
BytecodePosition allocationSite,
AnalysisContext allocationContext)
Create type state for dynamic new instance.
|
abstract TypeState |
forContextInsensitiveTypeState(PointsToAnalysis bb,
TypeState state)
Simplifies a type state by replacing all context sensitive objects with context insensitive
objects.
|
abstract boolean |
isContextSensitiveAllocation(PointsToAnalysis bb,
AnalysisType type,
AnalysisContext allocationContext)
Specifies if an allocation site should be modeled context sensitively.
|
abstract boolean |
isContextSensitiveAnalysis() |
abstract boolean |
isMergingEnabled()
Check if merging is enabled.
|
abstract boolean |
isSummaryObject(AnalysisObject object)
In some analysis policies some objects can summarize others.
|
boolean |
limitObjectArrayLength() |
abstract void |
linkActualReturn(PointsToAnalysis bb,
boolean isStatic,
InvokeTypeFlow invoke) |
abstract void |
linkClonedObjects(PointsToAnalysis bb,
TypeFlow<?> inputFlow,
CloneTypeFlow cloneFlow,
BytecodePosition source)
Link the elements of the cloned objects (array flows or field flows) to the elements of the
source objects.
|
int |
maxObjectSetSize() |
abstract MultiTypeState |
multiTypeState(PointsToAnalysis bb,
boolean canBeNull,
BitSet typesBitSet,
int typesCount,
AnalysisObject... objects) |
abstract boolean |
needsConstantCache()
Specifies if this policy models constants objects context sensitively, i.e., by creating a
different abstraction for each JavaConstant of the same type, and thus needs a constants
cache.
|
abstract void |
noteMerge(PointsToAnalysis bb,
AnalysisObject... a)
Note analysis object state merge.
|
abstract void |
noteMerge(PointsToAnalysis bb,
AnalysisObject o)
Note analysis object state merge.
|
abstract void |
noteMerge(PointsToAnalysis bb,
TypeState t)
Note type state merge.
|
abstract void |
processArrayCopyStates(PointsToAnalysis bb,
TypeState srcArrayState,
TypeState dstArrayState) |
abstract TypeFlow<?> |
proxy(BytecodePosition source,
TypeFlow<?> input) |
abstract void |
registerAsImplementationInvoked(InvokeTypeFlow invoke,
PointsToAnalysisMethod method) |
boolean |
relaxTypeFlowConstraints() |
boolean |
removeSaturatedTypeFlows() |
abstract SingleTypeState |
singleTypeState(PointsToAnalysis bb,
boolean canBeNull,
AnalysisType type,
AnalysisObject... objects) |
abstract MethodFlowsGraphInfo |
staticRootMethodGraph(PointsToAnalysis bb,
PointsToAnalysisMethod method) |
int |
typeFlowSaturationCutoff() |
boolean |
useHybridStaticContext() |
protected final org.graalvm.compiler.options.OptionValues options
protected final boolean aliasArrayTypeFlows
protected final boolean relaxTypeFlowConstraints
protected final boolean removeSaturatedTypeFlows
protected final int typeFlowSaturationCutoff
protected final boolean allocationSiteSensitiveHeap
protected final int maxHeapContextDepth
protected final boolean limitObjectArrayLength
protected final int maxObjectSetSize
protected final boolean hybridStaticContext
public AnalysisPolicy(org.graalvm.compiler.options.OptionValues options)
public abstract boolean isContextSensitiveAnalysis()
public boolean aliasArrayTypeFlows()
public boolean relaxTypeFlowConstraints()
public boolean removeSaturatedTypeFlows()
public int typeFlowSaturationCutoff()
public boolean allocationSiteSensitiveHeap()
public boolean limitObjectArrayLength()
public int maxObjectSetSize()
public boolean useHybridStaticContext()
public abstract MethodTypeFlow createMethodTypeFlow(PointsToAnalysisMethod method)
public abstract boolean needsConstantCache()
public abstract boolean isSummaryObject(AnalysisObject object)
public abstract boolean isMergingEnabled()
public abstract void noteMerge(PointsToAnalysis bb, TypeState t)
public abstract void noteMerge(PointsToAnalysis bb, AnalysisObject... a)
public abstract void noteMerge(PointsToAnalysis bb, AnalysisObject o)
public abstract boolean isContextSensitiveAllocation(PointsToAnalysis bb, AnalysisType type, AnalysisContext allocationContext)
public abstract AnalysisObject createHeapObject(PointsToAnalysis bb, AnalysisType objectType, BytecodePosition allocationSite, AnalysisContext allocationContext)
public abstract AnalysisObject createConstantObject(PointsToAnalysis bb, JavaConstant constant, AnalysisType exactType)
public abstract TypeState constantTypeState(PointsToAnalysis bb, JavaConstant constant, AnalysisType exactType)
public abstract TypeState dynamicNewInstanceState(PointsToAnalysis bb, TypeState currentState, TypeState newState, BytecodePosition allocationSite, AnalysisContext allocationContext)
public abstract TypeState cloneState(PointsToAnalysis bb, TypeState currentState, TypeState inputState, BytecodePosition cloneSite, AnalysisContext allocationContext)
public abstract void linkClonedObjects(PointsToAnalysis bb, TypeFlow<?> inputFlow, CloneTypeFlow cloneFlow, BytecodePosition source)
public abstract FieldTypeStore createFieldTypeStore(PointsToAnalysis bb, AnalysisObject object, AnalysisField field, AnalysisUniverse universe)
public abstract ArrayElementsTypeStore createArrayElementsTypeStore(AnalysisObject object, AnalysisUniverse universe)
public abstract AbstractVirtualInvokeTypeFlow createVirtualInvokeTypeFlow(BytecodePosition invokeLocation, AnalysisType receiverType, PointsToAnalysisMethod targetMethod, TypeFlow<?>[] actualParameters, ActualReturnTypeFlow actualReturn, com.oracle.svm.common.meta.MultiMethod.MultiMethodKey callerMultiMethodKey)
public abstract AbstractSpecialInvokeTypeFlow createSpecialInvokeTypeFlow(BytecodePosition invokeLocation, AnalysisType receiverType, PointsToAnalysisMethod targetMethod, TypeFlow<?>[] actualParameters, ActualReturnTypeFlow actualReturn, com.oracle.svm.common.meta.MultiMethod.MultiMethodKey callerMultiMethodKey)
public abstract AbstractStaticInvokeTypeFlow createStaticInvokeTypeFlow(BytecodePosition invokeLocation, AnalysisType receiverType, PointsToAnalysisMethod targetMethod, TypeFlow<?>[] actualParameters, ActualReturnTypeFlow actualReturn, com.oracle.svm.common.meta.MultiMethod.MultiMethodKey callerMultiMethodKey)
public abstract InvokeTypeFlow createDeoptInvokeTypeFlow(BytecodePosition invokeLocation, AnalysisType receiverType, PointsToAnalysisMethod targetMethod, TypeFlow<?>[] actualParameters, ActualReturnTypeFlow actualReturn, com.oracle.svm.common.meta.MultiMethod.MultiMethodKey callerMultiMethodKey)
public abstract MethodFlowsGraphInfo staticRootMethodGraph(PointsToAnalysis bb, PointsToAnalysisMethod method)
public abstract AnalysisContext allocationContext(PointsToAnalysis bb, MethodFlowsGraph callerGraph)
public abstract boolean addOriginalUse(PointsToAnalysis bb, TypeFlow<?> flow, TypeFlow<?> use)
public abstract boolean addOriginalObserver(PointsToAnalysis bb, TypeFlow<?> flow, TypeFlow<?> observer)
public abstract void linkActualReturn(PointsToAnalysis bb, boolean isStatic, InvokeTypeFlow invoke)
public abstract void registerAsImplementationInvoked(InvokeTypeFlow invoke, PointsToAnalysisMethod method)
public abstract TypeState forContextInsensitiveTypeState(PointsToAnalysis bb, TypeState state)
public abstract SingleTypeState singleTypeState(PointsToAnalysis bb, boolean canBeNull, AnalysisType type, AnalysisObject... objects)
public abstract MultiTypeState multiTypeState(PointsToAnalysis bb, boolean canBeNull, BitSet typesBitSet, int typesCount, AnalysisObject... objects)
public abstract TypeState doUnion(PointsToAnalysis bb, SingleTypeState s1, SingleTypeState s2)
public abstract TypeState doUnion(PointsToAnalysis bb, MultiTypeState s1, SingleTypeState s2)
public abstract TypeState doUnion(PointsToAnalysis bb, MultiTypeState s1, MultiTypeState s2)
public final TypeState doIntersection(PointsToAnalysis bb, SingleTypeState s1, SingleTypeState s2)
public final TypeState doIntersection(PointsToAnalysis bb, SingleTypeState s1, MultiTypeState s2)
public abstract TypeState doIntersection(PointsToAnalysis bb, MultiTypeState s1, SingleTypeState s2)
public abstract TypeState doIntersection(PointsToAnalysis bb, MultiTypeState s1, MultiTypeState s2)
public final TypeState doSubtraction(PointsToAnalysis bb, SingleTypeState s1, SingleTypeState s2)
public final TypeState doSubtraction(PointsToAnalysis bb, SingleTypeState s1, MultiTypeState s2)
public abstract TypeState doSubtraction(PointsToAnalysis bb, MultiTypeState s1, SingleTypeState s2)
public abstract TypeState doSubtraction(PointsToAnalysis bb, MultiTypeState s1, MultiTypeState s2)
public abstract void processArrayCopyStates(PointsToAnalysis bb, TypeState srcArrayState, TypeState dstArrayState)
protected static boolean areTypesCompatibleForSystemArraycopy(AnalysisType srcType, AnalysisType dstType)
System.arraycopy() semantics doesn't check the compatibility of the source and destination
arrays statically, it instead relies on runtime checks to verify the compatibility between
the copied objects and the destination array. For example System.arraycopy() can copy from an
Object[] to SomeOtherObject[]. That's why ArrayElementsTypeFlow tests each individual
copied object for compatibility with the defined type of the destination array and filters
out those not assignable. From System.arraycopy() javadoc: "...if any actual component of the
source array [...] cannot be converted to the component type of the destination array by
assignment conversion, an ArrayStoreException is thrown."
Here we detect incompatible types eagerly, i.e., array types whose elements would be filtered
out by ArrayElementsTypeFlow anyway, by checking
dstType.isAssignableFrom(srcType) || srcType.isAssignableFrom(dstType).
By skipping incompatible types when modeling an BasicArrayCopyNode we avoid adding
any use links between ArrayElementsTypeFlow that would filter out all elements anyway. (Note
that the filter in ArrayElementsTypeFlow is still necessary for partially compatible copying,
e.g., when copying from an array to another array of one of its subtypes.)