use of org.graalvm.compiler.truffle.common.hotspot.libgraal.TruffleFromLibGraal.Id in project graal by oracle.
the class TruffleFromLibGraalEntryPoints method checkHotSpotCalls.
/*----------------------*/
/**
* Checks that all {@link TruffleFromLibGraal}s are implemented and that their signatures match
* the {@linkplain Id#getSignature() ID signatures}.
*/
private static boolean checkHotSpotCalls() {
Set<Id> unimplemented = EnumSet.allOf(Id.class);
for (Method method : TruffleFromLibGraalEntryPoints.class.getDeclaredMethods()) {
if (Modifier.isStatic(method.getModifiers())) {
TruffleFromLibGraal a = method.getAnnotation(TruffleFromLibGraal.class);
if (a != null) {
Id id = a.value();
unimplemented.remove(id);
check(id, id.getMethodName().equals(method.getName()), "Expected name \"%s\", got \"%s\"", id.getMethodName(), method.getName());
check(id, id.getReturnType().equals(method.getReturnType()), "Expected return type %s, got %s", id.getReturnType().getName(), method.getReturnType().getName());
checkParameters(id, method.getParameterTypes());
}
}
}
check(null, unimplemented.isEmpty(), "Missing implementations:%n%s", unimplemented.stream().map(TruffleFromLibGraalEntryPoints::missingImpl).sorted().collect(joining(lineSeparator())));
return true;
}
Aggregations