Search in sources :

Example 6 with DebugHandlersFactory

use of org.graalvm.compiler.debug.DebugHandlersFactory 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;
}
Also used : AnalysisType(com.oracle.graal.pointsto.meta.AnalysisType) Indent(org.graalvm.compiler.debug.Indent) OptionValues(org.graalvm.compiler.options.OptionValues) DebugHandlersFactory(org.graalvm.compiler.debug.DebugHandlersFactory) GraalDebugHandlersFactory(org.graalvm.compiler.printer.GraalDebugHandlersFactory) DebugContext(org.graalvm.compiler.debug.DebugContext) DebugContextRunnable(com.oracle.graal.pointsto.util.CompletionExecutor.DebugContextRunnable) MethodTypeFlow(com.oracle.graal.pointsto.flow.MethodTypeFlow)

Aggregations

DebugHandlersFactory (org.graalvm.compiler.debug.DebugHandlersFactory)6 GraalDebugHandlersFactory (org.graalvm.compiler.printer.GraalDebugHandlersFactory)4 DebugContext (org.graalvm.compiler.debug.DebugContext)3 ArrayList (java.util.ArrayList)2 OptionValues (org.graalvm.compiler.options.OptionValues)2 MethodTypeFlow (com.oracle.graal.pointsto.flow.MethodTypeFlow)1 AnalysisType (com.oracle.graal.pointsto.meta.AnalysisType)1 HostedProviders (com.oracle.graal.pointsto.meta.HostedProviders)1 DebugContextRunnable (com.oracle.graal.pointsto.util.CompletionExecutor.DebugContextRunnable)1 SubstrateForeignCallLinkage (com.oracle.svm.core.graal.meta.SubstrateForeignCallLinkage)1 SubstrateForeignCallsProvider (com.oracle.svm.core.graal.meta.SubstrateForeignCallsProvider)1 SubstrateLoweringProvider (com.oracle.svm.core.graal.meta.SubstrateLoweringProvider)1 SubstrateReplacements (com.oracle.svm.core.graal.meta.SubstrateReplacements)1 NodeLoweringProvider (com.oracle.svm.core.graal.snippets.NodeLoweringProvider)1 StackValueNode (com.oracle.svm.core.graal.stackvalue.StackValueNode)1 HostedOptionValues (com.oracle.svm.core.option.HostedOptionValues)1 RuntimeOptionValues (com.oracle.svm.core.option.RuntimeOptionValues)1 SubstrateForeignCallDescriptor (com.oracle.svm.core.snippets.SnippetRuntime.SubstrateForeignCallDescriptor)1 TargetDescription (jdk.vm.ci.code.TargetDescription)1 InitTimer (jdk.vm.ci.common.InitTimer)1