Search in sources :

Example 6 with RawLoadNode

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

the class UnsafeEATest method canonicalizeGraph.

@Override
protected void canonicalizeGraph() {
    if (testingUnsafe) {
        // transformation into field access nodes.
        for (Node node : graph.getNodes().filter(x -> x instanceof UnsafeAccessNode).snapshot()) {
            if (node instanceof RawStoreNode) {
                RawStoreNode store = (RawStoreNode) node;
                RawStoreNode newStore = graph.add(new RawStoreNode(store.object(), store.offset(), store.value(), store.accessKind(), NamedLocationIdentity.any(), store.needsBarrier(), store.stateAfter(), true));
                graph.replaceFixedWithFixed(store, newStore);
            } else if (node instanceof RawLoadNode) {
                RawLoadNode load = (RawLoadNode) node;
                RawLoadNode newLoad = graph.add(new RawLoadNode(load.object(), load.offset(), load.accessKind(), NamedLocationIdentity.any(), true));
                graph.replaceFixedWithFixed(load, newLoad);
            }
        }
    }
    super.canonicalizeGraph();
}
Also used : RawLoadNode(org.graalvm.compiler.nodes.extended.RawLoadNode) UnsafeAccessNode(org.graalvm.compiler.nodes.extended.UnsafeAccessNode) UnpackEndianHalfNode(org.graalvm.compiler.nodes.calc.UnpackEndianHalfNode) LoadFieldNode(org.graalvm.compiler.nodes.java.LoadFieldNode) ValuePhiNode(org.graalvm.compiler.nodes.ValuePhiNode) CanonicalizerPhase(org.graalvm.compiler.phases.common.CanonicalizerPhase) RawStoreNode(org.graalvm.compiler.nodes.extended.RawStoreNode) Test(org.junit.Test) ByteBuffer(java.nio.ByteBuffer) Graph(org.graalvm.compiler.graph.Graph) NamedLocationIdentity(org.graalvm.compiler.nodes.NamedLocationIdentity) JavaConstant(jdk.vm.ci.meta.JavaConstant) GraalDirectives(org.graalvm.compiler.api.directives.GraalDirectives) JavaKind(jdk.vm.ci.meta.JavaKind) Node(org.graalvm.compiler.graph.Node) Assert(org.junit.Assert) ResolvedJavaMethod(jdk.vm.ci.meta.ResolvedJavaMethod) PhiNode(org.graalvm.compiler.nodes.PhiNode) RawStoreNode(org.graalvm.compiler.nodes.extended.RawStoreNode) UnsafeAccessNode(org.graalvm.compiler.nodes.extended.UnsafeAccessNode) RawLoadNode(org.graalvm.compiler.nodes.extended.RawLoadNode) UnsafeAccessNode(org.graalvm.compiler.nodes.extended.UnsafeAccessNode) UnpackEndianHalfNode(org.graalvm.compiler.nodes.calc.UnpackEndianHalfNode) LoadFieldNode(org.graalvm.compiler.nodes.java.LoadFieldNode) ValuePhiNode(org.graalvm.compiler.nodes.ValuePhiNode) RawStoreNode(org.graalvm.compiler.nodes.extended.RawStoreNode) Node(org.graalvm.compiler.graph.Node) PhiNode(org.graalvm.compiler.nodes.PhiNode) RawLoadNode(org.graalvm.compiler.nodes.extended.RawLoadNode)

Aggregations

RawLoadNode (org.graalvm.compiler.nodes.extended.RawLoadNode)6 RawStoreNode (org.graalvm.compiler.nodes.extended.RawStoreNode)5 ValueNode (org.graalvm.compiler.nodes.ValueNode)4 LoadFieldNode (org.graalvm.compiler.nodes.java.LoadFieldNode)4 JavaKind (jdk.vm.ci.meta.JavaKind)3 ResolvedJavaMethod (jdk.vm.ci.meta.ResolvedJavaMethod)3 Node (org.graalvm.compiler.graph.Node)2 FieldLocationIdentity (org.graalvm.compiler.nodes.FieldLocationIdentity)2 NamedLocationIdentity (org.graalvm.compiler.nodes.NamedLocationIdentity)2 StructuredGraph (org.graalvm.compiler.nodes.StructuredGraph)2 UnboxNode (org.graalvm.compiler.nodes.extended.UnboxNode)2 ReadNode (org.graalvm.compiler.nodes.memory.ReadNode)2 CEntryPointEnterNode (com.oracle.svm.core.graal.nodes.CEntryPointEnterNode)1 CEntryPointLeaveNode (com.oracle.svm.core.graal.nodes.CEntryPointLeaveNode)1 ByteBuffer (java.nio.ByteBuffer)1 JavaConstant (jdk.vm.ci.meta.JavaConstant)1 ResolvedJavaType (jdk.vm.ci.meta.ResolvedJavaType)1 GraalDirectives (org.graalvm.compiler.api.directives.GraalDirectives)1 ObjectStamp (org.graalvm.compiler.core.common.type.ObjectStamp)1 GraalCompilerTest (org.graalvm.compiler.core.test.GraalCompilerTest)1