@Platforms(Platform.HOSTED_ONLY.class)
@Override
public void registerSnippet(ResolvedJavaMethod method, ResolvedJavaMethod original, Object receiver, boolean trackNodeSourcePosition) {
assert DirectAnnotationAccess.isAnnotationPresent(method, Snippet.class) : "Snippet must be annotated with @" + Snippet.class.getSimpleName() + " " + method;
assert method.hasBytecodes() : "Snippet must not be abstract or native";
assert builder.graphs.get(method) == null : "snippet registered twice: " + method.getName();
try (DebugContext debug = openDebugContext("Snippet_", method)) {
StructuredGraph graph = makeGraph(debug, defaultBytecodeProvider, method, null, null, trackNodeSourcePosition, null);
for (MethodCallTargetNode callTarget : graph.getNodes(MethodCallTargetNode.TYPE)) {
ResolvedJavaMethod callee = callTarget.targetMethod();
if (!builder.delayedInvocationPluginMethods.contains(callee)) {
throw shouldNotReachHere("method " + callee.format("%h.%n") + " not inlined in snippet " + method.format("%h.%n") + " (maybe not final?)");
}
}
builder.graphs.put(method, graph);
}
}