1 /* |
1 /* |
2 * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
28 import org.graalvm.compiler.api.replacements.SnippetTemplateCache; |
28 import org.graalvm.compiler.api.replacements.SnippetTemplateCache; |
29 import org.graalvm.compiler.bytecode.BytecodeProvider; |
29 import org.graalvm.compiler.bytecode.BytecodeProvider; |
30 import org.graalvm.compiler.core.common.CompilationIdentifier; |
30 import org.graalvm.compiler.core.common.CompilationIdentifier; |
31 import org.graalvm.compiler.debug.DebugContext; |
31 import org.graalvm.compiler.debug.DebugContext; |
32 import org.graalvm.compiler.graph.NodeSourcePosition; |
32 import org.graalvm.compiler.graph.NodeSourcePosition; |
|
33 import org.graalvm.compiler.nodes.Cancellable; |
33 import org.graalvm.compiler.nodes.StructuredGraph; |
34 import org.graalvm.compiler.nodes.StructuredGraph; |
34 import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration; |
35 import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration; |
35 import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderPlugin; |
36 import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderPlugin; |
36 import org.graalvm.compiler.nodes.graphbuilderconf.IntrinsicContext; |
37 import org.graalvm.compiler.nodes.graphbuilderconf.IntrinsicContext; |
37 import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin; |
38 import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin; |
84 * |
85 * |
85 * @param plugin the plugin being substituted |
86 * @param plugin the plugin being substituted |
86 * @param original the method being substituted |
87 * @param original the method being substituted |
87 * @param context the kind of inlining to be performed for the substitution |
88 * @param context the kind of inlining to be performed for the substitution |
88 * @param allowAssumptions |
89 * @param allowAssumptions |
|
90 * @param cancellable |
89 * @param options |
91 * @param options |
90 * @return the method substitution graph, if any, that is derived from {@code method} |
92 * @return the method substitution graph, if any, that is derived from {@code method} |
91 */ |
93 */ |
92 StructuredGraph getMethodSubstitution(MethodSubstitutionPlugin plugin, ResolvedJavaMethod original, IntrinsicContext.CompilationContext context, |
94 StructuredGraph getMethodSubstitution(MethodSubstitutionPlugin plugin, ResolvedJavaMethod original, IntrinsicContext.CompilationContext context, |
93 StructuredGraph.AllowAssumptions allowAssumptions, OptionValues options); |
95 StructuredGraph.AllowAssumptions allowAssumptions, Cancellable cancellable, OptionValues options); |
94 |
96 |
95 /** |
97 /** |
96 * Registers a plugin as a substitution. |
98 * Registers a plugin as a substitution. |
97 */ |
99 */ |
98 void registerMethodSubstitution(MethodSubstitutionPlugin plugin, ResolvedJavaMethod original, IntrinsicContext.CompilationContext context, OptionValues options); |
100 void registerMethodSubstitution(MethodSubstitutionPlugin plugin, ResolvedJavaMethod original, IntrinsicContext.CompilationContext context, OptionValues options); |
113 * installed for the method. |
115 * installed for the method. |
114 * |
116 * |
115 * @param method |
117 * @param method |
116 * @param compilationId |
118 * @param compilationId |
117 * @param debug |
119 * @param debug |
|
120 * @param cancellable |
118 * @return an intrinsic graph that can be compiled and installed for {@code method} or null |
121 * @return an intrinsic graph that can be compiled and installed for {@code method} or null |
119 */ |
122 */ |
120 StructuredGraph getIntrinsicGraph(ResolvedJavaMethod method, CompilationIdentifier compilationId, DebugContext debug); |
123 StructuredGraph getIntrinsicGraph(ResolvedJavaMethod method, CompilationIdentifier compilationId, DebugContext debug, Cancellable cancellable); |
121 |
124 |
122 /** |
125 /** |
123 * Determines if there may be a |
126 * Determines if there may be a |
124 * {@linkplain #getSubstitution(ResolvedJavaMethod, int, boolean, NodeSourcePosition, OptionValues) |
127 * {@linkplain #getSubstitution(ResolvedJavaMethod, int, boolean, NodeSourcePosition, OptionValues) |
125 * substitution graph} for a given method. |
128 * substitution graph} for a given method. |