public final class HotSpotObjectConstantImpl extends AbstractValue implements HotSpotObjectConstant, HotSpotProxified
null object reference, within the compiler and across the
compiler/runtime interface.Value.IllegalValue| Modifier and Type | Field and Description |
|---|---|
private boolean |
compressed |
private boolean |
isDefaultStable |
private Object |
object |
private byte |
stableDimension |
ILLEGALDOUBLE_0, DOUBLE_1, FALSE, FLOAT_0, FLOAT_1, INT_0, INT_1, INT_2, INT_MINUS_1, LONG_0, LONG_1, NULL_POINTER, TRUE| Modifier | Constructor and Description |
|---|---|
private |
HotSpotObjectConstantImpl(Object object,
boolean compressed) |
private |
HotSpotObjectConstantImpl(Object object,
boolean compressed,
int stableDimension,
boolean isDefaultStable) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
asBoolean()
Returns the primitive boolean value this constant represents.
|
Object |
asBoxedPrimitive()
Returns the value of this constant as a boxed Java value.
|
(package private) static Object |
asBoxedValue(Constant constant) |
double |
asDouble()
Returns the primitive double value this constant represents.
|
float |
asFloat()
Returns the primitive float value this constant represents.
|
int |
asInt()
Returns the primitive int value this constant represents.
|
long |
asLong()
Returns the primitive long value this constant represents.
|
<T> T |
asObject(Class<T> type)
Gets the object represented by this constant represents if it is of a given type.
|
Object |
asObject(ResolvedJavaType type)
Gets the object represented by this constant represents if it is of a given type.
|
JavaConstant |
compress() |
boolean |
equals(Object o) |
static JavaConstant |
forBoxedValue(Kind kind,
Object value) |
static JavaConstant |
forObject(Object object) |
(package private) static JavaConstant |
forObject(Object object,
boolean compressed) |
(package private) static JavaConstant |
forStableArray(Object object,
int stableDimension,
boolean isDefaultStable) |
JavaConstant |
getCallSiteTarget(Assumptions assumptions)
Gets the result of
CallSite.getTarget() for the CallSite object represented
by this constant. |
JavaConstant |
getClassLoader()
Gets the result of
Class.getClassLoader() for the Class object represented by
this constant. |
JavaConstant |
getComponentType()
Gets the result of
Class.getComponentType() for the Class object represented
by this constant. |
int |
getIdentityHashCode()
Gets the identity has code for the object
represented by this constant.
|
Class<?> |
getObjectClass()
Gets the class of the object represented by this constant.
|
int |
getStableDimension()
Number of stable dimensions if this constant is a stable array.
|
JavaConstant |
getSuperclass()
Gets the result of
Class.getSuperclass() for the Class object represented by
this constant. |
HotSpotResolvedObjectType |
getType()
Gets the resolved Java type of the object represented by this constant.
|
int |
hashCode() |
boolean |
isCompressed() |
boolean |
isDefaultForKind()
Checks whether this constant is the default value for its kind (null, 0, 0.0, false).
|
boolean |
isDefaultStable()
Returns
true if this is a stable array constant and its elements should be considered
as stable regardless of whether they are default values. |
boolean |
isEqualTo(Object obj)
Determines if the object represented by this constant is
equal
to a given object. |
boolean |
isInternedString()
Determines if this constant represents an interned string.
|
boolean |
isNull()
Checks whether this constant is null.
|
(package private) Object |
object()
Package-private accessor for the object represented by this constant.
|
String |
toString() |
String |
toValueString() |
JavaConstant |
uncompress() |
getKind, getKindSuffix, getLIRKind, getPlatformKind, identityEqualsclone, finalize, getClass, notify, notifyAll, wait, wait, waitadd, defaultForKind, forBoolean, forBoxedPrimitive, forByte, forChar, forDouble, forFloat, forIllegal, forInt, forIntegerKind, forLong, forPrimitiveInt, forShort, isNonNull, isNull, mul, one, toString, zerogetLIRKind, getPlatformKind, identityEqualsgetKindprivate final boolean compressed
private final byte stableDimension
private final boolean isDefaultStable
private HotSpotObjectConstantImpl(Object object, boolean compressed, int stableDimension, boolean isDefaultStable)
private HotSpotObjectConstantImpl(Object object, boolean compressed)
public static JavaConstant forObject(Object object)
static JavaConstant forObject(Object object, boolean compressed)
static JavaConstant forStableArray(Object object, int stableDimension, boolean isDefaultStable)
public static JavaConstant forBoxedValue(Kind kind, Object value)
static Object asBoxedValue(Constant constant)
public boolean isEqualTo(Object obj)
equal
to a given object.public Class<?> getObjectClass()
public boolean isCompressed()
isCompressed in interface HotSpotConstantpublic JavaConstant compress()
compress in interface HotSpotObjectConstantpublic JavaConstant uncompress()
uncompress in interface HotSpotObjectConstantpublic HotSpotResolvedObjectType getType()
HotSpotObjectConstantgetType in interface HotSpotObjectConstantpublic JavaConstant getClassLoader()
HotSpotObjectConstantClass.getClassLoader() for the Class object represented by
this constant.getClassLoader in interface HotSpotObjectConstantnull if this constant does not represent a Class objectpublic int getIdentityHashCode()
HotSpotObjectConstantgetIdentityHashCode in interface HotSpotObjectConstantpublic JavaConstant getComponentType()
HotSpotObjectConstantClass.getComponentType() for the Class object represented
by this constant.getComponentType in interface HotSpotObjectConstantnull if this constant does not represent a Class objectpublic JavaConstant getSuperclass()
HotSpotObjectConstantClass.getSuperclass() for the Class object represented by
this constant.getSuperclass in interface HotSpotObjectConstantnull if this constant does not represent a Class objectpublic JavaConstant getCallSiteTarget(Assumptions assumptions)
HotSpotObjectConstantCallSite.getTarget() for the CallSite object represented
by this constant.getCallSiteTarget in interface HotSpotObjectConstantassumptions - used to register an assumption that the CallSite's target does not
changenull if this constant does not represent a CallSite objectpublic boolean isInternedString()
HotSpotObjectConstantisInternedString in interface HotSpotObjectConstantpublic <T> T asObject(Class<T> type)
HotSpotObjectConstantasObject in interface HotSpotObjectConstanttype - the expected type of the object represented by this constant. If the object is
required to be of this type, then wrap the call to this method in
Objects.requireNonNull(Object).instance of type otherwise
nullpublic Object asObject(ResolvedJavaType type)
HotSpotObjectConstantasObject in interface HotSpotObjectConstanttype - the expected type of the object represented by this constant. If the object is
required to be of this type, then wrap the call to this method in
Objects.requireNonNull(Object).instance of type otherwise
nullpublic boolean isNull()
JavaConstantisNull in interface JavaConstanttrue if this constant is the null constantpublic boolean isDefaultForKind()
JavaConstantisDefaultForKind in interface ConstantisDefaultForKind in interface JavaConstanttrue if this constant is the default value for its kindpublic Object asBoxedPrimitive()
JavaConstantasBoxedPrimitive in interface JavaConstantpublic int asInt()
JavaConstantKind.getStackKind() of Kind.Int.asInt in interface JavaConstantpublic boolean asBoolean()
JavaConstantKind.Boolean.asBoolean in interface JavaConstantpublic long asLong()
JavaConstantKind.Long, a Kind.getStackKind() of Kind.Int.asLong in interface JavaConstantpublic float asFloat()
JavaConstantKind.Float.asFloat in interface JavaConstantpublic double asDouble()
JavaConstantKind.Double.asDouble in interface JavaConstantpublic int hashCode()
hashCode in class AbstractValuepublic boolean equals(Object o)
equals in class AbstractValuepublic String toValueString()
toValueString in interface ConstanttoValueString in interface JavaConstantpublic int getStableDimension()
public boolean isDefaultStable()
true if this is a stable array constant and its elements should be considered
as stable regardless of whether they are default values.