public abstract class AbstractObjectStamp extends AbstractPointerStamp
Modifier and Type | Field and Description |
---|---|
private boolean |
exactType |
private jdk.internal.jvmci.meta.ResolvedJavaType |
type |
Modifier | Constructor and Description |
---|---|
protected |
AbstractObjectStamp(jdk.internal.jvmci.meta.ResolvedJavaType type,
boolean exactType,
boolean nonNull,
boolean alwaysNull) |
Modifier and Type | Method and Description |
---|---|
protected void |
appendString(StringBuilder str) |
Stamp |
constant(jdk.internal.jvmci.meta.Constant c,
jdk.internal.jvmci.meta.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(jdk.internal.jvmci.meta.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) |
jdk.internal.jvmci.meta.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(jdk.internal.jvmci.meta.ResolvedJavaType type) |
boolean |
isExactType() |
private static boolean |
isInterfaceOrArrayOfInterface(jdk.internal.jvmci.meta.ResolvedJavaType t) |
jdk.internal.jvmci.meta.ResolvedJavaType |
javaType(jdk.internal.jvmci.meta.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 jdk.internal.jvmci.meta.ResolvedJavaType |
meetTypes(jdk.internal.jvmci.meta.ResolvedJavaType a,
jdk.internal.jvmci.meta.ResolvedJavaType b) |
jdk.internal.jvmci.meta.ResolvedJavaType |
type() |
Stamp |
unrestricted()
Returns a stamp of the same kind, but allowing the full value range of the kind.
|
alwaysNull, asConstant, nonNull
alwaysDistinct, getLIRKind, isCompatible, isEmpty, neverDistinct, readConstant, tryImproveWith
private final jdk.internal.jvmci.meta.ResolvedJavaType type
private final boolean exactType
protected AbstractObjectStamp(jdk.internal.jvmci.meta.ResolvedJavaType type, boolean exactType, boolean nonNull, boolean alwaysNull)
protected abstract AbstractObjectStamp copyWith(jdk.internal.jvmci.meta.ResolvedJavaType newType, boolean newExactType, boolean newNonNull, boolean newAlwaysNull)
protected final AbstractPointerStamp copyWith(boolean newNonNull, boolean newAlwaysNull)
copyWith
in class AbstractPointerStamp
public Stamp unrestricted()
Stamp
Stamp.unrestricted()
is the neutral element of the Stamp.join(Stamp)
operation.unrestricted
in class AbstractPointerStamp
public Stamp empty()
Stamp
Stamp.empty()
is the neutral element of the Stamp.meet(Stamp)
operation.public Stamp constant(jdk.internal.jvmci.meta.Constant c, jdk.internal.jvmci.meta.MetaAccessProvider meta)
Stamp
If 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()
Stamp
public jdk.internal.jvmci.meta.Kind getStackKind()
Stamp
Kind
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 AbstractPointerStamp
public jdk.internal.jvmci.meta.ResolvedJavaType javaType(jdk.internal.jvmci.meta.MetaAccessProvider metaAccess)
Stamp
MetaAccessProvider
is mandatory.public jdk.internal.jvmci.meta.ResolvedJavaType type()
public boolean isExactType()
protected void appendString(StringBuilder str)
public Stamp meet(Stamp otherStamp)
Stamp
meet
in class AbstractPointerStamp
otherStamp
- The stamp that will enlarge this stamp.public Stamp join(Stamp otherStamp)
Stamp
join
in class AbstractPointerStamp
otherStamp
- 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 AbstractPointerStamp
other
- the stamp this stamp should be casted tonull
if this stamp cannot be improvedprivate static boolean isInterfaceOrArrayOfInterface(jdk.internal.jvmci.meta.ResolvedJavaType t)
public static boolean isConcreteType(jdk.internal.jvmci.meta.ResolvedJavaType type)
private static jdk.internal.jvmci.meta.ResolvedJavaType meetTypes(jdk.internal.jvmci.meta.ResolvedJavaType a, jdk.internal.jvmci.meta.ResolvedJavaType b)
public int hashCode()
hashCode
in class AbstractPointerStamp
public boolean equals(Object obj)
equals
in class AbstractPointerStamp