Mercurial > hg > truffle
diff graal/GraalGraph/src/com/oracle/graal/graph/NodeArray.java @ 2779:93ec3f067420
Changed CriticalEdgeFinder to use LIRBlock.
author | Thomas Wuerthinger <thomas@wuerthinger.net> |
---|---|
date | Wed, 25 May 2011 11:04:59 +0200 |
parents | 43ffa0e47a46 |
children | 915456e4959e |
line wrap: on
line diff
--- a/graal/GraalGraph/src/com/oracle/graal/graph/NodeArray.java Tue May 24 21:39:45 2011 +0200 +++ b/graal/GraalGraph/src/com/oracle/graal/graph/NodeArray.java Wed May 25 11:04:59 2011 +0200 @@ -127,6 +127,17 @@ return false; } + public int replace(Node toReplace, Node replacement) { + int result = 0; + for (int i = 0; i < nodes.length; i++) { + if (nodes[i] == toReplace) { + set(i, replacement); + result++; + } + } + return result; + } + public int size() { return nodes.length; }