Mercurial > hg > truffle
comparison graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Graph.java @ 5488:21cab9000931
.filter() on Graph.getNode now tries to use the fast node iterator if possible
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Wed, 06 Jun 2012 18:55:39 +0200 |
parents | 4a99bfc329f0 |
children | 3bc48971a1bf |
comparison
equal
deleted
inserted
replaced
5487:9743ae819f73 | 5488:21cab9000931 |
---|---|
311 return new NodeIterable<Node>() { | 311 return new NodeIterable<Node>() { |
312 @Override | 312 @Override |
313 public Iterator<Node> iterator() { | 313 public Iterator<Node> iterator() { |
314 return new NodeIterator(); | 314 return new NodeIterator(); |
315 } | 315 } |
316 | |
317 @SuppressWarnings("unchecked") | |
318 @Override | |
319 public <F extends Node> NodeIterable<F> filter(Class<F> clazz) { | |
320 if (IterableNodeType.class.isAssignableFrom(clazz)) { | |
321 return getNodes((Class) clazz); | |
322 } | |
323 return super.filter(clazz); | |
324 } | |
316 }; | 325 }; |
317 } | 326 } |
318 | 327 |
319 private static class TypedNodeIterator<T extends IterableNodeType> implements Iterator<T> { | 328 private static class TypedNodeIterator<T extends IterableNodeType> implements Iterator<T> { |
320 private Node current; | 329 private Node current; |