public interface Replacements extends GeneratedPluginInjectionProvider
| Modifier and Type | Method and Description |
|---|---|
default void |
closeSnippetRegistration()
Notifies this method that no further snippets will be registered via
Replacements.registerSnippet(ResolvedJavaMethod, ResolvedJavaMethod, java.lang.Object, boolean, org.graalvm.compiler.options.OptionValues)
or Replacements.registerSnippetTemplateCache(org.graalvm.compiler.api.replacements.SnippetTemplateCache). |
BytecodeProvider |
getDefaultReplacementBytecodeProvider()
Gets the provider for accessing the bytecode of a substitution method if no other provider is
associated with the substitution method.
|
GraphBuilderConfiguration.Plugins |
getGraphBuilderPlugins()
Gets the object managing the various graph builder plugins used by this object when parsing
bytecode into a graph.
|
StructuredGraph |
getInlineSubstitution(ResolvedJavaMethod method,
int invokeBci,
Invoke.InlineControl inlineControl,
boolean trackNodeSourcePosition,
NodeSourcePosition replaceePosition,
StructuredGraph.AllowAssumptions allowAssumptions,
OptionValues options)
Gets a graph that is a substitution for a given method.
|
StructuredGraph |
getIntrinsicGraph(ResolvedJavaMethod method,
CompilationIdentifier compilationId,
DebugContext debug,
StructuredGraph.AllowAssumptions allowAssumptions,
Cancellable cancellable)
Gets a graph produced from the intrinsic for a given method that can be compiled and
installed for the method.
|
Class<? extends GraphBuilderPlugin> |
getIntrinsifyingPlugin(ResolvedJavaMethod method)
Gets the plugin type that intrinsifies calls to
method. |
CoreProviders |
getProviders() |
StructuredGraph |
getSnippet(ResolvedJavaMethod method,
ResolvedJavaMethod recursiveEntry,
Object[] args,
BitSet nonNullParameters,
boolean trackNodeSourcePosition,
NodeSourcePosition replaceePosition,
OptionValues options)
Gets the snippet graph derived from a given method.
|
SnippetParameterInfo |
getSnippetParameterInfo(ResolvedJavaMethod method)
Get the snippet metadata required to inline the snippet.
|
<T extends SnippetTemplateCache> |
getSnippetTemplateCache(Class<T> templatesClass)
Get snippet templates that were registered with
Replacements.registerSnippetTemplateCache(SnippetTemplateCache). |
JavaKind |
getWordKind()
Gets the JavaKind corresponding to word values.
|
boolean |
hasSubstitution(ResolvedJavaMethod method,
OptionValues options)
Determines if there may be a
substitution graph for a given method.
|
default boolean |
isEncodingSnippets()
Returns
true if this Replacements is being used for preparation of snippets
and substitutions for libgraal. |
boolean |
isSnippet(ResolvedJavaMethod method)
Return true if the method is a
Snippet. |
DebugContext |
openSnippetDebugContext(DebugContext.Description description,
DebugContext outer,
OptionValues options)
Create a
DebugContext for use with Snippet related work. |
void |
registerConditionalPlugin(InvocationPlugin plugin)
Marks a plugin as conditionally applied.
|
void |
registerSnippet(ResolvedJavaMethod method,
ResolvedJavaMethod original,
Object receiver,
boolean trackNodeSourcePosition,
OptionValues options)
Registers a method as snippet.
|
void |
registerSnippetTemplateCache(SnippetTemplateCache snippetTemplates)
Register snippet templates.
|
getInjectedArgument, getInjectedStampCoreProviders getProviders()
GraphBuilderConfiguration.Plugins getGraphBuilderPlugins()
Class<? extends GraphBuilderPlugin> getIntrinsifyingPlugin(ResolvedJavaMethod method)
method.DebugContext openSnippetDebugContext(DebugContext.Description description, DebugContext outer, OptionValues options)
DebugContext for use with Snippet related work. Snippet processingis
hidden by default using the flags DebugStubsAndSnippets.StructuredGraph getSnippet(ResolvedJavaMethod method, ResolvedJavaMethod recursiveEntry, Object[] args, BitSet nonNullParameters, boolean trackNodeSourcePosition, NodeSourcePosition replaceePosition, OptionValues options)
recursiveEntry - XXX always null now?.args - arguments to the snippet if available, otherwise nullnonNullParameters - trackNodeSourcePosition - options - methodSnippetParameterInfo getSnippetParameterInfo(ResolvedJavaMethod method)
boolean isSnippet(ResolvedJavaMethod method)
Snippet.default boolean isEncodingSnippets()
true if this Replacements is being used for preparation of snippets
and substitutions for libgraal.void registerSnippet(ResolvedJavaMethod method,
ResolvedJavaMethod original,
Object receiver,
boolean trackNodeSourcePosition,
OptionValues options)
void registerConditionalPlugin(InvocationPlugin plugin)
StructuredGraph getInlineSubstitution(ResolvedJavaMethod method, int invokeBci, Invoke.InlineControl inlineControl, boolean trackNodeSourcePosition, NodeSourcePosition replaceePosition, StructuredGraph.AllowAssumptions allowAssumptions, OptionValues options)
invokeBci - the call site BCI for the substitutioninlineControl - trackNodeSourcePosition - replaceePosition - allowAssumptions - options - methodStructuredGraph getIntrinsicGraph(ResolvedJavaMethod method, CompilationIdentifier compilationId, DebugContext debug, StructuredGraph.AllowAssumptions allowAssumptions, Cancellable cancellable)
method - compilationId - debug - allowAssumptions - cancellable - method or nullboolean hasSubstitution(ResolvedJavaMethod method,
OptionValues options)
Replacements.getInlineSubstitution(ResolvedJavaMethod, int, org.graalvm.compiler.nodes.Invoke.InlineControl, boolean, org.graalvm.compiler.graph.NodeSourcePosition, org.graalvm.compiler.nodes.StructuredGraph.AllowAssumptions, org.graalvm.compiler.options.OptionValues) may still return null for method and
substitution may be based on an InvocationPlugin that returns false for
InvocationPlugin.execute(org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderContext, ResolvedJavaMethod, org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin.Receiver, org.graalvm.compiler.nodes.ValueNode[]) making it impossible to create a substitute graph.methodBytecodeProvider getDefaultReplacementBytecodeProvider()
void registerSnippetTemplateCache(SnippetTemplateCache snippetTemplates)
<T extends SnippetTemplateCache> T getSnippetTemplateCache(Class<T> templatesClass)
Replacements.registerSnippetTemplateCache(SnippetTemplateCache).default void closeSnippetRegistration()
Replacements.registerSnippet(ResolvedJavaMethod, ResolvedJavaMethod, java.lang.Object, boolean, org.graalvm.compiler.options.OptionValues)
or Replacements.registerSnippetTemplateCache(org.graalvm.compiler.api.replacements.SnippetTemplateCache).
This is a hook for an implementation to check for or forbid late registration.JavaKind getWordKind()