Search in sources :

Example 16 with HostedMethod

use of com.oracle.svm.hosted.meta.HostedMethod in project graal by oracle.

the class CompileQueue method defaultCompileFunction.

@SuppressWarnings("try")
private CompilationResult defaultCompileFunction(DebugContext debug, HostedMethod method, CompilationIdentifier compilationIdentifier, CompileReason reason, RuntimeConfiguration config) {
    if (NativeImageOptions.PrintAOTCompilation.getValue()) {
        System.out.println("Compiling " + method.format("%r %H.%n(%p)") + "  [" + reason + "]");
    }
    Backend backend = config.lookupBackend(method);
    StructuredGraph graph = method.compilationInfo.graph;
    assert graph != null : method;
    /* Operate on a copy, to keep the original graph intact for later inlining. */
    graph = graph.copyWithIdentifier(compilationIdentifier, debug);
    /* Check that graph is in good shape before compilation. */
    assert GraphOrder.assertSchedulableGraph(graph);
    try (DebugContext.Scope s = debug.scope("Compiling", graph, method, this)) {
        if (deoptimizeAll && method.compilationInfo.canDeoptForTesting) {
            insertDeoptTests(method, graph);
        }
        method.compilationInfo.numNodesBeforeCompilation = graph.getNodeCount();
        method.compilationInfo.numDeoptEntryPoints = graph.getNodes().filter(DeoptEntryNode.class).count();
        method.compilationInfo.numDuringCallEntryPoints = graph.getNodes(MethodCallTargetNode.TYPE).snapshot().stream().map(MethodCallTargetNode::invoke).filter(invoke -> method.compilationInfo.isDeoptEntry(invoke.bci(), true, false)).count();
        Suites suites = method.compilationInfo.isDeoptTarget() ? deoptTargetSuites : regularSuites;
        LIRSuites lirSuites = method.compilationInfo.isDeoptTarget() ? deoptTargetLIRSuites : regularLIRSuites;
        CompilationResult result = new CompilationResult(compilationIdentifier, method.format("%H.%n(%p)")) {

            @Override
            public void close() {
            /*
                     * Do nothing, we do not want our CompilationResult to be closed because we
                     * aggregate all data items and machine code in the native image heap.
                     */
            }
        };
        try (Indent indent = debug.logAndIndent("compile %s", method)) {
            GraalCompiler.compileGraph(graph, method, backend.getProviders(), backend, null, optimisticOpts, method.getProfilingInfo(), suites, lirSuites, result, new HostedCompilationResultBuilderFactory());
        }
        method.getProfilingInfo().setCompilerIRSize(StructuredGraph.class, method.compilationInfo.graph.getNodeCount());
        method.compilationInfo.numNodesAfterCompilation = graph.getNodeCount();
        if (method.compilationInfo.isDeoptTarget()) {
            assert verifyDeoptTarget(method, result);
        }
        for (Infopoint infopoint : result.getInfopoints()) {
            if (infopoint instanceof Call) {
                Call call = (Call) infopoint;
                HostedMethod callTarget = (HostedMethod) call.target;
                if (call.direct) {
                    ensureCompiled(callTarget, new DirectCallReason(method, reason));
                } else if (callTarget != null && callTarget.getImplementations() != null) {
                    for (HostedMethod impl : callTarget.getImplementations()) {
                        ensureCompiled(impl, new VirtualCallReason(method, callTarget, reason));
                    }
                }
            }
        }
        /* Shrink resulting code array to minimum size, to reduze memory footprint. */
        if (result.getTargetCode().length > result.getTargetCodeSize()) {
            result.setTargetCode(Arrays.copyOf(result.getTargetCode(), result.getTargetCodeSize()), result.getTargetCodeSize());
        }
        return result;
    } catch (Throwable ex) {
        GraalError error = ex instanceof GraalError ? (GraalError) ex : new GraalError(ex);
        error.addContext("method: " + method.format("%r %H.%n(%p)") + "  [" + reason + "]");
        throw error;
    }
}
Also used : Call(jdk.vm.ci.code.site.Call) Indent(org.graalvm.compiler.debug.Indent) DeoptEntryInfopoint(com.oracle.svm.core.deopt.DeoptEntryInfopoint) Infopoint(jdk.vm.ci.code.site.Infopoint) DebugContext(org.graalvm.compiler.debug.DebugContext) Backend(org.graalvm.compiler.core.target.Backend) StructuredGraph(org.graalvm.compiler.nodes.StructuredGraph) GraalError(org.graalvm.compiler.debug.GraalError) HostedMethod(com.oracle.svm.hosted.meta.HostedMethod) LIRSuites(org.graalvm.compiler.lir.phases.LIRSuites) CompilationResult(org.graalvm.compiler.code.CompilationResult) LIRSuites(org.graalvm.compiler.lir.phases.LIRSuites) Suites(org.graalvm.compiler.phases.tiers.Suites)

Example 17 with HostedMethod

use of com.oracle.svm.hosted.meta.HostedMethod in project graal by oracle.

the class CompileQueue method canBeUsedForInlining.

protected boolean canBeUsedForInlining(Invoke invoke) {
    HostedMethod caller = (HostedMethod) invoke.asNode().graph().method();
    HostedMethod callee = (HostedMethod) invoke.callTarget().targetMethod();
    if (canDeoptForTesting(caller) && Modifier.isNative(callee.getModifiers())) {
        /*
             * We must not deoptimize in the stubs for native functions, since they don't have a
             * valid bytecode state.
             */
        return false;
    }
    if (canDeoptForTesting(caller) && universe.getMethodsWithStackValues().contains(callee.wrapped)) {
        /*
             * We must not inline a method that has stack values and can be deoptimized.
             */
        return false;
    }
    if (caller.compilationInfo.isDeoptTarget()) {
        if (caller.compilationInfo.isDeoptEntry(invoke.bci(), true, false)) {
            /*
                 * The call can be on the stack for a deoptimization, so we need an actual
                 * non-inlined invoke to deoptimize too.
                 *
                 * We could lift this restriction by providing an explicit deopt entry point (with
                 * the correct exception handling edges) in addition to the inlined method.
                 */
            return false;
        }
        if (CompilationInfoSupport.singleton().isDeoptInliningExclude(callee)) {
            /*
                 * The graphs for runtime compilation have an intrinisic for the callee, which might
                 * alter the behavior. Be safe and do not inline, otherwise we might optimize too
                 * aggressively.
                 *
                 * For example, the Truffle method CompilerDirectives.inCompiledCode is
                 * intrinisified to return a constant with the opposite value than returned by the
                 * method we would inline here, i.e., we would constant-fold away the compiled-code
                 * only code (which is the code we need deoptimization entry points for).
                 */
            return false;
        }
    }
    if (callee.getAnnotation(Specialize.class) != null) {
        return false;
    }
    if (callerAnnotatedWith(invoke, Specialize.class) && callee.getAnnotation(DeoptTest.class) != null) {
        return false;
    }
    Uninterruptible calleeUninterruptible = callee.getAnnotation(Uninterruptible.class);
    if (calleeUninterruptible != null && !calleeUninterruptible.mayBeInlined() && caller.getAnnotation(Uninterruptible.class) == null) {
        return false;
    }
    if (!mustNotAllocateCallee(caller) && mustNotAllocate(callee)) {
        return false;
    }
    if (isNotExecuted(caller) || isNotExecuted(callee)) {
        return false;
    }
    if (!callee.canBeInlined()) {
        return false;
    }
    return invoke.useForInlining();
}
Also used : Uninterruptible(com.oracle.svm.core.annotate.Uninterruptible) HostedMethod(com.oracle.svm.hosted.meta.HostedMethod) Specialize(com.oracle.svm.core.annotate.Specialize)

Example 18 with HostedMethod

use of com.oracle.svm.hosted.meta.HostedMethod in project graal by oracle.

the class CompileQueue method printMethodHistogram.

private void printMethodHistogram() {
    long sizeAllMethods = 0;
    long sizeDeoptMethods = 0;
    long sizeDeoptMethodsInNonDeopt = 0;
    long sizeNonDeoptMethods = 0;
    int numberOfMethods = 0;
    int numberOfNonDeopt = 0;
    int numberOfDeopt = 0;
    long totalNumDeoptEntryPoints = 0;
    long totalNumDuringCallEntryPoints = 0;
    System.out.format("Code Size; Nodes Before; Nodes After; Is Trivial;" + " Deopt Target; Code Size; Nodes Before; Nodes After; Deopt Entries; Deopt During Call;" + " Entry Points; Direct Calls; Virtual Calls; Method\n");
    List<CompileTask> tasks = new ArrayList<>(compilations.values());
    tasks.sort(Comparator.comparing(t2 -> t2.method.format("%H.%n(%p) %r")));
    for (CompileTask task : tasks) {
        HostedMethod method = task.method;
        CompilationResult result = task.result;
        CompilationInfo ci = method.compilationInfo;
        if (!ci.isDeoptTarget()) {
            numberOfMethods += 1;
            sizeAllMethods += result.getTargetCodeSize();
            System.out.format("%8d; %5d; %5d; %s;", result.getTargetCodeSize(), ci.numNodesBeforeCompilation, ci.numNodesAfterCompilation, ci.isTrivialMethod ? "T" : " ");
            int deoptMethodSize = 0;
            if (ci.deoptTarget != null) {
                CompilationInfo dci = ci.deoptTarget.compilationInfo;
                numberOfDeopt += 1;
                deoptMethodSize = compilations.get(ci.deoptTarget).result.getTargetCodeSize();
                sizeDeoptMethods += deoptMethodSize;
                sizeDeoptMethodsInNonDeopt += result.getTargetCodeSize();
                totalNumDeoptEntryPoints += dci.numDeoptEntryPoints;
                totalNumDuringCallEntryPoints += dci.numDuringCallEntryPoints;
                System.out.format(" D; %6d; %5d; %5d; %4d; %4d;", deoptMethodSize, dci.numNodesBeforeCompilation, dci.numNodesAfterCompilation, dci.numDeoptEntryPoints, dci.numDuringCallEntryPoints);
            } else {
                sizeNonDeoptMethods += result.getTargetCodeSize();
                numberOfNonDeopt += 1;
                System.out.format("  ; %6d; %5d; %5d; %4d; %4d;", 0, 0, 0, 0, 0);
            }
            System.out.format(" %4d; %4d; %4d; %s\n", task.allReasons.stream().filter(t -> t instanceof EntryPointReason).count(), task.allReasons.stream().filter(t -> t instanceof DirectCallReason).count(), task.allReasons.stream().filter(t -> t instanceof VirtualCallReason).count(), method.format("%H.%n(%p) %r"));
        }
    }
    System.out.println();
    System.out.println("Size all methods                           ; " + sizeAllMethods);
    System.out.println("Size deopt methods                         ; " + sizeDeoptMethods);
    System.out.println("Size deopt methods in non-deopt mode       ; " + sizeDeoptMethodsInNonDeopt);
    System.out.println("Size non-deopt method                      ; " + sizeNonDeoptMethods);
    System.out.println("Number of methods                          ; " + numberOfMethods);
    System.out.println("Number of non-deopt methods                ; " + numberOfNonDeopt);
    System.out.println("Number of deopt methods                    ; " + numberOfDeopt);
    System.out.println("Number of deopt entry points               ; " + totalNumDeoptEntryPoints);
    System.out.println("Number of deopt during calls entries       ; " + totalNumDuringCallEntryPoints);
}
Also used : HostedProviders(com.oracle.graal.pointsto.meta.HostedProviders) Arrays(java.util.Arrays) SubstrateOptions(com.oracle.svm.core.SubstrateOptions) StackValueNode(com.oracle.svm.core.graal.stackvalue.StackValueNode) CompletionExecutor(com.oracle.graal.pointsto.util.CompletionExecutor) GraalCompiler(org.graalvm.compiler.core.GraalCompiler) NativeImageOptions(com.oracle.svm.hosted.NativeImageOptions) Map(java.util.Map) MethodCallTargetNode(org.graalvm.compiler.nodes.java.MethodCallTargetNode) LIRSuites(org.graalvm.compiler.lir.phases.LIRSuites) DeoptEntryInfopoint(com.oracle.svm.core.deopt.DeoptEntryInfopoint) RuntimeConfiguration(com.oracle.svm.core.graal.meta.RuntimeConfiguration) Specialize(com.oracle.svm.core.annotate.Specialize) Fold(org.graalvm.compiler.api.replacements.Fold) Uninterruptible(com.oracle.svm.core.annotate.Uninterruptible) CompilationResultBuilderFactory(org.graalvm.compiler.lir.asm.CompilationResultBuilderFactory) DeoptTest(com.oracle.svm.core.annotate.DeoptTest) FrameState(org.graalvm.compiler.nodes.FrameState) Purpose(com.oracle.graal.pointsto.infrastructure.GraphProvider.Purpose) StrengthenStampsPhase(com.oracle.svm.hosted.phases.StrengthenStampsPhase) InterruptImageBuilding(com.oracle.svm.core.util.InterruptImageBuilding) LowTierContext(org.graalvm.compiler.phases.tiers.LowTierContext) LinearScanPhase(org.graalvm.compiler.lir.alloc.lsra.LinearScanPhase) CodeCacheProvider(jdk.vm.ci.code.CodeCacheProvider) HostedOptionValues(com.oracle.svm.core.option.HostedOptionValues) GraphBuilderConfiguration(org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration) StopTimer(com.oracle.graal.pointsto.util.Timer.StopTimer) GuardsStage(org.graalvm.compiler.nodes.StructuredGraph.GuardsStage) GraalOptions(org.graalvm.compiler.core.common.GraalOptions) StateSplit(org.graalvm.compiler.nodes.StateSplit) RestrictHeapAccess(com.oracle.svm.core.annotate.RestrictHeapAccess) ConstantNode(org.graalvm.compiler.nodes.ConstantNode) Description(org.graalvm.compiler.debug.DebugContext.Description) Backend(org.graalvm.compiler.core.target.Backend) OptimisticOptimizations(org.graalvm.compiler.phases.OptimisticOptimizations) GraalConfiguration(com.oracle.svm.core.graal.GraalConfiguration) ArrayList(java.util.ArrayList) FrameContext(org.graalvm.compiler.lir.asm.FrameContext) DeadStoreRemovalPhase(com.oracle.svm.core.graal.phases.DeadStoreRemovalPhase) CompilationResult(org.graalvm.compiler.code.CompilationResult) Verbosity(org.graalvm.compiler.core.common.CompilationIdentifier.Verbosity) PhaseContext(org.graalvm.compiler.phases.tiers.PhaseContext) InvocationPlugin(org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin) HighTierContext(org.graalvm.compiler.phases.tiers.HighTierContext) GraphOrder(org.graalvm.compiler.phases.util.GraphOrder) DeoptTestNode(com.oracle.svm.core.graal.nodes.DeoptTestNode) FixedNode(org.graalvm.compiler.nodes.FixedNode) DevirtualizeCallsPhase(com.oracle.svm.hosted.phases.DevirtualizeCallsPhase) DebugContextRunnable(com.oracle.graal.pointsto.util.CompletionExecutor.DebugContextRunnable) Suites(org.graalvm.compiler.phases.tiers.Suites) CompilationResultBuilder(org.graalvm.compiler.lir.asm.CompilationResultBuilder) AlwaysInlineAllCallees(com.oracle.svm.core.annotate.AlwaysInlineAllCallees) StructuredGraph(org.graalvm.compiler.nodes.StructuredGraph) TreeMap(java.util.TreeMap) ForkJoinPool(java.util.concurrent.ForkJoinPool) Indent(org.graalvm.compiler.debug.Indent) DataBuilder(org.graalvm.compiler.lir.asm.DataBuilder) ForeignCallNode(org.graalvm.compiler.nodes.extended.ForeignCallNode) PartialEscapePhase(org.graalvm.compiler.virtual.phases.ea.PartialEscapePhase) Providers(org.graalvm.compiler.phases.util.Providers) EarlyReadEliminationPhase(org.graalvm.compiler.virtual.phases.ea.EarlyReadEliminationPhase) BytecodeFrame(jdk.vm.ci.code.BytecodeFrame) Constant(jdk.vm.ci.meta.Constant) FeatureHandler(com.oracle.svm.hosted.FeatureHandler) NodeIntrinsic(org.graalvm.compiler.graph.Node.NodeIntrinsic) HostedUniverse(com.oracle.svm.hosted.meta.HostedUniverse) CompilationIdentifier(org.graalvm.compiler.core.common.CompilationIdentifier) EconomicMap(org.graalvm.collections.EconomicMap) ForeignCallsProvider(org.graalvm.compiler.core.common.spi.ForeignCallsProvider) Infopoint(jdk.vm.ci.code.site.Infopoint) PhaseSuite(org.graalvm.compiler.phases.PhaseSuite) DeoptEntryNode(com.oracle.svm.core.graal.nodes.DeoptEntryNode) DebugInfo(jdk.vm.ci.code.DebugInfo) DeletedMethod(com.oracle.svm.hosted.substitute.DeletedMethod) ResolvedJavaMethodBytecode(org.graalvm.compiler.bytecode.ResolvedJavaMethodBytecode) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) RedundantMoveElimination(org.graalvm.compiler.lir.RedundantMoveElimination) VMError(com.oracle.svm.core.util.VMError) Objects(java.util.Objects) Bytecode(org.graalvm.compiler.bytecode.Bytecode) ValueNode(org.graalvm.compiler.nodes.ValueNode) List(java.util.List) FrameInfoEncoder(com.oracle.svm.core.code.FrameInfoEncoder) Modifier(java.lang.reflect.Modifier) SnippetReflectionProvider(org.graalvm.compiler.api.replacements.SnippetReflectionProvider) Annotation(java.lang.annotation.Annotation) Entry(java.util.Map.Entry) GraalError(org.graalvm.compiler.debug.GraalError) FixReadsPhase(org.graalvm.compiler.phases.common.FixReadsPhase) DataSection(org.graalvm.compiler.code.DataSection) StartNode(org.graalvm.compiler.nodes.StartNode) CanonicalizerPhase(org.graalvm.compiler.phases.common.CanonicalizerPhase) HashMap(java.util.HashMap) ConcurrentMap(java.util.concurrent.ConcurrentMap) InliningUtil(org.graalvm.compiler.phases.common.inlining.InliningUtil) HostedGraphBuilderPhase(com.oracle.svm.hosted.phases.HostedGraphBuilderPhase) Assembler(org.graalvm.compiler.asm.Assembler) SubstrateIntrinsicGraphBuilder(com.oracle.graal.pointsto.phases.SubstrateIntrinsicGraphBuilder) DebugContext(org.graalvm.compiler.debug.DebugContext) FrameMap(org.graalvm.compiler.lir.framemap.FrameMap) InvokeNode(org.graalvm.compiler.nodes.InvokeNode) HostedMethod(com.oracle.svm.hosted.meta.HostedMethod) ParameterNode(org.graalvm.compiler.nodes.ParameterNode) NativeImageGenerator(com.oracle.svm.hosted.NativeImageGenerator) NeverInlineTrivial(com.oracle.svm.core.annotate.NeverInlineTrivial) OptionValues(org.graalvm.compiler.options.OptionValues) SubstrateForeignCallsProvider(com.oracle.svm.core.graal.meta.SubstrateForeignCallsProvider) BytecodeExceptionMode(org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.BytecodeExceptionMode) ImageSingletons(org.graalvm.nativeimage.ImageSingletons) Timer(com.oracle.graal.pointsto.util.Timer) FloatingReadPhase(org.graalvm.compiler.phases.common.FloatingReadPhase) MidTierContext(org.graalvm.compiler.phases.tiers.MidTierContext) DeoptTester(com.oracle.svm.core.deopt.DeoptTester) InfopointReason(jdk.vm.ci.code.site.InfopointReason) Invoke(org.graalvm.compiler.nodes.Invoke) Call(jdk.vm.ci.code.site.Call) Node(org.graalvm.compiler.graph.Node) Comparator(java.util.Comparator) Collections(java.util.Collections) FixedWithNextNode(org.graalvm.compiler.nodes.FixedWithNextNode) ArrayList(java.util.ArrayList) HostedMethod(com.oracle.svm.hosted.meta.HostedMethod) CompilationResult(org.graalvm.compiler.code.CompilationResult) DeoptEntryInfopoint(com.oracle.svm.core.deopt.DeoptEntryInfopoint) Infopoint(jdk.vm.ci.code.site.Infopoint)

Example 19 with HostedMethod

use of com.oracle.svm.hosted.meta.HostedMethod in project graal by oracle.

the class CompileQueue method parseAheadOfTimeCompiledMethods.

/**
 * Regular compiled methods. Only entry points and manually marked methods are compiled, all
 * transitively reachable methods are then identified by looking at the callees of already
 * parsed methods.
 */
private void parseAheadOfTimeCompiledMethods() {
    universe.getMethods().stream().filter(method -> method.isEntryPoint() || CompilationInfoSupport.singleton().isForcedCompilation(method)).forEach(method -> ensureParsed(method, new EntryPointReason()));
    SubstrateForeignCallsProvider foreignCallsProvider = (SubstrateForeignCallsProvider) runtimeConfig.getProviders().getForeignCalls();
    foreignCallsProvider.getForeignCalls().keySet().stream().map(descriptor -> (HostedMethod) descriptor.findMethod(runtimeConfig.getProviders().getMetaAccess())).filter(method -> method.wrapped.isRootMethod()).forEach(method -> ensureParsed(method, new EntryPointReason()));
}
Also used : HostedProviders(com.oracle.graal.pointsto.meta.HostedProviders) Arrays(java.util.Arrays) SubstrateOptions(com.oracle.svm.core.SubstrateOptions) StackValueNode(com.oracle.svm.core.graal.stackvalue.StackValueNode) CompletionExecutor(com.oracle.graal.pointsto.util.CompletionExecutor) GraalCompiler(org.graalvm.compiler.core.GraalCompiler) NativeImageOptions(com.oracle.svm.hosted.NativeImageOptions) Map(java.util.Map) MethodCallTargetNode(org.graalvm.compiler.nodes.java.MethodCallTargetNode) LIRSuites(org.graalvm.compiler.lir.phases.LIRSuites) DeoptEntryInfopoint(com.oracle.svm.core.deopt.DeoptEntryInfopoint) RuntimeConfiguration(com.oracle.svm.core.graal.meta.RuntimeConfiguration) Specialize(com.oracle.svm.core.annotate.Specialize) Fold(org.graalvm.compiler.api.replacements.Fold) Uninterruptible(com.oracle.svm.core.annotate.Uninterruptible) CompilationResultBuilderFactory(org.graalvm.compiler.lir.asm.CompilationResultBuilderFactory) DeoptTest(com.oracle.svm.core.annotate.DeoptTest) FrameState(org.graalvm.compiler.nodes.FrameState) Purpose(com.oracle.graal.pointsto.infrastructure.GraphProvider.Purpose) StrengthenStampsPhase(com.oracle.svm.hosted.phases.StrengthenStampsPhase) InterruptImageBuilding(com.oracle.svm.core.util.InterruptImageBuilding) LowTierContext(org.graalvm.compiler.phases.tiers.LowTierContext) LinearScanPhase(org.graalvm.compiler.lir.alloc.lsra.LinearScanPhase) CodeCacheProvider(jdk.vm.ci.code.CodeCacheProvider) HostedOptionValues(com.oracle.svm.core.option.HostedOptionValues) GraphBuilderConfiguration(org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration) StopTimer(com.oracle.graal.pointsto.util.Timer.StopTimer) GuardsStage(org.graalvm.compiler.nodes.StructuredGraph.GuardsStage) GraalOptions(org.graalvm.compiler.core.common.GraalOptions) StateSplit(org.graalvm.compiler.nodes.StateSplit) RestrictHeapAccess(com.oracle.svm.core.annotate.RestrictHeapAccess) ConstantNode(org.graalvm.compiler.nodes.ConstantNode) Description(org.graalvm.compiler.debug.DebugContext.Description) Backend(org.graalvm.compiler.core.target.Backend) OptimisticOptimizations(org.graalvm.compiler.phases.OptimisticOptimizations) GraalConfiguration(com.oracle.svm.core.graal.GraalConfiguration) ArrayList(java.util.ArrayList) FrameContext(org.graalvm.compiler.lir.asm.FrameContext) DeadStoreRemovalPhase(com.oracle.svm.core.graal.phases.DeadStoreRemovalPhase) CompilationResult(org.graalvm.compiler.code.CompilationResult) Verbosity(org.graalvm.compiler.core.common.CompilationIdentifier.Verbosity) PhaseContext(org.graalvm.compiler.phases.tiers.PhaseContext) InvocationPlugin(org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin) HighTierContext(org.graalvm.compiler.phases.tiers.HighTierContext) GraphOrder(org.graalvm.compiler.phases.util.GraphOrder) DeoptTestNode(com.oracle.svm.core.graal.nodes.DeoptTestNode) FixedNode(org.graalvm.compiler.nodes.FixedNode) DevirtualizeCallsPhase(com.oracle.svm.hosted.phases.DevirtualizeCallsPhase) DebugContextRunnable(com.oracle.graal.pointsto.util.CompletionExecutor.DebugContextRunnable) Suites(org.graalvm.compiler.phases.tiers.Suites) CompilationResultBuilder(org.graalvm.compiler.lir.asm.CompilationResultBuilder) AlwaysInlineAllCallees(com.oracle.svm.core.annotate.AlwaysInlineAllCallees) StructuredGraph(org.graalvm.compiler.nodes.StructuredGraph) TreeMap(java.util.TreeMap) ForkJoinPool(java.util.concurrent.ForkJoinPool) Indent(org.graalvm.compiler.debug.Indent) DataBuilder(org.graalvm.compiler.lir.asm.DataBuilder) ForeignCallNode(org.graalvm.compiler.nodes.extended.ForeignCallNode) PartialEscapePhase(org.graalvm.compiler.virtual.phases.ea.PartialEscapePhase) Providers(org.graalvm.compiler.phases.util.Providers) EarlyReadEliminationPhase(org.graalvm.compiler.virtual.phases.ea.EarlyReadEliminationPhase) BytecodeFrame(jdk.vm.ci.code.BytecodeFrame) Constant(jdk.vm.ci.meta.Constant) FeatureHandler(com.oracle.svm.hosted.FeatureHandler) NodeIntrinsic(org.graalvm.compiler.graph.Node.NodeIntrinsic) HostedUniverse(com.oracle.svm.hosted.meta.HostedUniverse) CompilationIdentifier(org.graalvm.compiler.core.common.CompilationIdentifier) EconomicMap(org.graalvm.collections.EconomicMap) ForeignCallsProvider(org.graalvm.compiler.core.common.spi.ForeignCallsProvider) Infopoint(jdk.vm.ci.code.site.Infopoint) PhaseSuite(org.graalvm.compiler.phases.PhaseSuite) DeoptEntryNode(com.oracle.svm.core.graal.nodes.DeoptEntryNode) DebugInfo(jdk.vm.ci.code.DebugInfo) DeletedMethod(com.oracle.svm.hosted.substitute.DeletedMethod) ResolvedJavaMethodBytecode(org.graalvm.compiler.bytecode.ResolvedJavaMethodBytecode) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) RedundantMoveElimination(org.graalvm.compiler.lir.RedundantMoveElimination) VMError(com.oracle.svm.core.util.VMError) Objects(java.util.Objects) Bytecode(org.graalvm.compiler.bytecode.Bytecode) ValueNode(org.graalvm.compiler.nodes.ValueNode) List(java.util.List) FrameInfoEncoder(com.oracle.svm.core.code.FrameInfoEncoder) Modifier(java.lang.reflect.Modifier) SnippetReflectionProvider(org.graalvm.compiler.api.replacements.SnippetReflectionProvider) Annotation(java.lang.annotation.Annotation) Entry(java.util.Map.Entry) GraalError(org.graalvm.compiler.debug.GraalError) FixReadsPhase(org.graalvm.compiler.phases.common.FixReadsPhase) DataSection(org.graalvm.compiler.code.DataSection) StartNode(org.graalvm.compiler.nodes.StartNode) CanonicalizerPhase(org.graalvm.compiler.phases.common.CanonicalizerPhase) HashMap(java.util.HashMap) ConcurrentMap(java.util.concurrent.ConcurrentMap) InliningUtil(org.graalvm.compiler.phases.common.inlining.InliningUtil) HostedGraphBuilderPhase(com.oracle.svm.hosted.phases.HostedGraphBuilderPhase) Assembler(org.graalvm.compiler.asm.Assembler) SubstrateIntrinsicGraphBuilder(com.oracle.graal.pointsto.phases.SubstrateIntrinsicGraphBuilder) DebugContext(org.graalvm.compiler.debug.DebugContext) FrameMap(org.graalvm.compiler.lir.framemap.FrameMap) InvokeNode(org.graalvm.compiler.nodes.InvokeNode) HostedMethod(com.oracle.svm.hosted.meta.HostedMethod) ParameterNode(org.graalvm.compiler.nodes.ParameterNode) NativeImageGenerator(com.oracle.svm.hosted.NativeImageGenerator) NeverInlineTrivial(com.oracle.svm.core.annotate.NeverInlineTrivial) OptionValues(org.graalvm.compiler.options.OptionValues) SubstrateForeignCallsProvider(com.oracle.svm.core.graal.meta.SubstrateForeignCallsProvider) BytecodeExceptionMode(org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.BytecodeExceptionMode) ImageSingletons(org.graalvm.nativeimage.ImageSingletons) Timer(com.oracle.graal.pointsto.util.Timer) FloatingReadPhase(org.graalvm.compiler.phases.common.FloatingReadPhase) MidTierContext(org.graalvm.compiler.phases.tiers.MidTierContext) DeoptTester(com.oracle.svm.core.deopt.DeoptTester) InfopointReason(jdk.vm.ci.code.site.InfopointReason) Invoke(org.graalvm.compiler.nodes.Invoke) Call(jdk.vm.ci.code.site.Call) Node(org.graalvm.compiler.graph.Node) Comparator(java.util.Comparator) Collections(java.util.Collections) FixedWithNextNode(org.graalvm.compiler.nodes.FixedWithNextNode) SubstrateForeignCallsProvider(com.oracle.svm.core.graal.meta.SubstrateForeignCallsProvider)

Example 20 with HostedMethod

use of com.oracle.svm.hosted.meta.HostedMethod in project graal by oracle.

the class MustNotSynchronizeAnnotationChecker method printPath.

private void printPath() {
    System.out.print("  [Path: ");
    final Iterator<HostedMethod> methodIterator = methodPath.iterator();
    final Iterator<HostedMethod> methodImplIterator = methodImplPath.iterator();
    while (methodIterator.hasNext()) {
        final HostedMethod method = methodIterator.next();
        final HostedMethod methodImpl = methodImplIterator.next();
        System.err.println();
        if (method.equals(methodImpl)) {
            /* If the method and the implementation are the same, give a short message. */
            System.err.print("     " + method.format("%h.%n(%p)"));
        } else {
            /* Else give a longer message to help people follow virtual calls. */
            System.err.print("     " + method.format("%f %h.%n(%p)") + " implemented by " + methodImpl.format("%h.%n(%p)"));
        }
    }
    System.err.println("]");
}
Also used : HostedMethod(com.oracle.svm.hosted.meta.HostedMethod)

Aggregations

HostedMethod (com.oracle.svm.hosted.meta.HostedMethod)32 DebugContext (org.graalvm.compiler.debug.DebugContext)10 StructuredGraph (org.graalvm.compiler.nodes.StructuredGraph)10 CompilationResult (org.graalvm.compiler.code.CompilationResult)8 Invoke (org.graalvm.compiler.nodes.Invoke)8 Uninterruptible (com.oracle.svm.core.annotate.Uninterruptible)7 DeoptEntryInfopoint (com.oracle.svm.core.deopt.DeoptEntryInfopoint)7 Infopoint (jdk.vm.ci.code.site.Infopoint)7 Indent (org.graalvm.compiler.debug.Indent)6 HostedProviders (com.oracle.graal.pointsto.meta.HostedProviders)5 HostedOptionValues (com.oracle.svm.core.option.HostedOptionValues)5 ArrayList (java.util.ArrayList)5 HashMap (java.util.HashMap)5 Map (java.util.Map)5 Call (jdk.vm.ci.code.site.Call)5 GraalError (org.graalvm.compiler.debug.GraalError)5 OptionValues (org.graalvm.compiler.options.OptionValues)5 AnalysisMethod (com.oracle.graal.pointsto.meta.AnalysisMethod)4 SubstrateIntrinsicGraphBuilder (com.oracle.graal.pointsto.phases.SubstrateIntrinsicGraphBuilder)4 Timer (com.oracle.graal.pointsto.util.Timer)4