Search in sources :

Example 1 with SubstrateObjectCloneWithExceptionNode

use of com.oracle.svm.core.graal.jdk.SubstrateObjectCloneWithExceptionNode in project graal by oracle.

the class SubstrateGraphBuilderPlugins method registerObjectPlugins.

private static void registerObjectPlugins(InvocationPlugins plugins) {
    Registration r = new Registration(plugins, Object.class);
    r.register(new RequiredInvocationPlugin("clone", Receiver.class) {

        @Override
        public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver) {
            ValueNode object = receiver.get();
            b.addPush(JavaKind.Object, new SubstrateObjectCloneWithExceptionNode(MacroParams.of(b, targetMethod, object)));
            return true;
        }
    });
    r.register(new RequiredInvocationPlugin("hashCode", Receiver.class) {

        @Override
        public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver) {
            ValueNode object = receiver.get();
            b.addPush(JavaKind.Int, new SubstrateIdentityHashCodeNode(object, b.bci()));
            return true;
        }
    });
}
Also used : SubstrateObjectCloneWithExceptionNode(com.oracle.svm.core.graal.jdk.SubstrateObjectCloneWithExceptionNode) GraphBuilderContext(org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderContext) Registration(org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins.Registration) RequiredInvocationPlugin(org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin.RequiredInvocationPlugin) StackValueNode(com.oracle.svm.core.graal.stackvalue.StackValueNode) ValueNode(org.graalvm.compiler.nodes.ValueNode) Receiver(org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin.Receiver) ResolvedJavaMethod(jdk.vm.ci.meta.ResolvedJavaMethod) SubstrateIdentityHashCodeNode(com.oracle.svm.core.identityhashcode.SubstrateIdentityHashCodeNode)

Aggregations

SubstrateObjectCloneWithExceptionNode (com.oracle.svm.core.graal.jdk.SubstrateObjectCloneWithExceptionNode)1 StackValueNode (com.oracle.svm.core.graal.stackvalue.StackValueNode)1 SubstrateIdentityHashCodeNode (com.oracle.svm.core.identityhashcode.SubstrateIdentityHashCodeNode)1 ResolvedJavaMethod (jdk.vm.ci.meta.ResolvedJavaMethod)1 ValueNode (org.graalvm.compiler.nodes.ValueNode)1 GraphBuilderContext (org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderContext)1 Receiver (org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin.Receiver)1 RequiredInvocationPlugin (org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin.RequiredInvocationPlugin)1 Registration (org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins.Registration)1