public class HotSpotSignature extends Object implements Signature
Modifier and Type | Field and Description |
---|---|
private String |
originalString |
private List<String> |
parameters |
private ResolvedJavaType[] |
parameterTypes |
private String |
returnType |
private ResolvedJavaType |
returnTypeCache |
private HotSpotJVMCIRuntimeProvider |
runtime |
Constructor and Description |
---|
HotSpotSignature(HotSpotJVMCIRuntimeProvider runtime,
ResolvedJavaType returnType,
ResolvedJavaType... parameterTypes) |
HotSpotSignature(HotSpotJVMCIRuntimeProvider runtime,
String signature) |
Modifier and Type | Method and Description |
---|---|
private static boolean |
checkValidCache(ResolvedJavaType type,
ResolvedJavaType accessingClass) |
boolean |
equals(Object obj) |
int |
getParameterCount(boolean withReceiver)
Returns the number of parameters in this signature, adding 1 for a receiver if requested.
|
Kind |
getParameterKind(int index)
Gets the parameter kind at the specified position.
|
JavaType |
getParameterType(int index,
ResolvedJavaType accessingClass)
Gets the parameter type at the specified position.
|
Kind |
getReturnKind()
Gets the return kind of this signature.
|
JavaType |
getReturnType(ResolvedJavaType accessingClass)
Gets the return type of this signature.
|
private static JavaType |
getUnresolvedOrPrimitiveType(HotSpotJVMCIRuntimeProvider runtime,
String name) |
int |
hashCode() |
private static int |
parseSignature(String signature,
int start) |
String |
toMethodDescriptor()
Gets the method
descriptor corresponding to this signature.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
toParameterKinds, toParameterTypes
private final List<String> parameters
private final String returnType
private final String originalString
private ResolvedJavaType[] parameterTypes
private ResolvedJavaType returnTypeCache
private final HotSpotJVMCIRuntimeProvider runtime
public HotSpotSignature(HotSpotJVMCIRuntimeProvider runtime, String signature)
public HotSpotSignature(HotSpotJVMCIRuntimeProvider runtime, ResolvedJavaType returnType, ResolvedJavaType... parameterTypes)
private static int parseSignature(String signature, int start)
public int getParameterCount(boolean withReceiver)
Signature
getParameterCount
in interface Signature
withReceiver
- true if 1 is to be added to the result for a receiverreceiver == true
public Kind getParameterKind(int index)
Signature
Signature.getParameterType(int, jdk.internal.jvmci.meta.ResolvedJavaType)
. getKind
.getParameterKind
in interface Signature
index
- the index into the parameters, with 0
indicating the first parameterprivate static boolean checkValidCache(ResolvedJavaType type, ResolvedJavaType accessingClass)
private static JavaType getUnresolvedOrPrimitiveType(HotSpotJVMCIRuntimeProvider runtime, String name)
public JavaType getParameterType(int index, ResolvedJavaType accessingClass)
Signature
getParameterType
in interface Signature
index
- the index into the parameters, with 0
indicating the first parameteraccessingClass
- the context of the type lookup. If non-null, its class loader is used
for resolving the type. If null
, then the type returned is either
unresolved or a resolved type whose resolution is context free (e.g., a primitive
type or a type in a java.* package).index
'th parameter typepublic String toMethodDescriptor()
Signature
(ILjava/lang/String;D)V
toMethodDescriptor
in interface Signature
public Kind getReturnKind()
Signature
Signature.getReturnType(jdk.internal.jvmci.meta.ResolvedJavaType)
.
getKind
.getReturnKind
in interface Signature
public JavaType getReturnType(ResolvedJavaType accessingClass)
Signature
getReturnType
in interface Signature
accessingClass
- the context of the type lookup. If non-null, its class loader is used
for resolving the type. If null
, then the type returned is either
unresolved or a resolved type whose resolution is context free (e.g., a primitive
type or a type in a java.* package).