public final class LIRKind
extends <any>
PlatformKind that gives the
low level representation of the value, a LIRKind.referenceMask that describes the location of
object references in the value, a LIRKind.referenceCompressionMask that indicates which of these
references are compressed references, and for derived references a LIRKind.derivedReferenceBase.
LIRKind instancesValue should get a LIRKind of the correct
PlatformKind that also contains the correct reference information. LIRKinds should be created as follows:
If the result value is created from one or more input values, the LIRKind should be
created with LIRKind.combine(Value...)(inputs). If the result has a different PlatformKind
than the inputs, LIRKind.combine(Value...)(inputs).LIRKind.changeType(PlatformKind)(resultKind) should be used.
If the result is an exact copy of one of the inputs, Value.getValueKind() or
LIRKind.mergeReferenceInformation(Value...)can be used. Note that this is only correct for
move-like operations, like conditional move or compare-and-swap. For convert operations,
LIRKind.combine(Value...) should be used.
If it is known that the result will be a reference (e.g. pointer arithmetic where the end result
is a valid oop), LIRKind.reference(PlatformKind) or LIRKind.compressedReference(PlatformKind) should be used.
If it is known that the result will neither be a reference nor be derived from a reference,
LIRKind.value(PlatformKind) can be used. If the operation producing this value has inputs, this is very
likely wrong, and LIRKind.combine(Value...) should be used instead.
If it is known that the result is derived from a reference in a way that the garbage collector
can not track, LIRKind.unknownReference(PlatformKind) can be used. In most cases,
LIRKind.combine(Value...) should be used instead, since it is able to detect this automatically.
| Modifier and Type | Method and Description |
|---|---|
LIRKind |
changeType(PlatformKind newPlatformKind)
Create a new
LIRKind with the same reference information and a new
platform kind. |
static LIRKind |
combine(Value... inputs)
Derive a new type from inputs.
|
static LIRKind |
combineDerived(LIRKind kind,
AllocatableValue base1,
AllocatableValue base2)
Helper method to construct derived reference kinds.
|
static LIRKind |
compressedReference(PlatformKind platformKind)
Create a
LIRKind of type platformKind that contains a single, tracked,
compressed oop reference. |
static AllocatableValue |
derivedBaseFromValue(AllocatableValue value)
Helper method to construct derived reference kinds.
|
static LIRKind |
derivedReference(PlatformKind platformKind,
AllocatableValue base,
boolean compressed)
Create a
LIRKind of type platformKind that contains a derived reference. |
boolean |
equals(Object obj) |
static LIRKind |
fromJavaKind(Architecture arch,
JavaKind javaKind)
|
AllocatableValue |
getDerivedReferenceBase()
Get the base value of a derived reference.
|
int |
getReferenceCount() |
int |
hashCode() |
boolean |
isCompressedReference(int idx)
Check whether the
idxth part of this value is a compressed reference. |
boolean |
isDerivedReference()
Check whether this value is a derived reference.
|
boolean |
isReference(int idx)
Check whether the
idxth part of this value is a reference that must be tracked at
safepoints. |
boolean |
isUnknownReference()
Check whether this value is derived from a reference in a non-linear way.
|
static boolean |
isUnknownReference(<any> kind) |
static boolean |
isUnknownReference(Value value) |
boolean |
isValue()
Check whether this kind is a value type that doesn't need to be tracked at safepoints.
|
static boolean |
isValue(<any> kind) |
static boolean |
isValue(Value value) |
LIRKind |
makeDerivedReference(AllocatableValue base)
Create a derived reference.
|
LIRKind |
makeUnknownReference()
Create a new
LIRKind with the same type, but marked as containing an
LIRKind.unknownReference(PlatformKind). |
static LIRKind |
mergeReferenceInformation(LIRKind mergeKind,
LIRKind inputKind)
Merges the reference information of the inputs.
|
static LIRKind |
mergeReferenceInformation(Value... inputs)
Merges the reference information of the inputs.
|
static LIRKind |
reference(PlatformKind platformKind)
Create a
LIRKind of type platformKind that contains a single, tracked,
uncompressed oop reference. |
LIRKind |
repeat(PlatformKind newPlatformKind)
Create a new
LIRKind with a new platform kind. |
void |
setDerivedReferenceBase(AllocatableValue derivedReferenceBase)
Change the base value of a derived reference.
|
String |
toString() |
static LIRKind |
unknownReference(PlatformKind platformKind)
Create a
LIRKind of type platformKind that contains a value that is derived
from a reference in a non-linear way. |
static LIRKind |
value(PlatformKind platformKind)
Create a
LIRKind of type platformKind that contains a primitive value. |
static boolean |
verifyMoveKinds(<any> dst,
<any> src,
RegisterAllocationConfig config) |
public static final LIRKind Illegal
public static LIRKind value(PlatformKind platformKind)
LIRKind of type platformKind that contains a primitive value. Should
be only used when it's guaranteed that the value is not even indirectly derived from a
reference. Otherwise, LIRKind.combine(Value...) should be used instead.public static LIRKind reference(PlatformKind platformKind)
LIRKind of type platformKind that contains a single, tracked,
uncompressed oop reference.public static LIRKind compressedReference(PlatformKind platformKind)
LIRKind of type platformKind that contains a single, tracked,
compressed oop reference.public static LIRKind fromJavaKind(Architecture arch, JavaKind javaKind)
public static LIRKind derivedReference(PlatformKind platformKind, AllocatableValue base, boolean compressed)
LIRKind of type platformKind that contains a derived reference.public static LIRKind unknownReference(PlatformKind platformKind)
LIRKind of type platformKind that contains a value that is derived
from a reference in a non-linear way. Values of this LIRKind can not be live at
safepoints. In most cases, this should not be called directly. LIRKind.combine(Value...) should be
used instead to automatically propagate this information.public LIRKind makeDerivedReference(AllocatableValue base)
base - An AllocatableValue containing the base pointer of the derived reference.public static LIRKind combine(Value... inputs)
PlatformKind of one of the
inputs. If all inputs are values, the result is a value. Otherwise, the result is an unknown
reference.
This method should be used to construct the result LIRKind of any operation that
modifies values (e.g. arithmetics).public static AllocatableValue derivedBaseFromValue(AllocatableValue value)
null, and for unknown references it returns
Value.ILLEGAL.public static LIRKind combineDerived(LIRKind kind, AllocatableValue base1, AllocatableValue base2)
base1 or base2
are set, it creates a derived reference using it as the base. If both are set, the result is
an unknown reference.public static LIRKind mergeReferenceInformation(Value... inputs)
PlatformKind
of inputs[0]. If all inputs are values (references), the result is a value
(reference). Otherwise, the result is an unknown reference.
The correctness of the PlatformKind is not verified.public static LIRKind mergeReferenceInformation(LIRKind mergeKind, LIRKind inputKind)
PlatformKind
of mergeKind. If all inputs are values (references), the result is a value
(reference). Otherwise, the result is an unknown reference.
The correctness of the PlatformKind is not verified.public LIRKind changeType(PlatformKind newPlatformKind)
LIRKind with the same reference information and a new
platform kind. If the new kind is a longer vector than this,
the new elements are marked as untracked values.public LIRKind repeat(PlatformKind newPlatformKind)
LIRKind with a new platform kind. If the
new kind is longer than this, the reference positions are repeated to fill the vector.public LIRKind makeUnknownReference()
LIRKind with the same type, but marked as containing an
LIRKind.unknownReference(PlatformKind).public boolean isDerivedReference()
public AllocatableValue getDerivedReferenceBase()
public void setDerivedReferenceBase(AllocatableValue derivedReferenceBase)
public boolean isUnknownReference()
true, this value must not be live at safepoints.public static boolean isUnknownReference(<any> kind)
public static boolean isUnknownReference(Value value)
public int getReferenceCount()
public boolean isReference(int idx)
idxth part of this value is a reference that must be tracked at
safepoints.idx - The index into the vector if this is a vector kind. Must be 0 if this is a scalar
kind.public boolean isCompressedReference(int idx)
idxth part of this value is a compressed reference.idx - The index into the vector if this is a vector kind. Must be 0 if this is a scalar
kind.public boolean isValue()
public static boolean isValue(<any> kind)
public static boolean isValue(Value value)
public String toString()
public int hashCode()
public boolean equals(Object obj)
public static boolean verifyMoveKinds(<any> dst,
<any> src,
RegisterAllocationConfig config)