use of jdk.vm.ci.meta.ResolvedJavaMethod in project graal by oracle.
the class ProfilingInfoTest method resetProfile.
private void resetProfile(String methodName) {
ResolvedJavaMethod javaMethod = getResolvedJavaMethod(methodName);
javaMethod.reprofile();
}
use of jdk.vm.ci.meta.ResolvedJavaMethod in project graal by oracle.
the class ObjectTreePrinter method forScannedConstant.
@Override
protected void forScannedConstant(JavaConstant scannedValue, Object reason) {
JVMCIError.guarantee(scannedValue != null, "scannedValue is null");
constantToNode.computeIfAbsent(scannedValue, c -> {
ObjectNodeBase node;
if (reason instanceof ResolvedJavaField) {
ResolvedJavaField field = (ResolvedJavaField) reason;
if (field.isStatic()) {
node = ObjectNodeBase.fromConstant(bb, scannedValue, new RootSource(field));
} else {
node = ObjectNodeBase.fromConstant(bb, scannedValue);
}
} else if (reason instanceof ResolvedJavaMethod) {
ResolvedJavaMethod method = (ResolvedJavaMethod) reason;
node = ObjectNodeBase.fromConstant(bb, scannedValue, new RootSource(method));
} else {
node = ObjectNodeBase.fromConstant(bb, scannedValue);
}
return node;
});
}
use of jdk.vm.ci.meta.ResolvedJavaMethod in project graal by oracle.
the class StaticAnalysisResultsBuilder method createMethodProfile.
private JavaMethodProfile createMethodProfile(Collection<AnalysisMethod> callees) {
ProfiledMethod[] pitems = new ProfiledMethod[callees.size()];
double probability = 1d / pitems.length;
int idx = 0;
for (AnalysisMethod aMethod : callees) {
ResolvedJavaMethod convertedMethod = converter == null ? aMethod : converter.lookup(aMethod);
pitems[idx++] = new ProfiledMethod(convertedMethod, probability);
}
return new JavaMethodProfile(0, pitems);
}
use of jdk.vm.ci.meta.ResolvedJavaMethod in project graal by oracle.
the class AnalysisType method resolveMethod.
@Override
public AnalysisMethod resolveMethod(ResolvedJavaMethod method, ResolvedJavaType callerType) {
Object resolvedMethod = resolvedMethods.get(method);
if (resolvedMethod == null) {
ResolvedJavaMethod substMethod = universe.substitutions.resolve(((AnalysisMethod) method).wrapped);
/*
* We do not want any access checks to be performed, so we use the method's declaring
* class as the caller type.
*/
ResolvedJavaType substCallerType = substMethod.getDeclaringClass();
Object newResolvedMethod = universe.lookup(wrapped.resolveMethod(substMethod, substCallerType));
if (newResolvedMethod == null) {
newResolvedMethod = NULL_METHOD;
}
Object oldResolvedMethod = resolvedMethods.putIfAbsent(method, newResolvedMethod);
resolvedMethod = oldResolvedMethod != null ? oldResolvedMethod : newResolvedMethod;
}
return resolvedMethod == NULL_METHOD ? null : (AnalysisMethod) resolvedMethod;
}
use of jdk.vm.ci.meta.ResolvedJavaMethod in project graal by oracle.
the class AnalysisUniverse method lookupAllowUnresolved.
@Override
public JavaMethod lookupAllowUnresolved(JavaMethod rawMethod) {
if (rawMethod == null) {
return null;
}
if (!(rawMethod instanceof ResolvedJavaMethod)) {
return rawMethod;
}
assert !(rawMethod instanceof AnalysisMethod);
ResolvedJavaMethod method = (ResolvedJavaMethod) rawMethod;
method = substitutions.lookup(method);
AnalysisMethod result = methods.get(method);
if (result == null) {
result = createMethod(method);
}
return result;
}
Aggregations