public abstract class TypeState extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
TypeState.TypesObjectsIterator
This is a special iterator for the type state.
|
| Modifier and Type | Field and Description |
|---|---|
protected int |
properties
A bit array of properties for this type state.
|
| Constructor and Description |
|---|
TypeState(int properties) |
| Modifier and Type | Method and Description |
|---|---|
abstract boolean |
canBeNull() |
boolean |
closeToAllInstantiated(BigBang bb)
The
MultiTypeState overrides this method and provides the proper test. |
boolean |
containsObject(AnalysisObject object)
Returns true if this type state contains the object, otherwise it returns false.
|
abstract boolean |
containsType(AnalysisType exactType)
Returns true if this type state contains the type, otherwise it returns false.
|
abstract boolean |
equals(Object o) |
abstract AnalysisType |
exactType()
If this type state has a single, exact type it returns that type, otherwise it returns null.
|
abstract TypeState |
exactTypeState(BigBang bb,
AnalysisType exactType)
This method is needed for accessing the SingleTypeState associated with an specific type of a
MutiTypeState, e.g.
|
static TypeState |
forAllocation(BigBang bb,
org.graalvm.compiler.nodes.ValueNode allocation,
BytecodeLocation allocationLabel,
AnalysisType exactType)
Wraps the analysis object corresponding to an allocation site into a non-null type state.
|
static TypeState |
forAllocation(BigBang bb,
org.graalvm.compiler.nodes.ValueNode allocation,
BytecodeLocation allocationSite,
AnalysisType objectType,
AnalysisContext allocationContext)
Wraps the analysis object corresponding to an allocation site for a given context into a
non-null type state.
|
protected abstract TypeState |
forCanBeNull(BigBang bb,
boolean stateCanBeNull) |
static TypeState |
forClone(BigBang bb,
org.graalvm.compiler.nodes.ValueNode cloneSource,
BytecodeLocation cloneSite,
AnalysisType type,
AnalysisContext allocationContext)
Wraps the analysis object corresponding to a clone site for a given context into a non-null
type state.
|
static TypeState |
forConstant(BigBang bb,
jdk.vm.ci.meta.JavaConstant constant,
AnalysisType exactType)
Wraps the analysis object corresponding to a JavaConstant into a non-null type state.
|
static TypeState |
forContextInsensitiveTypeState(BigBang bb,
TypeState state)
Simplifies a type state by replacing all context sensitive objects with context insensitive
objects.
|
static TypeState |
forEmpty() |
static TypeState |
forExactType(BigBang bb,
AnalysisObject object,
boolean canBeNull) |
static TypeState |
forExactType(BigBang bb,
AnalysisType exactType,
boolean canBeNull) |
static TypeState |
forExactTypes(BigBang bb,
BitSet exactTypes,
boolean canBeNull) |
static TypeState |
forIntersection(BigBang bb,
TypeState s1,
TypeState s2) |
TypeState |
forNonNull(BigBang bb) |
static TypeState |
forNonNullObject(BigBang bb,
AnalysisObject object)
Wraps an analysis object into a non-null type state.
|
static TypeState |
forNull() |
static TypeState |
forSubtraction(BigBang bb,
TypeState s1,
TypeState s2) |
static TypeState |
forUnion(BigBang bb,
TypeState s1,
TypeState s2) |
static TypeState |
forUnknown() |
int |
getId(BigBang bb) |
int |
getProperties() |
TypeState.TypesObjectsIterator |
getTypesObjectsIterator()
Provides a special iterator for the type state.
|
abstract boolean |
hasExactTypes(BitSet typesBitSet)
Returns true if the type state contains exact the same types as the bit set.
|
int |
hashCode() |
boolean |
isAllocation() |
boolean |
isConstant() |
boolean |
isEmpty() |
boolean |
isMultiTypeState() |
boolean |
isNull() |
boolean |
isSingleTypeState() |
boolean |
isUnknown() |
void |
noteMerge(BigBang bb)
Note that the objects of this type state have been merged.
|
abstract AnalysisObject[] |
objects()
Returns the objects as an array.
|
Iterable<AnalysisObject> |
objects(AnalysisType type)
Provides an iterable for the objects corresponding to the type.
|
abstract AnalysisObject[] |
objectsArray(AnalysisType type)
Returns the objects corresponding to the type.
|
abstract int |
objectsCount()
Get the number of objects.
|
protected abstract Iterator<AnalysisObject> |
objectsIterator(AnalysisType type)
Provides an iterator for the objects corresponding to the type.
|
Stream<AnalysisObject> |
objectsStream()
Provides a stream for the objects.
|
void |
setId(BigBang bb,
int id) |
Iterable<AnalysisType> |
types()
Provides an iterable for the types for easy "for-each loop" iteration.
|
abstract int |
typesCount()
Get the number of types.
|
protected abstract Iterator<AnalysisType> |
typesIterator()
Provides an iterator over the types.
|
Stream<AnalysisType> |
typesStream()
Provides a stream for the types.
|
boolean |
verifyDeclaredType(AnalysisType declaredType) |
protected final int properties
public int getProperties()
public abstract boolean hasExactTypes(BitSet typesBitSet)
public abstract int typesCount()
public abstract AnalysisType exactType()
protected abstract Iterator<AnalysisType> typesIterator()
public Iterable<AnalysisType> types()
public Stream<AnalysisType> typesStream()
public abstract boolean containsType(AnalysisType exactType)
public abstract int objectsCount()
public abstract AnalysisObject[] objects()
public abstract AnalysisObject[] objectsArray(AnalysisType type)
protected abstract Iterator<AnalysisObject> objectsIterator(AnalysisType type)
public Iterable<AnalysisObject> objects(AnalysisType type)
public Stream<AnalysisObject> objectsStream()
public boolean containsObject(AnalysisObject object)
public TypeState.TypesObjectsIterator getTypesObjectsIterator()
TypeState.TypesObjectsIterator for a
complete explanation.public boolean isAllocation()
public boolean isConstant()
public boolean isEmpty()
public boolean isUnknown()
public boolean isSingleTypeState()
public boolean isMultiTypeState()
public boolean isNull()
public abstract boolean canBeNull()
public void noteMerge(BigBang bb)
public abstract TypeState exactTypeState(BigBang bb, AnalysisType exactType)
public boolean verifyDeclaredType(AnalysisType declaredType)
public boolean closeToAllInstantiated(BigBang bb)
MultiTypeState overrides this method and provides the proper test. All the other
type states have only 0 or 1 types.public int getId(BigBang bb)
public void setId(BigBang bb, int id)
public static TypeState forEmpty()
public static TypeState forNull()
public static TypeState forUnknown()
public static TypeState forNonNullObject(BigBang bb, AnalysisObject object)
public static TypeState forConstant(BigBang bb, jdk.vm.ci.meta.JavaConstant constant, AnalysisType exactType)
public static TypeState forAllocation(BigBang bb, org.graalvm.compiler.nodes.ValueNode allocation, BytecodeLocation allocationLabel, AnalysisType exactType)
public static TypeState forAllocation(BigBang bb, org.graalvm.compiler.nodes.ValueNode allocation, BytecodeLocation allocationSite, AnalysisType objectType, AnalysisContext allocationContext)
public static TypeState forClone(BigBang bb, org.graalvm.compiler.nodes.ValueNode cloneSource, BytecodeLocation cloneSite, AnalysisType type, AnalysisContext allocationContext)
public static TypeState forExactType(BigBang bb, AnalysisType exactType, boolean canBeNull)
public static TypeState forExactType(BigBang bb, AnalysisObject object, boolean canBeNull)
public static TypeState forExactTypes(BigBang bb, BitSet exactTypes, boolean canBeNull)
public static TypeState forContextInsensitiveTypeState(BigBang bb, TypeState state)