public abstract class AbstractObjectStamp extends AbstractPointerStamp
| Modifier and Type | Field and Description |
|---|---|
private boolean |
exactType |
private ResolvedJavaType |
type |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractObjectStamp(ResolvedJavaType type,
boolean exactType,
boolean nonNull,
boolean alwaysNull) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
appendString(StringBuilder str) |
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) |
Stamp |
empty()
Returns a stamp of the same kind, but with no allowed values.
|
boolean |
equals(Object obj) |
Kind |
getStackKind()
Gets a Java
Kind 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. |
static boolean |
isConcreteType(ResolvedJavaType type) |
boolean |
isExactType() |
private static boolean |
isInterfaceOrArrayOfInterface(ResolvedJavaType t) |
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.
|
private Stamp |
join0(Stamp otherStamp,
boolean improve) |
Stamp |
meet(Stamp otherStamp)
Returns the union of this stamp and the given stamp.
|
private static ResolvedJavaType |
meetTypes(ResolvedJavaType a,
ResolvedJavaType b) |
ResolvedJavaType |
type() |
Stamp |
unrestricted()
Returns a stamp of the same kind, but allowing the full value range of the kind.
|
alwaysNull, asConstant, nonNullalwaysDistinct, getLIRKind, isCompatible, isEmpty, neverDistinct, readConstant, tryImproveWithprivate final ResolvedJavaType type
private final boolean exactType
protected AbstractObjectStamp(ResolvedJavaType type, boolean exactType, boolean nonNull, boolean alwaysNull)
protected abstract AbstractObjectStamp copyWith(ResolvedJavaType newType, boolean newExactType, boolean newNonNull, boolean newAlwaysNull)
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 Kind getStackKind()
StampKind that can be used to store a value of this stamp on the Java bytecode
stack. Returns Kind.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()
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)
Stampjoin in class AbstractPointerStampotherStamp - The stamp that will tighten this stamp.public Stamp improveWith(Stamp other)
to stamp. While this is very similar to a join(com.oracle.graal.compiler.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 improvedprivate static boolean isInterfaceOrArrayOfInterface(ResolvedJavaType t)
public static boolean isConcreteType(ResolvedJavaType type)
private static ResolvedJavaType meetTypes(ResolvedJavaType a, ResolvedJavaType b)
public int hashCode()
hashCode in class AbstractPointerStamppublic boolean equals(Object obj)
equals in class AbstractPointerStamp