本文整理匯總了Java中jdk.vm.ci.meta.ResolvedJavaMethod.getSignature方法的典型用法代碼示例。如果您正苦於以下問題:Java ResolvedJavaMethod.getSignature方法的具體用法?Java ResolvedJavaMethod.getSignature怎麽用?Java ResolvedJavaMethod.getSignature使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類jdk.vm.ci.meta.ResolvedJavaMethod
的用法示例。
在下文中一共展示了ResolvedJavaMethod.getSignature方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createParameterStamps
import jdk.vm.ci.meta.ResolvedJavaMethod; //導入方法依賴的package包/類
public static Stamp[] createParameterStamps(Assumptions assumptions, ResolvedJavaMethod method) {
Signature sig = method.getSignature();
Stamp[] result = new Stamp[sig.getParameterCount(!method.isStatic())];
int index = 0;
if (!method.isStatic()) {
result[index++] = StampFactory.objectNonNull(TypeReference.create(assumptions, method.getDeclaringClass()));
}
int max = sig.getParameterCount(false);
ResolvedJavaType accessingClass = method.getDeclaringClass();
for (int i = 0; i < max; i++) {
JavaType type = sig.getParameterType(i, accessingClass);
JavaKind kind = type.getJavaKind();
Stamp stamp;
if (kind == JavaKind.Object && type instanceof ResolvedJavaType) {
stamp = StampFactory.object(TypeReference.create(assumptions, (ResolvedJavaType) type));
} else {
stamp = StampFactory.forKind(kind);
}
result[index++] = stamp;
}
return result;
}
示例2: getCallingConvention
import jdk.vm.ci.meta.ResolvedJavaMethod; //導入方法依賴的package包/類
/**
* Create a calling convention from a {@link ResolvedJavaMethod}.
*/
public static CallingConvention getCallingConvention(CodeCacheProvider codeCache, CallingConvention.Type type, ResolvedJavaMethod method, ValueKindFactory<?> valueKindFactory) {
Signature sig = method.getSignature();
JavaType retType = sig.getReturnType(null);
int sigCount = sig.getParameterCount(false);
JavaType[] argTypes;
int argIndex = 0;
if (!method.isStatic()) {
argTypes = new JavaType[sigCount + 1];
argTypes[argIndex++] = method.getDeclaringClass();
} else {
argTypes = new JavaType[sigCount];
}
for (int i = 0; i < sigCount; i++) {
argTypes[argIndex++] = sig.getParameterType(i, null);
}
RegisterConfig registerConfig = codeCache.getRegisterConfig();
return registerConfig.getCallingConvention(type, retType, argTypes, valueKindFactory);
}
示例3: signatureEquals
import jdk.vm.ci.meta.ResolvedJavaMethod; //導入方法依賴的package包/類
public boolean signatureEquals(ResolvedJavaMethod m) {
Signature s = m.getSignature();
ResolvedJavaType declaringClass = m.getDeclaringClass();
if (!s.getReturnType(declaringClass).resolve(declaringClass).equals(metaAccess.lookupJavaType(returnType))) {
return false;
}
if (s.getParameterCount(false) != parameterTypes.length) {
return false;
}
for (int i = 0; i < parameterTypes.length; i++) {
if (!s.getParameterType(i, declaringClass).resolve(declaringClass).equals(metaAccess.lookupJavaType(parameterTypes[i]))) {
return false;
}
}
return true;
}
示例4: isEqualsMethod
import jdk.vm.ci.meta.ResolvedJavaMethod; //導入方法依賴的package包/類
private static boolean isEqualsMethod(ResolvedJavaMethod method) {
if (method.getName().equals("equals")) {
Signature sig = method.getSignature();
if (sig.getReturnKind() == JavaKind.Boolean) {
if (sig.getParameterCount(false) == 1) {
ResolvedJavaType ptype = (ResolvedJavaType) sig.getParameterType(0, method.getDeclaringClass());
if (ptype.isJavaLangObject()) {
return true;
}
}
}
}
return false;
}
示例5: methodSignature
import jdk.vm.ci.meta.ResolvedJavaMethod; //導入方法依賴的package包/類
@Override
public Signature methodSignature(ResolvedJavaMethod method) {
return method.getSignature();
}