public class HotSpotSnippetReflectionProvider extends Object implements SnippetReflectionProvider
| Modifier and Type | Field and Description |
|---|---|
private ResolvedJavaType |
configType |
private HotSpotGraalRuntimeProvider |
runtime |
private ResolvedJavaType |
runtimeType |
private ResolvedJavaType |
wordTypesType |
| Constructor and Description |
|---|
HotSpotSnippetReflectionProvider(HotSpotGraalRuntimeProvider runtime) |
| 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.
|
Object |
asObject(ResolvedJavaType type,
JavaConstant constant)
Gets the object reference a given constant represents if it is of a given type.
|
JavaConstant |
forBoxed(Kind kind,
Object value)
Creates a boxed constant for the given kind from an Object.
|
JavaConstant |
forObject(Object object)
Creates a boxed
object constant. |
Object |
getInjectedNodeIntrinsicParameter(ResolvedJavaType type)
Gets the value to bind to an injected parameter in a node intrinsic.
|
Object |
getSubstitutionGuardParameter(Class<?> type)
Gets the value to bind to a parameter in a
SubstitutionGuard constructor. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinvoke, newArray, readConstantFieldValue, resolveClassForSnippetprivate final HotSpotGraalRuntimeProvider runtime
private ResolvedJavaType wordTypesType
private ResolvedJavaType runtimeType
private ResolvedJavaType configType
public HotSpotSnippetReflectionProvider(HotSpotGraalRuntimeProvider runtime)
public JavaConstant forObject(Object object)
SnippetReflectionProviderobject constant.forObject in interface SnippetReflectionProviderobject - the object value to boxobjectpublic Object asObject(ResolvedJavaType type, JavaConstant constant)
SnippetReflectionProviderKind.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 if it is an
instance of type otherwise
nullpublic <T> T asObject(Class<T> type, JavaConstant constant)
SnippetReflectionProviderKind.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(Kind kind, Object value)
SnippetReflectionProviderforBoxed in interface SnippetReflectionProviderkind - the kind of the constant to createvalue - the Java boxed value: a Byte instance for Kind.Byte, etc.valuepublic Object getSubstitutionGuardParameter(Class<?> type)
SnippetReflectionProviderSubstitutionGuard constructor.getSubstitutionGuardParameter in interface SnippetReflectionProvidertype - the type of a parameter in a SubstitutionGuard constructorpublic Object getInjectedNodeIntrinsicParameter(ResolvedJavaType type)
SnippetReflectionProvidergetInjectedNodeIntrinsicParameter in interface SnippetReflectionProvidertype - the type of a parameter in a node intrinsic constructor