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 |
ILLEGAL
DOUBLE_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, identityEquals
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
add, defaultForKind, forBoolean, forBoxedPrimitive, forByte, forChar, forDouble, forFloat, forIllegal, forInt, forIntegerKind, forLong, forPrimitiveInt, forShort, isNonNull, isNull, mul, one, toString, zero
getLIRKind, getPlatformKind, identityEquals
getKind
private 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 HotSpotConstant
public JavaConstant compress()
compress
in interface HotSpotObjectConstant
public JavaConstant uncompress()
uncompress
in interface HotSpotObjectConstant
public HotSpotResolvedObjectType getType()
HotSpotObjectConstant
getType
in interface HotSpotObjectConstant
public JavaConstant getClassLoader()
HotSpotObjectConstant
Class.getClassLoader()
for the Class
object represented by
this constant.getClassLoader
in interface HotSpotObjectConstant
null
if this constant does not represent a Class
objectpublic int getIdentityHashCode()
HotSpotObjectConstant
getIdentityHashCode
in interface HotSpotObjectConstant
public JavaConstant getComponentType()
HotSpotObjectConstant
Class.getComponentType()
for the Class
object represented
by this constant.getComponentType
in interface HotSpotObjectConstant
null
if this constant does not represent a Class
objectpublic JavaConstant getSuperclass()
HotSpotObjectConstant
Class.getSuperclass()
for the Class
object represented by
this constant.getSuperclass
in interface HotSpotObjectConstant
null
if this constant does not represent a Class
objectpublic JavaConstant getCallSiteTarget(Assumptions assumptions)
HotSpotObjectConstant
CallSite.getTarget()
for the CallSite
object represented
by this constant.getCallSiteTarget
in interface HotSpotObjectConstant
assumptions
- used to register an assumption that the CallSite
's target does not
changenull
if this constant does not represent a CallSite
objectpublic boolean isInternedString()
HotSpotObjectConstant
isInternedString
in interface HotSpotObjectConstant
public <T> T asObject(Class<T> type)
HotSpotObjectConstant
asObject
in interface HotSpotObjectConstant
type
- 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
null
public Object asObject(ResolvedJavaType type)
HotSpotObjectConstant
asObject
in interface HotSpotObjectConstant
type
- 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
null
public boolean isNull()
JavaConstant
isNull
in interface JavaConstant
true
if this constant is the null constantpublic boolean isDefaultForKind()
JavaConstant
isDefaultForKind
in interface Constant
isDefaultForKind
in interface JavaConstant
true
if this constant is the default value for its kindpublic Object asBoxedPrimitive()
JavaConstant
asBoxedPrimitive
in interface JavaConstant
public int asInt()
JavaConstant
Kind.getStackKind()
of Kind.Int
.asInt
in interface JavaConstant
public boolean asBoolean()
JavaConstant
Kind.Boolean
.asBoolean
in interface JavaConstant
public long asLong()
JavaConstant
Kind.Long
, a Kind.getStackKind()
of Kind.Int
.asLong
in interface JavaConstant
public float asFloat()
JavaConstant
Kind.Float
.asFloat
in interface JavaConstant
public double asDouble()
JavaConstant
Kind.Double
.asDouble
in interface JavaConstant
public int hashCode()
hashCode
in class AbstractValue
public boolean equals(Object o)
equals
in class AbstractValue
public String toValueString()
toValueString
in interface Constant
toValueString
in interface JavaConstant
public 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.