use of com.oracle.graal.pointsto.util.CompletionExecutor.DebugContextRunnable in project graal by oracle.
the class BigBang method addRootMethod.
@SuppressWarnings("try")
public AnalysisMethod addRootMethod(AnalysisMethod aMethod) {
if (aMethod.isRootMethod()) {
return aMethod;
}
aMethod.registerAsRootMethod();
final MethodTypeFlow methodFlow = aMethod.getTypeFlow();
try (Indent indent = debug.logAndIndent("add root method %s", aMethod.getName())) {
boolean isStatic = Modifier.isStatic(aMethod.getModifiers());
int paramCount = aMethod.getSignature().getParameterCount(!isStatic);
int offset = 0;
if (!isStatic) {
methodFlow.setInitialReceiverFlow(this, aMethod.getDeclaringClass());
offset = 1;
}
for (int i = offset; i < paramCount; i++) {
AnalysisType declaredParamType = (AnalysisType) aMethod.getSignature().getParameterType(i - offset, aMethod.getDeclaringClass());
if (declaredParamType.getJavaKind() == JavaKind.Object) {
methodFlow.setInitialParameterFlow(this, declaredParamType, i);
}
}
}
postTask(new DebugContextRunnable() {
@Override
public void run(DebugContext ignore) {
methodFlow.addContext(BigBang.this, BigBang.this.contextPolicy().emptyContext(), null);
}
@Override
public DebugContext getDebug(OptionValues ignored, List<DebugHandlersFactory> factories) {
return DebugContext.DISABLED;
}
});
return aMethod;
}
Aggregations