Top Description Fields Constructors Methods
jdk.vm.ci.hotspot

public Class HotSpotConstantReflectionProvider

extends Object
implements ConstantReflectionProvider
Class Inheritance
All Implemented Interfaces
jdk.vm.ci.meta.ConstantReflectionProvider
Static Imports
jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime

HotSpot implementation of ConstantReflectionProvider.

Field Summary

Modifier and TypeField and Description
private final HotSpotMemoryAccessProviderImpl
protected final HotSpotMethodHandleAccessProvider
protected final HotSpotJVMCIRuntime

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public JavaConstant
asJavaClass(ResolvedJavaType type)

Implements jdk.vm.ci.meta.ConstantReflectionProvider.asJavaClass.

Gets the runtime representation of the Class object of this type.

public ResolvedJavaType
asJavaType(Constant constant)

Implements jdk.vm.ci.meta.ConstantReflectionProvider.asJavaType.

Returns the ResolvedJavaType for a Class object (or any other object regarded as a class by the VM) encapsulated in the given constant.

public Constant
asObjectHub(ResolvedJavaType type)

Implements jdk.vm.ci.meta.ConstantReflectionProvider.asObjectHub.

Gets the runtime representation of the "hub" of this type--that is, the closest part of the type representation which is typically stored in the object header.

public JavaConstant
boxPrimitive(JavaConstant source)

Implements jdk.vm.ci.meta.ConstantReflectionProvider.boxPrimitive.

Converts the given primitive constant to a boxed object constant, according to the Java boxing rules.

public Boolean
constantEquals(Constant x, Constant y)

Implements jdk.vm.ci.meta.ConstantReflectionProvider.constantEquals.

Compares two constants for equality.

public JavaConstant
public JavaConstant
public MemoryAccessProvider
public MethodHandleAccessProvider
private static boolean

Returns:

true if the box is cached
isBoxCached
(JavaConstant source)

Check if the constant is a boxed value that is guaranteed to be cached by the platform.

public JavaConstant
readArrayElement(JavaConstant array, int index)

Implements jdk.vm.ci.meta.ConstantReflectionProvider.readArrayElement.

Reads a value from the given array at the given index.

public Integer
readArrayLength(JavaConstant array)

Implements jdk.vm.ci.meta.ConstantReflectionProvider.readArrayLength.

Returns the length of the array constant.

public JavaConstant
readFieldValue(ResolvedJavaField field, JavaConstant
object from which this field's value is to be read. This value is ignored if this field is static.
receiver
)

Implements jdk.vm.ci.meta.ConstantReflectionProvider.readFieldValue.

Gets the current value of this field for a given object, if available.

public JavaConstant
unboxPrimitive(JavaConstant source)

Implements jdk.vm.ci.meta.ConstantReflectionProvider.unboxPrimitive.

Converts the given object constant to a primitive constant, according to the Java unboxing rules.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

memoryAccessback to summary
private final HotSpotMemoryAccessProviderImpl memoryAccess
methodHandleAccessback to summary
protected final HotSpotMethodHandleAccessProvider methodHandleAccess
runtimeback to summary
protected final HotSpotJVMCIRuntime runtime

Constructor Detail

HotSpotConstantReflectionProviderback to summary
public HotSpotConstantReflectionProvider(HotSpotJVMCIRuntime runtime)

Method Detail

asJavaClassback to summary
public JavaConstant asJavaClass(ResolvedJavaType type)

Implements jdk.vm.ci.meta.ConstantReflectionProvider.asJavaClass.

Doc from jdk.vm.ci.meta.ConstantReflectionProvider.asJavaClass.

Gets the runtime representation of the Class object of this type.

Annotations
@Override
asJavaTypeback to summary
public ResolvedJavaType asJavaType(Constant constant)

Implements jdk.vm.ci.meta.ConstantReflectionProvider.asJavaType.

Doc from jdk.vm.ci.meta.ConstantReflectionProvider.asJavaType.

Returns the ResolvedJavaType for a Class object (or any other object regarded as a class by the VM) encapsulated in the given constant. Returns null if the constant does not encapsulate a class, or if the type is not available at this point.

Annotations
@Override
asObjectHubback to summary
public Constant asObjectHub(ResolvedJavaType type)

Implements jdk.vm.ci.meta.ConstantReflectionProvider.asObjectHub.

Doc from jdk.vm.ci.meta.ConstantReflectionProvider.asObjectHub.

Gets the runtime representation of the "hub" of this type--that is, the closest part of the type representation which is typically stored in the object header.

Annotations
@Override
boxPrimitiveback to summary
public JavaConstant boxPrimitive(JavaConstant source)

Implements jdk.vm.ci.meta.ConstantReflectionProvider.boxPrimitive.

Doc from jdk.vm.ci.meta.ConstantReflectionProvider.boxPrimitive.

Converts the given primitive constant to a boxed object constant, according to the Java boxing rules. Returns null if the source is is not a primitive constant, or the boxed value is not available at this point.

Annotations
@Override
constantEqualsback to summary
public Boolean constantEquals(Constant x, Constant y)

Implements jdk.vm.ci.meta.ConstantReflectionProvider.constantEquals.

Doc from jdk.vm.ci.meta.ConstantReflectionProvider.constantEquals.

Compares two constants for equality. The equality relationship is symmetric. Returns true if the two constants represent the same run time value, false if they are different. Returns null if the constants cannot be compared at this point.

Annotations
@Override
forObjectback to summary
public JavaConstant forObject(Object value)
forStringback to summary
public JavaConstant forString(String value)

Implements jdk.vm.ci.meta.ConstantReflectionProvider.forString.

Doc from jdk.vm.ci.meta.ConstantReflectionProvider.forString.

Gets a string as a JavaConstant.

Annotations
@Override
getMemoryAccessProviderback to summary
public MemoryAccessProvider getMemoryAccessProvider()

Implements jdk.vm.ci.meta.ConstantReflectionProvider.getMemoryAccessProvider.

Doc from jdk.vm.ci.meta.ConstantReflectionProvider.getMemoryAccessProvider.

Gets raw memory access.

Annotations
@Override
getMethodHandleAccessback to summary
public MethodHandleAccessProvider getMethodHandleAccess()

Implements jdk.vm.ci.meta.ConstantReflectionProvider.getMethodHandleAccess.

Doc from jdk.vm.ci.meta.ConstantReflectionProvider.getMethodHandleAccess.

Gets access to the internals of MethodHandle.

Annotations
@Override
isBoxCachedback to summary
private static boolean isBoxCached(JavaConstant source)

Check if the constant is a boxed value that is guaranteed to be cached by the platform. Otherwise the generated code might be the only reference to the boxed value and since object references from nmethods are weak this can cause GC problems.

Returns:boolean

true if the box is cached

readArrayElementback to summary
public JavaConstant readArrayElement(JavaConstant array, int index)

Implements jdk.vm.ci.meta.ConstantReflectionProvider.readArrayElement.

Doc from jdk.vm.ci.meta.ConstantReflectionProvider.readArrayElement.

Reads a value from the given array at the given index. Returns null if the constant is not an array, if the index is out of bounds, or if the value is not available at this point.

Annotations
@Override
readArrayLengthback to summary
public Integer readArrayLength(JavaConstant array)

Implements jdk.vm.ci.meta.ConstantReflectionProvider.readArrayLength.

Doc from jdk.vm.ci.meta.ConstantReflectionProvider.readArrayLength.

Returns the length of the array constant. Returns null if the constant is not an array, or if the array length is not available at this point.

Annotations
@Override
readFieldValueback to summary
public JavaConstant readFieldValue(ResolvedJavaField field, JavaConstant receiver)

Implements jdk.vm.ci.meta.ConstantReflectionProvider.readFieldValue.

Doc from jdk.vm.ci.meta.ConstantReflectionProvider.readFieldValue.

Gets the current value of this field for a given object, if available. There is no guarantee that the same value will be returned by this method for a field unless the field is considered to be constant by the runtime.

Parameters
receiver:JavaConstant

object from which this field's value is to be read. This value is ignored if this field is static.

Returns:JavaConstant

the value of this field or null if the value is not available (e.g., because the field holder is not yet initialized).

Annotations
@Override
unboxPrimitiveback to summary
public JavaConstant unboxPrimitive(JavaConstant source)

Implements jdk.vm.ci.meta.ConstantReflectionProvider.unboxPrimitive.

Doc from jdk.vm.ci.meta.ConstantReflectionProvider.unboxPrimitive.

Converts the given object constant to a primitive constant, according to the Java unboxing rules. Returns null if the source is is not an object constant that can be unboxed, or the unboxed value is not available at this point.

Annotations
@Override