public class HotSpotSnippetReflectionProvider extends Object implements SnippetReflectionProvider
| Constructor and Description |
|---|
HotSpotSnippetReflectionProvider(HotSpotGraalRuntimeProvider runtime,
HotSpotConstantReflectionProvider constantReflection,
WordTypes wordTypes) |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
asObject(Class<T> type,
JavaConstant constant)
Gets the object reference a given constant represents if it is of a given type.
|
JavaConstant |
forBoxed(JavaKind kind,
Object value)
Creates a boxed constant for the given kind from an Object.
|
JavaConstant |
forObject(Object object)
Creates a boxed
object constant. |
<T> T |
getInjectedNodeIntrinsicParameter(Class<T> type)
Gets the value to bind to an injected parameter in a node intrinsic.
|
Class<?> |
originalClass(ResolvedJavaType type)
Get the original Java class corresponding to a
ResolvedJavaType. |
public HotSpotSnippetReflectionProvider(HotSpotGraalRuntimeProvider runtime, HotSpotConstantReflectionProvider constantReflection, WordTypes wordTypes)
public JavaConstant forObject(Object object)
SnippetReflectionProviderobject constant.forObject in interface SnippetReflectionProviderobject - the object value to boxobjectpublic <T> T asObject(Class<T> type, JavaConstant constant)
SnippetReflectionProviderJavaKind.Object.asObject in interface SnippetReflectionProvidertype - the expected type of the object represented by constant. If the object is
required to be of this type, then wrap the call to this method in
Objects.requireNonNull(Object).constant - an object constantconstant cast to type if it is an
instance of type otherwise nullpublic JavaConstant forBoxed(JavaKind kind,
Object value)
SnippetReflectionProviderforBoxed in interface SnippetReflectionProviderkind - the kind of the constant to createvalue - the Java boxed value: a Byte instance for JavaKind.Byte, etc.valuepublic <T> T getInjectedNodeIntrinsicParameter(Class<T> type)
SnippetReflectionProvidergetInjectedNodeIntrinsicParameter in interface SnippetReflectionProvidertype - the type of a parameter in a node intrinsic constructorpublic Class<?> originalClass(ResolvedJavaType type)
SnippetReflectionProviderResolvedJavaType.originalClass in interface SnippetReflectionProvidertype - the type for which the original Java class is requestedtype or null if this object
cannot map ResolvedJavaType instances to Class instances