Mercurial > hg > truffle
diff 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 |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/NodeUtil.java Wed Feb 19 00:39:44 2014 -0800 +++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/NodeUtil.java Thu Feb 20 01:21:49 2014 +0100 @@ -451,13 +451,28 @@ return null; } + public static List<CallTarget> findOutermostCallTargets(Node node) { + RootNode root = node.getRootNode(); + if (root == null) { + return Collections.emptyList(); + } + List<CallTarget> roots = new ArrayList<>(); + roots.add(root.getCallTarget()); + for (CallNode callNode : root.getParentInlinedCalls()) { + roots.addAll(findOutermostCallTargets(callNode)); + } + return roots; + } + /** * Returns the outermost not inlined {@link RootNode} which is a parent of this node. * - * @see RootNode#getParentInlinedCall() + * @see RootNode#getParentInlinedCalls() * @param node to search * @return the outermost {@link RootNode} + * @deprecated use {@link #findOutermostCallTargets(Node)} */ + @Deprecated public static RootNode findOutermostRootNode(Node node) { Node parent = node; while (parent != null) {