Mercurial > hg > truffle
comparison graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/NodeUtil.java @ 13983:f46cab39a9a2
Truffle: Updated inlining API. Pushed inlining implementation to the Truffle runtime.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Thu, 20 Feb 2014 01:21:49 +0100 |
parents | 641f22b1c6b8 |
children | e455fc531ec2 |
comparison
equal
deleted
inserted
replaced
13977:39076a984c33 | 13983:f46cab39a9a2 |
---|---|
449 } | 449 } |
450 } | 450 } |
451 return null; | 451 return null; |
452 } | 452 } |
453 | 453 |
454 public static List<CallTarget> findOutermostCallTargets(Node node) { | |
455 RootNode root = node.getRootNode(); | |
456 if (root == null) { | |
457 return Collections.emptyList(); | |
458 } | |
459 List<CallTarget> roots = new ArrayList<>(); | |
460 roots.add(root.getCallTarget()); | |
461 for (CallNode callNode : root.getParentInlinedCalls()) { | |
462 roots.addAll(findOutermostCallTargets(callNode)); | |
463 } | |
464 return roots; | |
465 } | |
466 | |
454 /** | 467 /** |
455 * Returns the outermost not inlined {@link RootNode} which is a parent of this node. | 468 * Returns the outermost not inlined {@link RootNode} which is a parent of this node. |
456 * | 469 * |
457 * @see RootNode#getParentInlinedCall() | 470 * @see RootNode#getParentInlinedCalls() |
458 * @param node to search | 471 * @param node to search |
459 * @return the outermost {@link RootNode} | 472 * @return the outermost {@link RootNode} |
473 * @deprecated use {@link #findOutermostCallTargets(Node)} | |
460 */ | 474 */ |
475 @Deprecated | |
461 public static RootNode findOutermostRootNode(Node node) { | 476 public static RootNode findOutermostRootNode(Node node) { |
462 Node parent = node; | 477 Node parent = node; |
463 while (parent != null) { | 478 while (parent != null) { |
464 if (parent instanceof RootNode) { | 479 if (parent instanceof RootNode) { |
465 RootNode root = (RootNode) parent; | 480 RootNode root = (RootNode) parent; |