< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Replacements.java

Print this page

        

@@ -31,10 +31,11 @@
 import org.graalvm.compiler.core.common.CompilationIdentifier;
 import org.graalvm.compiler.debug.DebugContext;
 import org.graalvm.compiler.graph.NodeSourcePosition;
 import org.graalvm.compiler.nodes.StructuredGraph;
 import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration;
+import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderPlugin;
 import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin;
 import org.graalvm.compiler.options.OptionValues;
 
 import jdk.vm.ci.meta.ResolvedJavaMethod;
 

@@ -50,10 +51,15 @@
      * bytecode into a graph.
      */
     GraphBuilderConfiguration.Plugins getGraphBuilderPlugins();
 
     /**
+     * Gets the plugin type that intrinsifies calls to {@code method}.
+     */
+    Class<? extends GraphBuilderPlugin> getIntrinsifyingPlugin(ResolvedJavaMethod method);
+
+    /**
      * Gets the snippet graph derived from a given method.
      *
      * @param args arguments to the snippet if available, otherwise {@code null}
      * @param trackNodeSourcePosition
      * @return the snippet graph, if any, that is derived from {@code method}

@@ -73,11 +79,11 @@
     StructuredGraph getSnippet(ResolvedJavaMethod method, ResolvedJavaMethod recursiveEntry, Object[] args, boolean trackNodeSourcePosition, NodeSourcePosition replaceePosition);
 
     /**
      * Registers a method as snippet.
      */
-    void registerSnippet(ResolvedJavaMethod method, boolean trackNodeSourcePosition);
+    void registerSnippet(ResolvedJavaMethod method, ResolvedJavaMethod original, Object receiver, boolean trackNodeSourcePosition);
 
     /**
      * Gets a graph that is a substitution for a given method.
      *
      * @param invokeBci the call site BCI if this request is made for inlining a substitute

@@ -136,6 +142,15 @@
     /**
      * Get snippet templates that were registered with
      * {@link Replacements#registerSnippetTemplateCache(SnippetTemplateCache)}.
      */
     <T extends SnippetTemplateCache> T getSnippetTemplateCache(Class<T> templatesClass);
+
+    /**
+     * Notifies this method that no further snippets will be registered via {@link #registerSnippet}
+     * or {@link #registerSnippetTemplateCache}.
+     *
+     * This is a hook for an implementation to check for or forbid late registration.
+     */
+    default void closeSnippetRegistration() {
+    }
 }
< prev index next >