Search in sources :

Example 1 with BreakpointNode

use of org.graalvm.compiler.nodes.BreakpointNode in project graal by oracle.

the class GraalCompilerTest method registerInvocationPlugins.

/**
 * Registers extra invocation plugins for this test. The extra plugins are removed in the
 * {@link #afterTest()} method.
 *
 * Subclasses overriding this method should always call the same method on the super class in
 * case it wants to register plugins.
 *
 * @param invocationPlugins
 */
protected void registerInvocationPlugins(InvocationPlugins invocationPlugins) {
    invocationPlugins.register(new InvocationPlugin() {

        @Override
        public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver) {
            b.add(new BreakpointNode());
            return true;
        }
    }, GraalCompilerTest.class, "breakpoint");
    invocationPlugins.register(new InvocationPlugin() {

        @Override
        public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode arg0) {
            b.add(new BreakpointNode(arg0));
            return true;
        }
    }, GraalCompilerTest.class, "breakpoint", int.class);
    invocationPlugins.register(new InvocationPlugin() {

        @Override
        public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver) {
            b.add(new NotOptimizedNode());
            return true;
        }
    }, GraalCompilerTest.class, "shouldBeOptimizedAway");
}
Also used : GraphBuilderContext(org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderContext) BreakpointNode(org.graalvm.compiler.nodes.BreakpointNode) ValueNode(org.graalvm.compiler.nodes.ValueNode) InvocationPlugin(org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin) ResolvedJavaMethod(jdk.vm.ci.meta.ResolvedJavaMethod)

Aggregations

ResolvedJavaMethod (jdk.vm.ci.meta.ResolvedJavaMethod)1 BreakpointNode (org.graalvm.compiler.nodes.BreakpointNode)1 ValueNode (org.graalvm.compiler.nodes.ValueNode)1 GraphBuilderContext (org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderContext)1 InvocationPlugin (org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin)1