# HG changeset patch # User Gilles Duboscq # Date 1367928276 -7200 # Node ID 20c09d314168f62f0b926ca391b39761699c2095 # Parent ffbb0a3650390aabceafd98dadaf0e82256e4a65 Improve markFloating in LoopFragment (avoids recursion explosion) diff -r ffbb0a365039 -r 20c09d314168 graal/com.oracle.graal.loop/src/com/oracle/graal/loop/LoopFragment.java --- a/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/LoopFragment.java Tue May 07 11:37:23 2013 +0200 +++ b/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/LoopFragment.java Tue May 07 14:04:36 2013 +0200 @@ -183,10 +183,11 @@ } } + final NodeBitMap notloopNodes = graph.createNodeBitMap(true); for (AbstractBeginNode b : blocks) { for (Node n : b.getBlockNodes()) { for (Node usage : n.usages()) { - markFloating(usage, nodes); + markFloating(usage, nodes, notloopNodes); } } } @@ -194,10 +195,13 @@ return nodes; } - private static boolean markFloating(Node n, NodeBitMap loopNodes) { + private static boolean markFloating(Node n, NodeBitMap loopNodes, NodeBitMap notloopNodes) { if (loopNodes.isMarked(n)) { return true; } + if (notloopNodes.isMarked(n)) { + return false; + } if (n instanceof FixedNode) { return false; } @@ -208,11 +212,12 @@ if (mark) { loopNodes.mark(n); } else { + notloopNodes.mark(n); return false; } } for (Node usage : n.usages()) { - if (markFloating(usage, loopNodes)) { + if (markFloating(usage, loopNodes, notloopNodes)) { mark = true; } } @@ -220,6 +225,7 @@ loopNodes.mark(n); return true; } + notloopNodes.mark(n); return false; }