public abstract class Stamp extends Object
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 Kind |
getStackKind()
Gets a Java
Kind 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(Stamp other)
Test whether two stamps have the same base type.
|
boolean |
isEmpty()
Tests whether this stamp represents an illegal value.
|
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.
|
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.
|
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.
|
protected Stamp()
public abstract ResolvedJavaType javaType(MetaAccessProvider metaAccess)
MetaAccessProvider
is mandatory.public boolean alwaysDistinct(Stamp other)
public abstract Kind getStackKind()
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.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()
unrestricted()
is the neutral element of the join(Stamp)
operation.public abstract Stamp empty()
empty()
is the neutral element of the 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 hasValues()
public final boolean isEmpty()
public Constant asConstant()
public abstract Constant readConstant(MemoryAccessProvider provider, Constant base, long displacement)
public 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)