Search in sources :

Example 1 with CommitAllocationNode

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

the class EscapeAnalysisTest method testFullyUnrolledLoop.

@Test
public void testFullyUnrolledLoop() {
    prepareGraph("testFullyUnrolledLoopSnippet", false);
    new LoopFullUnrollPhase(new CanonicalizerPhase(), new DefaultLoopPolicies()).apply(graph, context);
    new PartialEscapePhase(false, new CanonicalizerPhase(), graph.getOptions()).apply(graph, context);
    Assert.assertEquals(1, returnNodes.size());
    Assert.assertTrue(returnNodes.get(0).result() instanceof AllocatedObjectNode);
    CommitAllocationNode commit = ((AllocatedObjectNode) returnNodes.get(0).result()).getCommit();
    Assert.assertEquals(2, commit.getValues().size());
    Assert.assertEquals(1, commit.getVirtualObjects().size());
    Assert.assertTrue("non-cyclic data structure expected", commit.getVirtualObjects().get(0) != commit.getValues().get(0));
}
Also used : LoopFullUnrollPhase(org.graalvm.compiler.loop.phases.LoopFullUnrollPhase) PartialEscapePhase(org.graalvm.compiler.virtual.phases.ea.PartialEscapePhase) AllocatedObjectNode(org.graalvm.compiler.nodes.virtual.AllocatedObjectNode) DefaultLoopPolicies(org.graalvm.compiler.loop.DefaultLoopPolicies) CanonicalizerPhase(org.graalvm.compiler.phases.common.CanonicalizerPhase) CommitAllocationNode(org.graalvm.compiler.nodes.virtual.CommitAllocationNode) Test(org.junit.Test)

Example 2 with CommitAllocationNode

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

the class DefaultJavaLoweringProvider method finishAllocatedObjects.

public void finishAllocatedObjects(LoweringTool tool, CommitAllocationNode commit, ValueNode[] allocations) {
    StructuredGraph graph = commit.graph();
    for (int objIndex = 0; objIndex < commit.getVirtualObjects().size(); objIndex++) {
        FixedValueAnchorNode anchor = graph.add(new FixedValueAnchorNode(allocations[objIndex]));
        allocations[objIndex] = anchor;
        graph.addBeforeFixed(commit, anchor);
    }
    /*
         * Note that the FrameState that is assigned to these MonitorEnterNodes isn't the correct
         * state. It will be the state from before the allocation occurred instead of a valid state
         * after the locking is performed. In practice this should be fine since these are newly
         * allocated objects. The bytecodes themselves permit allocating an object, doing a
         * monitorenter and then dropping all references to the object which would produce the same
         * state, though that would normally produce an IllegalMonitorStateException. In HotSpot
         * some form of fast path locking should always occur so the FrameState should never
         * actually be used.
         */
    ArrayList<MonitorEnterNode> enters = null;
    for (int objIndex = 0; objIndex < commit.getVirtualObjects().size(); objIndex++) {
        List<MonitorIdNode> locks = commit.getLocks(objIndex);
        if (locks.size() > 1) {
            // Ensure that the lock operations are performed in lock depth order
            ArrayList<MonitorIdNode> newList = new ArrayList<>(locks);
            newList.sort((a, b) -> Integer.compare(a.getLockDepth(), b.getLockDepth()));
            locks = newList;
        }
        int lastDepth = -1;
        for (MonitorIdNode monitorId : locks) {
            assert lastDepth < monitorId.getLockDepth();
            lastDepth = monitorId.getLockDepth();
            MonitorEnterNode enter = graph.add(new MonitorEnterNode(allocations[objIndex], monitorId));
            graph.addBeforeFixed(commit, enter);
            if (enters == null) {
                enters = new ArrayList<>();
            }
            enters.add(enter);
        }
    }
    for (Node usage : commit.usages().snapshot()) {
        if (usage instanceof AllocatedObjectNode) {
            AllocatedObjectNode addObject = (AllocatedObjectNode) usage;
            int index = commit.getVirtualObjects().indexOf(addObject.getVirtualObject());
            addObject.replaceAtUsagesAndDelete(allocations[index]);
        } else {
            assert enters != null;
            commit.replaceAtUsages(InputType.Memory, enters.get(enters.size() - 1));
        }
    }
    if (enters != null) {
        for (MonitorEnterNode enter : enters) {
            enter.lower(tool);
        }
    }
    assert commit.hasNoUsages();
    insertAllocationBarrier(commit, graph);
}
Also used : FixedValueAnchorNode(org.graalvm.compiler.nodes.extended.FixedValueAnchorNode) MonitorIdNode(org.graalvm.compiler.nodes.java.MonitorIdNode) AllocatedObjectNode(org.graalvm.compiler.nodes.virtual.AllocatedObjectNode) StructuredGraph(org.graalvm.compiler.nodes.StructuredGraph) RawMonitorEnterNode(org.graalvm.compiler.nodes.java.RawMonitorEnterNode) MonitorEnterNode(org.graalvm.compiler.nodes.java.MonitorEnterNode) RawLoadNode(org.graalvm.compiler.nodes.extended.RawLoadNode) MonitorIdNode(org.graalvm.compiler.nodes.java.MonitorIdNode) ZeroExtendNode(org.graalvm.compiler.nodes.calc.ZeroExtendNode) RawMonitorEnterNode(org.graalvm.compiler.nodes.java.RawMonitorEnterNode) GuardingNode(org.graalvm.compiler.nodes.extended.GuardingNode) LeftShiftNode(org.graalvm.compiler.nodes.calc.LeftShiftNode) WriteNode(org.graalvm.compiler.nodes.memory.WriteNode) UnsafeMemoryStoreNode(org.graalvm.compiler.nodes.extended.UnsafeMemoryStoreNode) ConstantNode(org.graalvm.compiler.nodes.ConstantNode) IntegerConvertNode(org.graalvm.compiler.nodes.calc.IntegerConvertNode) IntegerEqualsNode(org.graalvm.compiler.nodes.calc.IntegerEqualsNode) AtomicReadAndWriteNode(org.graalvm.compiler.nodes.java.AtomicReadAndWriteNode) JavaWriteNode(org.graalvm.compiler.nodes.extended.JavaWriteNode) AbstractNewObjectNode(org.graalvm.compiler.nodes.java.AbstractNewObjectNode) FixedNode(org.graalvm.compiler.nodes.FixedNode) IntegerBelowNode(org.graalvm.compiler.nodes.calc.IntegerBelowNode) VirtualInstanceNode(org.graalvm.compiler.nodes.virtual.VirtualInstanceNode) VerifyHeapNode(org.graalvm.compiler.nodes.debug.VerifyHeapNode) ForeignCallNode(org.graalvm.compiler.nodes.extended.ForeignCallNode) NewInstanceNode(org.graalvm.compiler.nodes.java.NewInstanceNode) OffsetAddressNode(org.graalvm.compiler.nodes.memory.address.OffsetAddressNode) NarrowNode(org.graalvm.compiler.nodes.calc.NarrowNode) SignExtendNode(org.graalvm.compiler.nodes.calc.SignExtendNode) JavaReadNode(org.graalvm.compiler.nodes.extended.JavaReadNode) LoadIndexedNode(org.graalvm.compiler.nodes.java.LoadIndexedNode) BoxNode(org.graalvm.compiler.nodes.extended.BoxNode) BinaryMathIntrinsicNode(org.graalvm.compiler.replacements.nodes.BinaryMathIntrinsicNode) VirtualObjectNode(org.graalvm.compiler.nodes.virtual.VirtualObjectNode) RawStoreNode(org.graalvm.compiler.nodes.extended.RawStoreNode) PiNode(org.graalvm.compiler.nodes.PiNode) FinalFieldBarrierNode(org.graalvm.compiler.nodes.java.FinalFieldBarrierNode) LogicNode(org.graalvm.compiler.nodes.LogicNode) ValueNode(org.graalvm.compiler.nodes.ValueNode) IsNullNode(org.graalvm.compiler.nodes.calc.IsNullNode) NewArrayNode(org.graalvm.compiler.nodes.java.NewArrayNode) VirtualArrayNode(org.graalvm.compiler.nodes.virtual.VirtualArrayNode) LogicCompareAndSwapNode(org.graalvm.compiler.nodes.java.LogicCompareAndSwapNode) UnsafeCompareAndSwapNode(org.graalvm.compiler.nodes.java.UnsafeCompareAndSwapNode) LoadFieldNode(org.graalvm.compiler.nodes.java.LoadFieldNode) LoweredAtomicReadAndWriteNode(org.graalvm.compiler.nodes.java.LoweredAtomicReadAndWriteNode) AllocatedObjectNode(org.graalvm.compiler.nodes.virtual.AllocatedObjectNode) ReadNode(org.graalvm.compiler.nodes.memory.ReadNode) InstanceOfDynamicNode(org.graalvm.compiler.nodes.java.InstanceOfDynamicNode) AddNode(org.graalvm.compiler.nodes.calc.AddNode) LoadHubNode(org.graalvm.compiler.nodes.extended.LoadHubNode) InstanceOfNode(org.graalvm.compiler.nodes.java.InstanceOfNode) RightShiftNode(org.graalvm.compiler.nodes.calc.RightShiftNode) AccessIndexedNode(org.graalvm.compiler.nodes.java.AccessIndexedNode) ConditionalNode(org.graalvm.compiler.nodes.calc.ConditionalNode) GuardedUnsafeLoadNode(org.graalvm.compiler.nodes.extended.GuardedUnsafeLoadNode) UnsafeMemoryLoadNode(org.graalvm.compiler.nodes.extended.UnsafeMemoryLoadNode) UnpackEndianHalfNode(org.graalvm.compiler.nodes.calc.UnpackEndianHalfNode) UnaryMathIntrinsicNode(org.graalvm.compiler.replacements.nodes.UnaryMathIntrinsicNode) StoreIndexedNode(org.graalvm.compiler.nodes.java.StoreIndexedNode) SubNode(org.graalvm.compiler.nodes.calc.SubNode) CommitAllocationNode(org.graalvm.compiler.nodes.virtual.CommitAllocationNode) AddressNode(org.graalvm.compiler.nodes.memory.address.AddressNode) FixedValueAnchorNode(org.graalvm.compiler.nodes.extended.FixedValueAnchorNode) ArrayLengthNode(org.graalvm.compiler.nodes.java.ArrayLengthNode) MembarNode(org.graalvm.compiler.nodes.extended.MembarNode) MonitorEnterNode(org.graalvm.compiler.nodes.java.MonitorEnterNode) StoreFieldNode(org.graalvm.compiler.nodes.java.StoreFieldNode) Node(org.graalvm.compiler.graph.Node) UnboxNode(org.graalvm.compiler.nodes.extended.UnboxNode) ArrayList(java.util.ArrayList)

Example 3 with CommitAllocationNode

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

the class PartialEscapeBlockState method materializeBefore.

/**
 * Materializes the given virtual object and produces the necessary effects in the effects list.
 * This transitively also materializes all other virtual objects that are reachable from the
 * entries.
 */
public void materializeBefore(FixedNode fixed, VirtualObjectNode virtual, GraphEffectList materializeEffects) {
    PartialEscapeClosure.COUNTER_MATERIALIZATIONS.increment(fixed.getDebug());
    List<AllocatedObjectNode> objects = new ArrayList<>(2);
    List<ValueNode> values = new ArrayList<>(8);
    List<List<MonitorIdNode>> locks = new ArrayList<>();
    List<ValueNode> otherAllocations = new ArrayList<>(2);
    List<Boolean> ensureVirtual = new ArrayList<>(2);
    materializeWithCommit(fixed, virtual, objects, locks, values, ensureVirtual, otherAllocations);
    materializeEffects.addVirtualizationDelta(-(objects.size() + otherAllocations.size()));
    materializeEffects.add("materializeBefore", new Effect() {

        @Override
        public void apply(StructuredGraph graph, ArrayList<Node> obsoleteNodes) {
            for (ValueNode alloc : otherAllocations) {
                ValueNode otherAllocation = graph.addOrUniqueWithInputs(alloc);
                if (otherAllocation instanceof FixedWithNextNode) {
                    graph.addBeforeFixed(fixed, (FixedWithNextNode) otherAllocation);
                } else {
                    assert otherAllocation instanceof FloatingNode;
                }
            }
            if (!objects.isEmpty()) {
                CommitAllocationNode commit;
                if (fixed.predecessor() instanceof CommitAllocationNode) {
                    commit = (CommitAllocationNode) fixed.predecessor();
                } else {
                    commit = graph.add(new CommitAllocationNode());
                    graph.addBeforeFixed(fixed, commit);
                }
                for (AllocatedObjectNode obj : objects) {
                    graph.addWithoutUnique(obj);
                    commit.getVirtualObjects().add(obj.getVirtualObject());
                    obj.setCommit(commit);
                }
                for (ValueNode value : values) {
                    commit.getValues().add(graph.addOrUniqueWithInputs(value));
                }
                for (List<MonitorIdNode> monitorIds : locks) {
                    commit.addLocks(monitorIds);
                }
                commit.getEnsureVirtual().addAll(ensureVirtual);
                assert commit.usages().filter(AllocatedObjectNode.class).count() == commit.getUsageCount();
                List<AllocatedObjectNode> materializedValues = commit.usages().filter(AllocatedObjectNode.class).snapshot();
                for (int i = 0; i < commit.getValues().size(); i++) {
                    if (materializedValues.contains(commit.getValues().get(i))) {
                        commit.getValues().set(i, ((AllocatedObjectNode) commit.getValues().get(i)).getVirtualObject());
                    }
                }
            }
        }
    });
}
Also used : FixedWithNextNode(org.graalvm.compiler.nodes.FixedWithNextNode) AllocatedObjectNode(org.graalvm.compiler.nodes.virtual.AllocatedObjectNode) FixedNode(org.graalvm.compiler.nodes.FixedNode) FloatingNode(org.graalvm.compiler.nodes.calc.FloatingNode) VirtualObjectNode(org.graalvm.compiler.nodes.virtual.VirtualObjectNode) AllocatedObjectNode(org.graalvm.compiler.nodes.virtual.AllocatedObjectNode) CommitAllocationNode(org.graalvm.compiler.nodes.virtual.CommitAllocationNode) ValueNode(org.graalvm.compiler.nodes.ValueNode) MonitorIdNode(org.graalvm.compiler.nodes.java.MonitorIdNode) Node(org.graalvm.compiler.graph.Node) FixedWithNextNode(org.graalvm.compiler.nodes.FixedWithNextNode) ArrayList(java.util.ArrayList) StructuredGraph(org.graalvm.compiler.nodes.StructuredGraph) ValueNode(org.graalvm.compiler.nodes.ValueNode) FloatingNode(org.graalvm.compiler.nodes.calc.FloatingNode) ArrayList(java.util.ArrayList) List(java.util.List) Effect(org.graalvm.compiler.virtual.phases.ea.EffectList.Effect) CommitAllocationNode(org.graalvm.compiler.nodes.virtual.CommitAllocationNode)

Example 4 with CommitAllocationNode

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

the class LoopFragment method computeNodes.

protected static void computeNodes(NodeBitMap nodes, Graph graph, Iterable<AbstractBeginNode> blocks, Iterable<AbstractBeginNode> earlyExits) {
    for (AbstractBeginNode b : blocks) {
        if (b.isDeleted()) {
            continue;
        }
        for (Node n : b.getBlockNodes()) {
            if (n instanceof Invoke) {
                nodes.mark(((Invoke) n).callTarget());
            }
            if (n instanceof NodeWithState) {
                NodeWithState withState = (NodeWithState) n;
                withState.states().forEach(state -> state.applyToVirtual(node -> nodes.mark(node)));
            }
            if (n instanceof AbstractMergeNode) {
                // if a merge is in the loop, all of its phis are also in the loop
                for (PhiNode phi : ((AbstractMergeNode) n).phis()) {
                    nodes.mark(phi);
                }
            }
            nodes.mark(n);
        }
    }
    for (AbstractBeginNode earlyExit : earlyExits) {
        if (earlyExit.isDeleted()) {
            continue;
        }
        nodes.mark(earlyExit);
        if (earlyExit instanceof LoopExitNode) {
            LoopExitNode loopExit = (LoopExitNode) earlyExit;
            FrameState stateAfter = loopExit.stateAfter();
            if (stateAfter != null) {
                stateAfter.applyToVirtual(node -> nodes.mark(node));
            }
            for (ProxyNode proxy : loopExit.proxies()) {
                nodes.mark(proxy);
            }
        }
    }
    final NodeBitMap nonLoopNodes = graph.createNodeBitMap();
    Deque<WorkListEntry> worklist = new ArrayDeque<>();
    for (AbstractBeginNode b : blocks) {
        if (b.isDeleted()) {
            continue;
        }
        for (Node n : b.getBlockNodes()) {
            if (n instanceof CommitAllocationNode) {
                for (VirtualObjectNode obj : ((CommitAllocationNode) n).getVirtualObjects()) {
                    markFloating(worklist, obj, nodes, nonLoopNodes);
                }
            }
            if (n instanceof MonitorEnterNode) {
                markFloating(worklist, ((MonitorEnterNode) n).getMonitorId(), nodes, nonLoopNodes);
            }
            if (n instanceof AbstractMergeNode) {
                /*
                     * Since we already marked all phi nodes as being in the loop to break cycles,
                     * we also have to iterate over their usages here.
                     */
                for (PhiNode phi : ((AbstractMergeNode) n).phis()) {
                    for (Node usage : phi.usages()) {
                        markFloating(worklist, usage, nodes, nonLoopNodes);
                    }
                }
            }
            for (Node usage : n.usages()) {
                markFloating(worklist, usage, nodes, nonLoopNodes);
            }
        }
    }
}
Also used : GuardNode(org.graalvm.compiler.nodes.GuardNode) ValuePhiNode(org.graalvm.compiler.nodes.ValuePhiNode) GuardProxyNode(org.graalvm.compiler.nodes.GuardProxyNode) Deque(java.util.Deque) AbstractMergeNode(org.graalvm.compiler.nodes.AbstractMergeNode) TriState(jdk.vm.ci.meta.TriState) EconomicMap(org.graalvm.collections.EconomicMap) MergeNode(org.graalvm.compiler.nodes.MergeNode) VirtualState(org.graalvm.compiler.nodes.VirtualState) FixedNode(org.graalvm.compiler.nodes.FixedNode) NodeWithState(org.graalvm.compiler.nodes.spi.NodeWithState) Iterator(java.util.Iterator) VirtualObjectNode(org.graalvm.compiler.nodes.virtual.VirtualObjectNode) NodeView(org.graalvm.compiler.nodes.NodeView) AbstractBeginNode(org.graalvm.compiler.nodes.AbstractBeginNode) NodeBitMap(org.graalvm.compiler.graph.NodeBitMap) CommitAllocationNode(org.graalvm.compiler.nodes.virtual.CommitAllocationNode) Graph(org.graalvm.compiler.graph.Graph) ValueNode(org.graalvm.compiler.nodes.ValueNode) ValueProxyNode(org.graalvm.compiler.nodes.ValueProxyNode) DuplicationReplacement(org.graalvm.compiler.graph.Graph.DuplicationReplacement) GuardPhiNode(org.graalvm.compiler.nodes.GuardPhiNode) StructuredGraph(org.graalvm.compiler.nodes.StructuredGraph) FrameState(org.graalvm.compiler.nodes.FrameState) NodeIterable(org.graalvm.compiler.graph.iterators.NodeIterable) Invoke(org.graalvm.compiler.nodes.Invoke) LoopExitNode(org.graalvm.compiler.nodes.LoopExitNode) MonitorEnterNode(org.graalvm.compiler.nodes.java.MonitorEnterNode) Block(org.graalvm.compiler.nodes.cfg.Block) GraalError(org.graalvm.compiler.debug.GraalError) Node(org.graalvm.compiler.graph.Node) EndNode(org.graalvm.compiler.nodes.EndNode) ArrayDeque(java.util.ArrayDeque) Collections(java.util.Collections) PhiNode(org.graalvm.compiler.nodes.PhiNode) ProxyNode(org.graalvm.compiler.nodes.ProxyNode) GuardProxyNode(org.graalvm.compiler.nodes.GuardProxyNode) ValueProxyNode(org.graalvm.compiler.nodes.ValueProxyNode) ProxyNode(org.graalvm.compiler.nodes.ProxyNode) VirtualObjectNode(org.graalvm.compiler.nodes.virtual.VirtualObjectNode) ValuePhiNode(org.graalvm.compiler.nodes.ValuePhiNode) GuardPhiNode(org.graalvm.compiler.nodes.GuardPhiNode) PhiNode(org.graalvm.compiler.nodes.PhiNode) LoopExitNode(org.graalvm.compiler.nodes.LoopExitNode) NodeBitMap(org.graalvm.compiler.graph.NodeBitMap) GuardNode(org.graalvm.compiler.nodes.GuardNode) ValuePhiNode(org.graalvm.compiler.nodes.ValuePhiNode) GuardProxyNode(org.graalvm.compiler.nodes.GuardProxyNode) AbstractMergeNode(org.graalvm.compiler.nodes.AbstractMergeNode) MergeNode(org.graalvm.compiler.nodes.MergeNode) FixedNode(org.graalvm.compiler.nodes.FixedNode) VirtualObjectNode(org.graalvm.compiler.nodes.virtual.VirtualObjectNode) AbstractBeginNode(org.graalvm.compiler.nodes.AbstractBeginNode) CommitAllocationNode(org.graalvm.compiler.nodes.virtual.CommitAllocationNode) ValueNode(org.graalvm.compiler.nodes.ValueNode) ValueProxyNode(org.graalvm.compiler.nodes.ValueProxyNode) GuardPhiNode(org.graalvm.compiler.nodes.GuardPhiNode) LoopExitNode(org.graalvm.compiler.nodes.LoopExitNode) MonitorEnterNode(org.graalvm.compiler.nodes.java.MonitorEnterNode) Node(org.graalvm.compiler.graph.Node) EndNode(org.graalvm.compiler.nodes.EndNode) PhiNode(org.graalvm.compiler.nodes.PhiNode) ProxyNode(org.graalvm.compiler.nodes.ProxyNode) AbstractMergeNode(org.graalvm.compiler.nodes.AbstractMergeNode) FrameState(org.graalvm.compiler.nodes.FrameState) ArrayDeque(java.util.ArrayDeque) AbstractBeginNode(org.graalvm.compiler.nodes.AbstractBeginNode) Invoke(org.graalvm.compiler.nodes.Invoke) MonitorEnterNode(org.graalvm.compiler.nodes.java.MonitorEnterNode) NodeWithState(org.graalvm.compiler.nodes.spi.NodeWithState) CommitAllocationNode(org.graalvm.compiler.nodes.virtual.CommitAllocationNode)

Example 5 with CommitAllocationNode

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

the class PartialEscapeAnalysisTest method testPartialEscapeAnalysis.

@SafeVarargs
protected final void testPartialEscapeAnalysis(String snippet, double expectedProbability, int expectedCount, Class<? extends Node>... invalidNodeClasses) {
    prepareGraph(snippet, false);
    for (AbstractMergeNode merge : graph.getNodes(AbstractMergeNode.TYPE)) {
        merge.setStateAfter(null);
    }
    new DeadCodeEliminationPhase().apply(graph);
    new CanonicalizerPhase().apply(graph, context);
    try {
        Assert.assertTrue("partial escape analysis should have removed all NewInstanceNode allocations", graph.getNodes().filter(NewInstanceNode.class).isEmpty());
        Assert.assertTrue("partial escape analysis should have removed all NewArrayNode allocations", graph.getNodes().filter(NewArrayNode.class).isEmpty());
        ControlFlowGraph cfg = ControlFlowGraph.compute(graph, true, true, false, false);
        double probabilitySum = 0;
        int materializeCount = 0;
        for (CommitAllocationNode materialize : graph.getNodes().filter(CommitAllocationNode.class)) {
            probabilitySum += cfg.blockFor(materialize).probability() * materialize.getVirtualObjects().size();
            materializeCount += materialize.getVirtualObjects().size();
        }
        Assert.assertEquals("unexpected number of MaterializeObjectNodes", expectedCount, materializeCount);
        Assert.assertEquals("unexpected probability of MaterializeObjectNodes", expectedProbability, probabilitySum, 0.01);
        for (Node node : graph.getNodes()) {
            for (Class<? extends Node> clazz : invalidNodeClasses) {
                Assert.assertFalse("instance of invalid class: " + clazz.getSimpleName(), clazz.isInstance(node) && node.usages().isNotEmpty());
            }
        }
    } catch (AssertionError e) {
        TypeSystemTest.outputGraph(graph, snippet + ": " + e.getMessage());
        throw e;
    }
}
Also used : ControlFlowGraph(org.graalvm.compiler.nodes.cfg.ControlFlowGraph) ReturnNode(org.graalvm.compiler.nodes.ReturnNode) BoxNode(org.graalvm.compiler.nodes.extended.BoxNode) LoadFieldNode(org.graalvm.compiler.nodes.java.LoadFieldNode) CommitAllocationNode(org.graalvm.compiler.nodes.virtual.CommitAllocationNode) AbstractMergeNode(org.graalvm.compiler.nodes.AbstractMergeNode) StoreFieldNode(org.graalvm.compiler.nodes.java.StoreFieldNode) Node(org.graalvm.compiler.graph.Node) UnboxNode(org.graalvm.compiler.nodes.extended.UnboxNode) NewArrayNode(org.graalvm.compiler.nodes.java.NewArrayNode) NewInstanceNode(org.graalvm.compiler.nodes.java.NewInstanceNode) LoadIndexedNode(org.graalvm.compiler.nodes.java.LoadIndexedNode) CanonicalizerPhase(org.graalvm.compiler.phases.common.CanonicalizerPhase) AbstractMergeNode(org.graalvm.compiler.nodes.AbstractMergeNode) DeadCodeEliminationPhase(org.graalvm.compiler.phases.common.DeadCodeEliminationPhase) CommitAllocationNode(org.graalvm.compiler.nodes.virtual.CommitAllocationNode)

Aggregations

CommitAllocationNode (org.graalvm.compiler.nodes.virtual.CommitAllocationNode)5 Node (org.graalvm.compiler.graph.Node)4 FixedNode (org.graalvm.compiler.nodes.FixedNode)3 StructuredGraph (org.graalvm.compiler.nodes.StructuredGraph)3 ValueNode (org.graalvm.compiler.nodes.ValueNode)3 AllocatedObjectNode (org.graalvm.compiler.nodes.virtual.AllocatedObjectNode)3 ArrayList (java.util.ArrayList)2 AbstractMergeNode (org.graalvm.compiler.nodes.AbstractMergeNode)2 BoxNode (org.graalvm.compiler.nodes.extended.BoxNode)2 MonitorIdNode (org.graalvm.compiler.nodes.java.MonitorIdNode)2 VirtualObjectNode (org.graalvm.compiler.nodes.virtual.VirtualObjectNode)2 ArrayDeque (java.util.ArrayDeque)1 Collections (java.util.Collections)1 Deque (java.util.Deque)1 Iterator (java.util.Iterator)1 List (java.util.List)1 TriState (jdk.vm.ci.meta.TriState)1 EconomicMap (org.graalvm.collections.EconomicMap)1 GraalError (org.graalvm.compiler.debug.GraalError)1 Graph (org.graalvm.compiler.graph.Graph)1