public abstract class AbstractObjectStamp extends AbstractPointerStamp
SpeculationReasonGroup.SpeculationContextObject.Visitor| Modifier | Constructor and Description |
|---|---|
protected |
AbstractObjectStamp(ResolvedJavaType type,
boolean exactType,
boolean nonNull,
boolean alwaysNull,
boolean alwaysArray) |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(SpeculationReasonGroup.SpeculationContextObject.Visitor v) |
protected void |
appendString(StringBuilder str) |
AbstractObjectStamp |
asAlwaysArray() |
Stamp |
constant(Constant c,
MetaAccessProvider meta)
If it is possible to represent single value stamps of this kind, this method returns the
stamp representing the single value c.
|
protected AbstractPointerStamp |
copyWith(boolean newNonNull,
boolean newAlwaysNull) |
protected abstract AbstractObjectStamp |
copyWith(ResolvedJavaType newType,
boolean newExactType,
boolean newNonNull,
boolean newAlwaysNull,
boolean newAlwaysArray) |
Stamp |
empty()
Returns a stamp of the same kind, but with no allowed values.
|
boolean |
equals(Object obj) |
JavaKind |
getStackKind()
Gets a Java
JavaKind that can be used to store a value of this stamp on the Java
bytecode stack. |
int |
hashCode() |
boolean |
hasValues()
Test whether this stamp has legal values.
|
Stamp |
improveWith(Stamp other)
Returns the stamp representing the type of this stamp after a cast to the type represented by
the
to stamp. |
boolean |
isAlwaysArray()
Returns true if the stamp represents a type that is always an array.
|
static boolean |
isConcreteType(ResolvedJavaType type) |
boolean |
isExactType() |
ResolvedJavaType |
javaType(MetaAccessProvider metaAccess)
Returns the type of the stamp, guaranteed to be non-null.
|
Stamp |
join(Stamp otherStamp)
Returns the intersection of this stamp and the given stamp.
|
Stamp |
meet(Stamp otherStamp)
Returns the union of this stamp and the given stamp.
|
ResolvedJavaType |
type() |
Stamp |
unrestricted()
Returns a stamp of the same kind, but allowing the full value range of the kind.
|
alwaysNull, asAlwaysNull, asConstant, asMaybeNull, asNonNull, defaultPointerJoin, isCompressed, nonNull, nullConstant, pointerAlwaysNull, pointerMaybeNull, pointerNonNullalwaysDistinct, getLIRKind, isCompatible, isCompatible, isEmpty, isPointerStamp, isUnrestricted, makeSymbolic, neverDistinct, readConstant, readConstant, toString, tryImproveWithprotected AbstractObjectStamp(ResolvedJavaType type,
boolean exactType,
boolean nonNull,
boolean alwaysNull,
boolean alwaysArray)
public void accept(SpeculationReasonGroup.SpeculationContextObject.Visitor v)
accept in interface SpeculationReasonGroup.SpeculationContextObjectaccept in class AbstractPointerStampprotected abstract AbstractObjectStamp copyWith(ResolvedJavaType newType, boolean newExactType, boolean newNonNull, boolean newAlwaysNull, boolean newAlwaysArray)
protected final AbstractPointerStamp copyWith(boolean newNonNull, boolean newAlwaysNull)
copyWith in class AbstractPointerStamppublic Stamp unrestricted()
StampStamp.unrestricted() is the neutral element of the Stamp.join(Stamp) operation.unrestricted in class AbstractPointerStamppublic Stamp empty()
StampStamp.empty() is the neutral element of the Stamp.meet(Stamp) operation.public Stamp constant(Constant c, MetaAccessProvider meta)
StampIf it is not possible to represent single value stamps, this method returns a stamp that includes c, and is otherwise as narrow as possible.
public boolean hasValues()
Stamppublic JavaKind getStackKind()
StampJavaKind that can be used to store a value of this stamp on the Java
bytecode stack. Returns JavaKind.Illegal if a value of this stamp can not be stored
on the bytecode stack.getStackKind in class AbstractPointerStamppublic ResolvedJavaType javaType(MetaAccessProvider metaAccess)
StampMetaAccessProvider is mandatory.public ResolvedJavaType type()
public boolean isExactType()
public boolean isAlwaysArray()
type.isArray.public AbstractObjectStamp asAlwaysArray()
protected void appendString(StringBuilder str)
public Stamp meet(Stamp otherStamp)
Stampmeet in class AbstractPointerStampotherStamp - The stamp that will enlarge this stamp.public Stamp join(Stamp otherStamp)
Stamppublic Stamp improveWith(Stamp other)
to stamp. While this is very similar to a AbstractObjectStamp.join(org.graalvm.compiler.core.common.type.Stamp) operation, in the case
where both types are not obviously related, the cast operation will prefer the type of the
to stamp. This is necessary as long as ObjectStamps are not able to accurately
represent intersection types.
For example when joining the RandomAccess type with the AbstractList type,
without intersection types, this would result in the most generic type (Object ). For
this reason, in some cases a castTo operation is preferable in order to keep at least
the AbstractList type.improveWith in class AbstractPointerStampother - the stamp this stamp should be casted tonull if this stamp cannot be improvedpublic static boolean isConcreteType(ResolvedJavaType type)
public int hashCode()
hashCode in class AbstractPointerStamppublic boolean equals(Object obj)
equals in class AbstractPointerStamp