| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. | 1 // Copyright (c) 2011, the Dart project authors. |
| 2 // All Rights Reserved. | 2 // All Rights Reserved. |
| 3 /** | 3 /** |
| 4 * Class CFG | 4 * Class CFG |
| 5 * | 5 * |
| 6 * A simple class simulating the concept of a control flow graph. | 6 * A simple class simulating the concept of a control flow graph. |
| 7 * | 7 * |
| 8 * CFG maintains a list of nodes, plus a start node. That's it. | 8 * CFG maintains a list of nodes, plus a start node. That's it. |
| 9 */ | 9 */ |
| 10 class CFG { | 10 class CFG { |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 } | 460 } |
| 461 nonBackPreds[x.getDfsNumber()].forEach( | 461 nonBackPreds[x.getDfsNumber()].forEach( |
| 462 function f(int iter) { | 462 function f(int iter) { |
| 463 UnionFindNode y = nodes[iter]; | 463 UnionFindNode y = nodes[iter]; |
| 464 UnionFindNode ydash = y.findSet(); | 464 UnionFindNode ydash = y.findSet(); |
| 465 if (!isAncestor(w.ydash.getDfsNumber(), last)) { | 465 if (!isAncestor(w.ydash.getDfsNumber(), last)) { |
| 466 type[w] = BB.IRREDUCIBLE; | 466 type[w] = BB.IRREDUCIBLE; |
| 467 nonBackPreds[w].add(ydash.getDfsnumber()); | 467 nonBackPreds[w].add(ydash.getDfsnumber()); |
| 468 } else { | 468 } else { |
| 469 if (ydash.getDfsNumber() != w) { | 469 if (ydash.getDfsNumber() != w) { |
| 470 if (!nodePool.some( | 470 if (!nodePool.any( |
| 471 function f(UnionFindNode x) { | 471 function f(UnionFindNode x) { |
| 472 return x == ydash; | 472 return x == ydash; |
| 473 })) { | 473 })) { |
| 474 workList.addLast(ydash); | 474 workList.addLast(ydash); |
| 475 nodePool.addLast(ydash); | 475 nodePool.addLast(ydash); |
| 476 } | 476 } |
| 477 } | 477 } |
| 478 } | 478 } |
| 479 }); | 479 }); |
| 480 } | 480 } |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 815 | 815 |
| 816 class Out { | 816 class Out { |
| 817 static void write(String str) { | 817 static void write(String str) { |
| 818 Havlak.window.document.write(str); | 818 Havlak.window.document.write(str); |
| 819 } | 819 } |
| 820 | 820 |
| 821 static void writeln(String str) { | 821 static void writeln(String str) { |
| 822 Havlak.window.document.writeln(str); | 822 Havlak.window.document.writeln(str); |
| 823 } | 823 } |
| 824 } | 824 } |
| OLD | NEW |