Search in sources :

Example 1 with SubstrateReflectionGetCallerClassNode

use of com.oracle.svm.core.graal.nodes.SubstrateReflectionGetCallerClassNode in project graal by oracle.

the class SubstrateGraphBuilderPlugins method registerReflectionPlugins.

private static void registerReflectionPlugins(InvocationPlugins plugins, Replacements replacements) {
    Registration r = new Registration(plugins, "jdk.internal.reflect.Reflection", replacements);
    r.register(new RequiredInlineOnlyInvocationPlugin("getCallerClass") {

        @Override
        public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver) {
            b.addPush(JavaKind.Object, new SubstrateReflectionGetCallerClassNode(MacroParams.of(b, targetMethod)));
            return true;
        }
    });
}
Also used : SubstrateReflectionGetCallerClassNode(com.oracle.svm.core.graal.nodes.SubstrateReflectionGetCallerClassNode) RequiredInlineOnlyInvocationPlugin(org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin.RequiredInlineOnlyInvocationPlugin) GraphBuilderContext(org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderContext) Registration(org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins.Registration) Receiver(org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin.Receiver) ResolvedJavaMethod(jdk.vm.ci.meta.ResolvedJavaMethod)

Aggregations

SubstrateReflectionGetCallerClassNode (com.oracle.svm.core.graal.nodes.SubstrateReflectionGetCallerClassNode)1 ResolvedJavaMethod (jdk.vm.ci.meta.ResolvedJavaMethod)1 GraphBuilderContext (org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderContext)1 Receiver (org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin.Receiver)1 RequiredInlineOnlyInvocationPlugin (org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin.RequiredInlineOnlyInvocationPlugin)1 Registration (org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins.Registration)1