public abstract class Stamp extends Object implements SpeculationReasonGroup.SpeculationContextObject
SpeculationReasonGroup.SpeculationContextObject.Visitor| Modifier | Constructor and Description |
|---|---|
protected |
Stamp() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
alwaysDistinct(Stamp other) |
Constant |
asConstant()
If this stamp represents a single value, the methods returns this single value.
|
abstract 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.
|
abstract Stamp |
empty()
Returns a stamp of the same kind, but with no allowed values.
|
abstract LIRKind |
getLIRKind(LIRKindTool tool)
Gets a platform dependent
LIRKind that can be used to store a value of this stamp. |
abstract JavaKind |
getStackKind()
Gets a Java
JavaKind that can be used to store a value of this stamp on the Java
bytecode stack. |
abstract boolean |
hasValues()
Test whether this stamp has legal values.
|
abstract Stamp |
improveWith(Stamp other)
Tries to improve this stamp with the stamp given as parameter.
|
abstract boolean |
isCompatible(Constant constant)
Check that the constant
other is compatible with this stamp. |
abstract boolean |
isCompatible(Stamp other)
Test whether two stamps have the same base type.
|
boolean |
isEmpty()
Tests whether this stamp represents an illegal value.
|
boolean |
isPointerStamp()
Tests whether this stamp represents a pointer value.
|
boolean |
isUnrestricted()
Tests whether this stamp represents all values of this kind.
|
abstract ResolvedJavaType |
javaType(MetaAccessProvider metaAccess)
Returns the type of the stamp, guaranteed to be non-null.
|
abstract Stamp |
join(Stamp other)
Returns the intersection of this stamp and the given stamp.
|
SymbolicJVMCIReference<? extends Stamp> |
makeSymbolic()
Convert a Stamp into a representation that can be resolved symbolically into the original
stamp.
|
abstract Stamp |
meet(Stamp other)
Returns the union of this stamp and the given stamp.
|
boolean |
neverDistinct(Stamp other) |
abstract Constant |
readConstant(MemoryAccessProvider provider,
Constant base,
long displacement)
Read a value of this stamp from memory.
|
Constant |
readConstant(MemoryAccessProvider provider,
Constant base,
long displacement,
Stamp accessStamp)
Read a value of this stamp from memory where the underlying storage might be of a different
size.
|
abstract String |
toString() |
Stamp |
tryImproveWith(Stamp other)
Tries to improve this stamp with the stamp given as parameter.
|
abstract Stamp |
unrestricted()
Returns a stamp of the same kind, but allowing the full value range of the kind.
|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitacceptpublic abstract ResolvedJavaType javaType(MetaAccessProvider metaAccess)
MetaAccessProvider is mandatory.public boolean alwaysDistinct(Stamp other)
public abstract JavaKind getStackKind()
JavaKind 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.public abstract LIRKind getLIRKind(LIRKindTool tool)
LIRKind that can be used to store a value of this stamp.public abstract Stamp meet(Stamp other)
other - The stamp that will enlarge this stamp.public abstract Stamp join(Stamp other)
other - The stamp that will tighten this stamp.public abstract Stamp unrestricted()
Stamp.unrestricted() is the neutral element of the Stamp.join(Stamp) operation.public abstract Stamp empty()
Stamp.empty() is the neutral element of the Stamp.meet(Stamp) operation.public abstract Stamp constant(Constant c, MetaAccessProvider meta)
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 abstract boolean isCompatible(Stamp other)
public abstract boolean isCompatible(Constant constant)
other is compatible with this stamp.constant - public abstract boolean hasValues()
public final boolean isEmpty()
public boolean isUnrestricted()
public boolean isPointerStamp()
public Constant asConstant()
public abstract Constant readConstant(MemoryAccessProvider provider,
Constant base,
long displacement)
public Constant readConstant(MemoryAccessProvider provider,
Constant base,
long displacement,
Stamp accessStamp)
accessStamp is used to specify the size of access if it differs from the size
of the result.IllegalArgumentException - if this stamp does not support reading a value of the size
specified by accessStamppublic abstract Stamp improveWith(Stamp other)
other - the stamp that should be used to improve this stampthis if an improvement was not
possiblepublic final Stamp tryImproveWith(Stamp other)
other - the stamp that should be used to improve this stampnull if an improvement was not possiblepublic boolean neverDistinct(Stamp other)
public SymbolicJVMCIReference<? extends Stamp> makeSymbolic()