Mercurial > hg > graal-jvmci-8
annotate graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/CallNode.java @ 14991:64dcb92ee75a
Truffle: Change signature for Truffle calls from (PackedFrame, Arguments) to (Object[]).
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Sun, 06 Apr 2014 17:46:24 +0200 |
parents | 1422f0bd55e3 |
children | f675818d9ad0 |
rev | line source |
---|---|
13803
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
1 /* |
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
2 * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. |
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
4 * |
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. Oracle designates this |
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
8 * particular file as subject to the "Classpath" exception as provided |
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
9 * by Oracle in the LICENSE file that accompanied this code. |
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
10 * |
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
11 * This code is distributed in the hope that it will be useful, but WITHOUT |
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
14 * version 2 for more details (a copy is included in the LICENSE file that |
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
15 * accompanied this code). |
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
16 * |
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
17 * You should have received a copy of the GNU General Public License version |
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
18 * 2 along with this work; if not, write to the Free Software Foundation, |
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
20 * |
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
22 * or visit www.oracle.com if you need additional information or have any |
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
23 * questions. |
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
24 */ |
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
25 package com.oracle.truffle.api.nodes; |
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
26 |
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
27 import com.oracle.truffle.api.*; |
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
28 |
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
29 /** |
14566
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
30 * Represents a call to a {@link CallTarget} in the Truffle AST. Addtionally to calling the |
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
31 * {@link CallTarget} this {@link Node} enables the runtime system to implement further |
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
32 * optimizations. Optimizations that can possibly applied to a {@link CallNode} are inlining and |
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
33 * splitting. Inlining inlines this call site into the call graph of the parent {@link CallTarget}. |
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
34 * Splitting duplicates the {@link CallTarget} using {@link RootNode#split()} to collect call site |
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
35 * sensitive profiling information. |
14991
64dcb92ee75a
Truffle: Change signature for Truffle calls from (PackedFrame, Arguments) to (Object[]).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
14982
diff
changeset
|
36 * |
14566
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
37 * Please note: This class is not intended to be subclassed by guest language implementations. |
14991
64dcb92ee75a
Truffle: Change signature for Truffle calls from (PackedFrame, Arguments) to (Object[]).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
14982
diff
changeset
|
38 * |
14566
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
39 * @see TruffleRuntime#createCallNode(CallTarget) |
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
40 * @see #inline() |
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
41 * @see #split() |
13803
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
42 */ |
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
43 public abstract class CallNode extends Node { |
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
44 |
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
45 protected final CallTarget callTarget; |
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
46 |
13983
f46cab39a9a2
Truffle: Updated inlining API. Pushed inlining implementation to the Truffle runtime.
Christian Humer <christian.humer@gmail.com>
parents:
13851
diff
changeset
|
47 protected CallNode(CallTarget callTarget) { |
13803
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
48 this.callTarget = callTarget; |
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
49 } |
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
50 |
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
51 /** |
14566
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
52 * Calls the inner {@link CallTarget} returned by {@link #getCurrentCallTarget()}. |
14991
64dcb92ee75a
Truffle: Change signature for Truffle calls from (PackedFrame, Arguments) to (Object[]).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
14982
diff
changeset
|
53 * |
13803
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
54 * @param arguments the arguments that should be passed to the callee |
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
55 * @return the return result of the call |
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
56 */ |
14991
64dcb92ee75a
Truffle: Change signature for Truffle calls from (PackedFrame, Arguments) to (Object[]).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
14982
diff
changeset
|
57 public abstract Object call(Object[] arguments); |
13803
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
58 |
14073
c5411233cdf8
Truffle: Now keeps track of all not just inlined call-sites called by CallNode. Deprecated some old API in NodeUtil.
Christian Humer <christian.humer@gmail.com>
parents:
13983
diff
changeset
|
59 /** |
c5411233cdf8
Truffle: Now keeps track of all not just inlined call-sites called by CallNode. Deprecated some old API in NodeUtil.
Christian Humer <christian.humer@gmail.com>
parents:
13983
diff
changeset
|
60 * Returns the originally supplied {@link CallTarget} when this call node was created. Please |
c5411233cdf8
Truffle: Now keeps track of all not just inlined call-sites called by CallNode. Deprecated some old API in NodeUtil.
Christian Humer <christian.humer@gmail.com>
parents:
13983
diff
changeset
|
61 * note that the returned {@link CallTarget} is not necessarily the {@link CallTarget} that is |
c5411233cdf8
Truffle: Now keeps track of all not just inlined call-sites called by CallNode. Deprecated some old API in NodeUtil.
Christian Humer <christian.humer@gmail.com>
parents:
13983
diff
changeset
|
62 * called. For that use {@link #getCurrentCallTarget()} instead. |
14991
64dcb92ee75a
Truffle: Change signature for Truffle calls from (PackedFrame, Arguments) to (Object[]).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
14982
diff
changeset
|
63 * |
14073
c5411233cdf8
Truffle: Now keeps track of all not just inlined call-sites called by CallNode. Deprecated some old API in NodeUtil.
Christian Humer <christian.humer@gmail.com>
parents:
13983
diff
changeset
|
64 * @return the {@link CallTarget} provided. |
c5411233cdf8
Truffle: Now keeps track of all not just inlined call-sites called by CallNode. Deprecated some old API in NodeUtil.
Christian Humer <christian.humer@gmail.com>
parents:
13983
diff
changeset
|
65 */ |
c5411233cdf8
Truffle: Now keeps track of all not just inlined call-sites called by CallNode. Deprecated some old API in NodeUtil.
Christian Humer <christian.humer@gmail.com>
parents:
13983
diff
changeset
|
66 public CallTarget getCallTarget() { |
c5411233cdf8
Truffle: Now keeps track of all not just inlined call-sites called by CallNode. Deprecated some old API in NodeUtil.
Christian Humer <christian.humer@gmail.com>
parents:
13983
diff
changeset
|
67 return callTarget; |
c5411233cdf8
Truffle: Now keeps track of all not just inlined call-sites called by CallNode. Deprecated some old API in NodeUtil.
Christian Humer <christian.humer@gmail.com>
parents:
13983
diff
changeset
|
68 } |
c5411233cdf8
Truffle: Now keeps track of all not just inlined call-sites called by CallNode. Deprecated some old API in NodeUtil.
Christian Humer <christian.humer@gmail.com>
parents:
13983
diff
changeset
|
69 |
13803
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
70 /** |
14566
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
71 * Returns <code>true</code> if the underlying runtime system supports inlining for the |
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
72 * {@link CallTarget} in this {@link CallNode}. |
14991
64dcb92ee75a
Truffle: Change signature for Truffle calls from (PackedFrame, Arguments) to (Object[]).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
14982
diff
changeset
|
73 * |
14566
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
74 * @return true if inlining is supported. |
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
75 */ |
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
76 public abstract boolean isInlinable(); |
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
77 |
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
78 /** |
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
79 * Returns <code>true</code> if the {@link CallTarget} in this {@link CallNode} is inlined. A |
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
80 * {@link CallNode} can either be inlined manually by invoking {@link #inline()} or by the |
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
81 * runtime system which may at any point decide to inline. |
14991
64dcb92ee75a
Truffle: Change signature for Truffle calls from (PackedFrame, Arguments) to (Object[]).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
14982
diff
changeset
|
82 * |
14566
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
83 * @return true if this method was inlined else false. |
13803
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
84 */ |
13804 | 85 public abstract boolean isInlined(); |
13803
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
86 |
14566
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
87 /** |
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
88 * Enforces the runtime system to inline the {@link CallTarget} at this call site. If the |
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
89 * runtime system does not support inlining or it is already inlined this method has no effect. |
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
90 */ |
13983
f46cab39a9a2
Truffle: Updated inlining API. Pushed inlining implementation to the Truffle runtime.
Christian Humer <christian.humer@gmail.com>
parents:
13851
diff
changeset
|
91 public abstract void inline(); |
f46cab39a9a2
Truffle: Updated inlining API. Pushed inlining implementation to the Truffle runtime.
Christian Humer <christian.humer@gmail.com>
parents:
13851
diff
changeset
|
92 |
14566
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
93 /** |
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
94 * Returns <code>true</code> if this {@link CallNode} can be split. A {@link CallNode} can only |
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
95 * be split if the runtime system supports splitting and if the {@link RootNode} contained the |
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
96 * {@link CallTarget} returns <code>true</code> for {@link RootNode#isSplittable()}. |
14991
64dcb92ee75a
Truffle: Change signature for Truffle calls from (PackedFrame, Arguments) to (Object[]).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
14982
diff
changeset
|
97 * |
14566
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
98 * @return <code>true</code> if the target can be split |
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
99 */ |
13983
f46cab39a9a2
Truffle: Updated inlining API. Pushed inlining implementation to the Truffle runtime.
Christian Humer <christian.humer@gmail.com>
parents:
13851
diff
changeset
|
100 public abstract boolean isSplittable(); |
13803
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
101 |
14566
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
102 /** |
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
103 * Enforces the runtime system to split the {@link CallTarget}. If the {@link CallNode} is not |
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
104 * splittable this methods has no effect. |
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
105 */ |
13983
f46cab39a9a2
Truffle: Updated inlining API. Pushed inlining implementation to the Truffle runtime.
Christian Humer <christian.humer@gmail.com>
parents:
13851
diff
changeset
|
106 public abstract boolean split(); |
f46cab39a9a2
Truffle: Updated inlining API. Pushed inlining implementation to the Truffle runtime.
Christian Humer <christian.humer@gmail.com>
parents:
13851
diff
changeset
|
107 |
14566
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
108 /** |
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
109 * Returns <code>true</code> if the target of the {@link CallNode} was split. |
14991
64dcb92ee75a
Truffle: Change signature for Truffle calls from (PackedFrame, Arguments) to (Object[]).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
14982
diff
changeset
|
110 * |
14566
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
111 * @return if the target was split |
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
112 */ |
14073
c5411233cdf8
Truffle: Now keeps track of all not just inlined call-sites called by CallNode. Deprecated some old API in NodeUtil.
Christian Humer <christian.humer@gmail.com>
parents:
13983
diff
changeset
|
113 public final boolean isSplit() { |
c5411233cdf8
Truffle: Now keeps track of all not just inlined call-sites called by CallNode. Deprecated some old API in NodeUtil.
Christian Humer <christian.humer@gmail.com>
parents:
13983
diff
changeset
|
114 return getSplitCallTarget() != null; |
c5411233cdf8
Truffle: Now keeps track of all not just inlined call-sites called by CallNode. Deprecated some old API in NodeUtil.
Christian Humer <christian.humer@gmail.com>
parents:
13983
diff
changeset
|
115 } |
c5411233cdf8
Truffle: Now keeps track of all not just inlined call-sites called by CallNode. Deprecated some old API in NodeUtil.
Christian Humer <christian.humer@gmail.com>
parents:
13983
diff
changeset
|
116 |
14566
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
117 /** |
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
118 * Returns the splitted {@link CallTarget} if this method is split. |
14991
64dcb92ee75a
Truffle: Change signature for Truffle calls from (PackedFrame, Arguments) to (Object[]).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
14982
diff
changeset
|
119 * |
14566
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
120 * @return the split {@link CallTarget} |
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
121 */ |
13983
f46cab39a9a2
Truffle: Updated inlining API. Pushed inlining implementation to the Truffle runtime.
Christian Humer <christian.humer@gmail.com>
parents:
13851
diff
changeset
|
122 public abstract CallTarget getSplitCallTarget(); |
f46cab39a9a2
Truffle: Updated inlining API. Pushed inlining implementation to the Truffle runtime.
Christian Humer <christian.humer@gmail.com>
parents:
13851
diff
changeset
|
123 |
14073
c5411233cdf8
Truffle: Now keeps track of all not just inlined call-sites called by CallNode. Deprecated some old API in NodeUtil.
Christian Humer <christian.humer@gmail.com>
parents:
13983
diff
changeset
|
124 /** |
14991
64dcb92ee75a
Truffle: Change signature for Truffle calls from (PackedFrame, Arguments) to (Object[]).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
14982
diff
changeset
|
125 * Returns the used call target when {@link #call(Object[])} is invoked. If the |
14566
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
126 * {@link CallTarget} was split this method returns the {@link CallTarget} returned by |
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
127 * {@link #getSplitCallTarget()}. |
14991
64dcb92ee75a
Truffle: Change signature for Truffle calls from (PackedFrame, Arguments) to (Object[]).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
14982
diff
changeset
|
128 * |
14073
c5411233cdf8
Truffle: Now keeps track of all not just inlined call-sites called by CallNode. Deprecated some old API in NodeUtil.
Christian Humer <christian.humer@gmail.com>
parents:
13983
diff
changeset
|
129 * @return the used {@link CallTarget} when node is called |
c5411233cdf8
Truffle: Now keeps track of all not just inlined call-sites called by CallNode. Deprecated some old API in NodeUtil.
Christian Humer <christian.humer@gmail.com>
parents:
13983
diff
changeset
|
130 */ |
c5411233cdf8
Truffle: Now keeps track of all not just inlined call-sites called by CallNode. Deprecated some old API in NodeUtil.
Christian Humer <christian.humer@gmail.com>
parents:
13983
diff
changeset
|
131 public CallTarget getCurrentCallTarget() { |
c5411233cdf8
Truffle: Now keeps track of all not just inlined call-sites called by CallNode. Deprecated some old API in NodeUtil.
Christian Humer <christian.humer@gmail.com>
parents:
13983
diff
changeset
|
132 CallTarget split = getSplitCallTarget(); |
c5411233cdf8
Truffle: Now keeps track of all not just inlined call-sites called by CallNode. Deprecated some old API in NodeUtil.
Christian Humer <christian.humer@gmail.com>
parents:
13983
diff
changeset
|
133 if (split != null) { |
c5411233cdf8
Truffle: Now keeps track of all not just inlined call-sites called by CallNode. Deprecated some old API in NodeUtil.
Christian Humer <christian.humer@gmail.com>
parents:
13983
diff
changeset
|
134 return split; |
c5411233cdf8
Truffle: Now keeps track of all not just inlined call-sites called by CallNode. Deprecated some old API in NodeUtil.
Christian Humer <christian.humer@gmail.com>
parents:
13983
diff
changeset
|
135 } else { |
c5411233cdf8
Truffle: Now keeps track of all not just inlined call-sites called by CallNode. Deprecated some old API in NodeUtil.
Christian Humer <christian.humer@gmail.com>
parents:
13983
diff
changeset
|
136 return getCallTarget(); |
c5411233cdf8
Truffle: Now keeps track of all not just inlined call-sites called by CallNode. Deprecated some old API in NodeUtil.
Christian Humer <christian.humer@gmail.com>
parents:
13983
diff
changeset
|
137 } |
c5411233cdf8
Truffle: Now keeps track of all not just inlined call-sites called by CallNode. Deprecated some old API in NodeUtil.
Christian Humer <christian.humer@gmail.com>
parents:
13983
diff
changeset
|
138 } |
c5411233cdf8
Truffle: Now keeps track of all not just inlined call-sites called by CallNode. Deprecated some old API in NodeUtil.
Christian Humer <christian.humer@gmail.com>
parents:
13983
diff
changeset
|
139 |
14566
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
140 /** |
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
141 * Returns the {@link RootNode} associated with {@link CallTarget} returned by |
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
142 * {@link #getCurrentCallTarget()}. If the stored {@link CallTarget} does not contain a |
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
143 * {@link RootNode} this method returns <code>null</code>. |
14991
64dcb92ee75a
Truffle: Change signature for Truffle calls from (PackedFrame, Arguments) to (Object[]).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
14982
diff
changeset
|
144 * |
14566
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
145 * @see #getCurrentCallTarget() |
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
146 * @return the root node of the used call target |
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
147 */ |
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
148 public final RootNode getCurrentRootNode() { |
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
149 CallTarget target = getCurrentCallTarget(); |
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
150 if (target instanceof RootCallTarget) { |
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
151 return ((RootCallTarget) target).getRootNode(); |
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
152 } |
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
153 return null; |
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
154 } |
6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
Christian Humer <christian.humer@gmail.com>
parents:
14565
diff
changeset
|
155 |
13803
e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
156 } |