public class ExperimentalNativeImageInlineDuringParsingPlugin extends Object implements org.graalvm.compiler.nodes.graphbuilderconf.InlineInvokePlugin
Usage: To use this plugin, add option -H:+InlineBeforeAnalysis to the native-image.
The results of an inlining decision are placed in the
ExperimentalNativeImageInlineDuringParsingSupport.inlineData
.
Example: Assume that we have a graph with methods R, A, B, C, where R is the root method, A calls B, B calls C, and C returns the constant 1.*
R / A / B / C <-- only returns 1
We first analyze A and decide whether to enter the method for further analysis or not. In first case, we proceed and analyze the nodes deeper in the graph with MethodNodeTrackingAndInline. We repeat the procedure with B and C, and when the analysis of method C is complete, we decide to inline it because it only returns a constant value. After that, B folds to constant, so we inline this method too. Finally, for the same reason, we decide to inline A into R. This code is for testing purposes only and it will be replaced with a more elegant version.
Modifier and Type | Class and Description |
---|---|
static class |
ExperimentalNativeImageInlineDuringParsingPlugin.InvocationResultInline |
static class |
ExperimentalNativeImageInlineDuringParsingPlugin.Options |
Constructor and Description |
---|
ExperimentalNativeImageInlineDuringParsingPlugin(boolean analysis,
com.oracle.graal.pointsto.meta.HostedProviders providers) |
Modifier and Type | Method and Description |
---|---|
static boolean |
isRecursiveCall(List<org.graalvm.collections.Pair<jdk.vm.ci.meta.ResolvedJavaMethod,Integer>> callingContext,
jdk.vm.ci.meta.ResolvedJavaMethod callee) |
org.graalvm.compiler.nodes.graphbuilderconf.InlineInvokePlugin.InlineInfo |
shouldInlineInvoke(org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderContext b,
jdk.vm.ci.meta.ResolvedJavaMethod callee,
org.graalvm.compiler.nodes.ValueNode[] args) |
static ExperimentalNativeImageInlineDuringParsingSupport |
support() |
public ExperimentalNativeImageInlineDuringParsingPlugin(boolean analysis, com.oracle.graal.pointsto.meta.HostedProviders providers)
public org.graalvm.compiler.nodes.graphbuilderconf.InlineInvokePlugin.InlineInfo shouldInlineInvoke(org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderContext b, jdk.vm.ci.meta.ResolvedJavaMethod callee, org.graalvm.compiler.nodes.ValueNode[] args)
shouldInlineInvoke
in interface org.graalvm.compiler.nodes.graphbuilderconf.InlineInvokePlugin
public static boolean isRecursiveCall(List<org.graalvm.collections.Pair<jdk.vm.ci.meta.ResolvedJavaMethod,Integer>> callingContext, jdk.vm.ci.meta.ResolvedJavaMethod callee)
public static ExperimentalNativeImageInlineDuringParsingSupport support()