public class HotSpotMetaAccessProvider extends Object implements MetaAccessProvider, HotSpotProxified
MetaAccessProvider
.Modifier and Type | Field and Description |
---|---|
private Field |
reflectionConstructorSlot
Field object of Constructor.slot . |
private Field |
reflectionMethodSlot
Field object of Method.slot . |
protected HotSpotJVMCIRuntimeProvider |
runtime |
Constructor and Description |
---|
HotSpotMetaAccessProvider(HotSpotJVMCIRuntimeProvider runtime) |
Modifier and Type | Method and Description |
---|---|
static int |
computeArrayAllocationSize(int length,
int alignment,
int headerSize,
int log2ElementSize)
Computes the size of the memory chunk allocated for an array.
|
int |
convertDeoptAction(DeoptimizationAction action) |
DeoptimizationAction |
convertDeoptAction(int action) |
int |
convertDeoptReason(DeoptimizationReason reason) |
DeoptimizationReason |
convertDeoptReason(int reason) |
int |
decodeDebugId(JavaConstant constant) |
DeoptimizationAction |
decodeDeoptAction(JavaConstant constant) |
DeoptimizationReason |
decodeDeoptReason(JavaConstant constant) |
JavaConstant |
encodeDeoptActionAndReason(DeoptimizationAction action,
DeoptimizationReason reason,
int debugId)
Encodes a deoptimization action and a deoptimization reason in an integer value.
|
long |
getMemorySize(JavaConstant constant)
Returns the number of bytes occupied by this constant value or constant object.
|
private static Field |
getReflectionSlotField(Class<?> reflectionClass) |
private static int |
intMaskRight(int n) |
ResolvedJavaField |
lookupJavaField(Field reflectionField)
Provides the
ResolvedJavaField for a Field obtained via reflection. |
ResolvedJavaMethod |
lookupJavaMethod(Executable reflectionMethod)
|
ResolvedJavaType |
lookupJavaType(Class<?> clazz)
Returns the resolved Java type representing a given Java class.
|
HotSpotResolvedObjectType |
lookupJavaType(JavaConstant constant)
Returns the resolved Java type of the given
JavaConstant object. |
Signature |
parseMethodDescriptor(String signature)
Parses a method
descriptor into a
Signature . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
lookupJavaTypes
protected final HotSpotJVMCIRuntimeProvider runtime
private Field reflectionMethodSlot
Field
object of Method.slot
.private Field reflectionConstructorSlot
Field
object of Constructor.slot
.public HotSpotMetaAccessProvider(HotSpotJVMCIRuntimeProvider runtime)
public ResolvedJavaType lookupJavaType(Class<?> clazz)
MetaAccessProvider
lookupJavaType
in interface MetaAccessProvider
clazz
- the Java class objectpublic HotSpotResolvedObjectType lookupJavaType(JavaConstant constant)
MetaAccessProvider
JavaConstant
object.lookupJavaType
in interface MetaAccessProvider
null
if constant.isNull() || !constant.kind.isObject()
public Signature parseMethodDescriptor(String signature)
MetaAccessProvider
Signature
. The behavior of this method is undefined if the
method descriptor is not well formed.parseMethodDescriptor
in interface MetaAccessProvider
private static Field getReflectionSlotField(Class<?> reflectionClass)
public ResolvedJavaMethod lookupJavaMethod(Executable reflectionMethod)
MetaAccessProvider
lookupJavaMethod
in interface MetaAccessProvider
public ResolvedJavaField lookupJavaField(Field reflectionField)
MetaAccessProvider
ResolvedJavaField
for a Field
obtained via reflection.lookupJavaField
in interface MetaAccessProvider
private static int intMaskRight(int n)
public JavaConstant encodeDeoptActionAndReason(DeoptimizationAction action, DeoptimizationReason reason, int debugId)
MetaAccessProvider
encodeDeoptActionAndReason
in interface MetaAccessProvider
debugId
- an integer that can be used to track the origin of a deoptimization at
runtime. There is no guarantee that the runtime will use this value. The runtime
may even keep fewer than 32 bits.public DeoptimizationReason decodeDeoptReason(JavaConstant constant)
decodeDeoptReason
in interface MetaAccessProvider
public DeoptimizationAction decodeDeoptAction(JavaConstant constant)
decodeDeoptAction
in interface MetaAccessProvider
public int decodeDebugId(JavaConstant constant)
decodeDebugId
in interface MetaAccessProvider
public int convertDeoptAction(DeoptimizationAction action)
public DeoptimizationAction convertDeoptAction(int action)
public int convertDeoptReason(DeoptimizationReason reason)
public DeoptimizationReason convertDeoptReason(int reason)
public long getMemorySize(JavaConstant constant)
MetaAccessProvider
getMemorySize
in interface MetaAccessProvider
constant
- the constant whose bytes should be measuredpublic static int computeArrayAllocationSize(int length, int alignment, int headerSize, int log2ElementSize)
length
- the number of elements in the arrayalignment
- the object alignment requirementheaderSize
- the size of the array headerlog2ElementSize
- log2 of the size of an element in the array