src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragment.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Cdiff src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragment.java

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragment.java

Print this page

        

*** 129,138 **** --- 129,140 ---- return l.loopBegin().graph(); } protected abstract DuplicationReplacement getDuplicationReplacement(); + protected abstract void beforeDuplication(); + protected abstract void finishDuplication(); protected void patchNodes(final DuplicationReplacement dataFix) { if (isDuplicate() && !nodesReady) { assert !original.isDuplicate();
*** 160,169 **** --- 162,172 ---- } }; } else { dr = null; } + beforeDuplication(); NodeIterable<Node> nodesIterable = original().nodes(); duplicationMap = graph().addDuplicates(nodesIterable, graph(), nodesIterable.count(), dr); finishDuplication(); nodesReady = true; } else {
*** 173,189 **** protected static NodeBitMap computeNodes(Graph graph, Iterable<AbstractBeginNode> blocks) { return computeNodes(graph, blocks, Collections.emptyList()); } ! protected static NodeBitMap computeNodes(Graph graph, Iterable<AbstractBeginNode> blocks, Iterable<LoopExitNode> earlyExits) { final NodeBitMap nodes = graph.createNodeBitMap(); computeNodes(nodes, graph, blocks, earlyExits); return nodes; } ! protected static void computeNodes(NodeBitMap nodes, Graph graph, Iterable<AbstractBeginNode> blocks, Iterable<LoopExitNode> earlyExits) { for (AbstractBeginNode b : blocks) { if (b.isDeleted()) { continue; } --- 176,192 ---- protected static NodeBitMap computeNodes(Graph graph, Iterable<AbstractBeginNode> blocks) { return computeNodes(graph, blocks, Collections.emptyList()); } ! protected static NodeBitMap computeNodes(Graph graph, Iterable<AbstractBeginNode> blocks, Iterable<AbstractBeginNode> earlyExits) { final NodeBitMap nodes = graph.createNodeBitMap(); computeNodes(nodes, graph, blocks, earlyExits); return nodes; } ! protected static void computeNodes(NodeBitMap nodes, Graph graph, Iterable<AbstractBeginNode> blocks, Iterable<AbstractBeginNode> earlyExits) { for (AbstractBeginNode b : blocks) { if (b.isDeleted()) { continue; }
*** 196,219 **** withState.states().forEach(state -> state.applyToVirtual(node -> nodes.mark(node))); } nodes.mark(n); } } ! for (LoopExitNode earlyExit : earlyExits) { if (earlyExit.isDeleted()) { continue; } ! FrameState stateAfter = earlyExit.stateAfter(); if (stateAfter != null) { stateAfter.applyToVirtual(node -> nodes.mark(node)); } ! nodes.mark(earlyExit); ! for (ProxyNode proxy : earlyExit.proxies()) { nodes.mark(proxy); } } final NodeBitMap nonLoopNodes = graph.createNodeBitMap(); for (AbstractBeginNode b : blocks) { if (b.isDeleted()) { continue; --- 199,226 ---- withState.states().forEach(state -> state.applyToVirtual(node -> nodes.mark(node))); } 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(); for (AbstractBeginNode b : blocks) { if (b.isDeleted()) { continue;
*** 300,325 **** } }; } ! public static NodeIterable<LoopExitNode> toHirExits(final Iterable<Block> blocks) { ! return new NodeIterable<LoopExitNode>() { @Override ! public Iterator<LoopExitNode> iterator() { final Iterator<Block> it = blocks.iterator(); ! return new Iterator<LoopExitNode>() { @Override public void remove() { throw new UnsupportedOperationException(); } @Override ! public LoopExitNode next() { ! return (LoopExitNode) it.next().getBeginNode(); } @Override public boolean hasNext() { return it.hasNext(); --- 307,340 ---- } }; } ! public static NodeIterable<AbstractBeginNode> toHirExits(final Iterable<Block> blocks) { ! return new NodeIterable<AbstractBeginNode>() { @Override ! public Iterator<AbstractBeginNode> iterator() { final Iterator<Block> it = blocks.iterator(); ! return new Iterator<AbstractBeginNode>() { @Override public void remove() { throw new UnsupportedOperationException(); } + /** + * Return the true LoopExitNode for this loop or the BeginNode for the block. + */ @Override ! public AbstractBeginNode next() { ! Block next = it.next(); ! LoopExitNode exit = next.getLoopExit(); ! if (exit != null) { ! return exit; ! } ! return next.getBeginNode(); } @Override public boolean hasNext() { return it.hasNext();
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragment.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File