comparison graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/CallNode.java @ 15089:448338c9ce96

Truffle: Made inlining context-insensitive again to reduce complexity.
author Christian Humer <christian.humer@gmail.com>
date Mon, 14 Apr 2014 18:25:23 +0200
parents f675818d9ad0
children 07e7aae05983
comparison
equal deleted inserted replaced
15088:d3add9b82b71 15089:448338c9ce96
23 * questions. 23 * questions.
24 */ 24 */
25 package com.oracle.truffle.api.nodes; 25 package com.oracle.truffle.api.nodes;
26 26
27 import com.oracle.truffle.api.*; 27 import com.oracle.truffle.api.*;
28 import com.oracle.truffle.api.CompilerDirectives.CompilationFinal;
29 import com.oracle.truffle.api.frame.FrameInstance.FrameAccess;
30 import com.oracle.truffle.api.frame.*; 28 import com.oracle.truffle.api.frame.*;
31 29
32 /** 30 /**
33 * Represents a call to a {@link CallTarget} in the Truffle AST. In addition to calling the 31 * Represents a call to a {@link CallTarget} in the Truffle AST. In addition to calling the
34 * {@link CallTarget}, this {@link Node} enables the runtime system to implement further 32 * {@link CallTarget}, this {@link Node} enables the runtime system to implement further
38 * sensitive profiling information. 36 * sensitive profiling information.
39 * 37 *
40 * Please note: This class is not intended to be subclassed by guest language implementations. 38 * Please note: This class is not intended to be subclassed by guest language implementations.
41 * 39 *
42 * @see TruffleRuntime#createCallNode(CallTarget) 40 * @see TruffleRuntime#createCallNode(CallTarget)
43 * @see #inline() 41 * @see #forceInlining()
44 * @see #split() 42 * @see #split()
45 */ 43 */
46 public abstract class CallNode extends Node { 44 public abstract class CallNode extends Node {
47 45
48 protected final CallTarget callTarget; 46 protected final CallTarget callTarget;
77 * @return true if inlining is supported. 75 * @return true if inlining is supported.
78 */ 76 */
79 public abstract boolean isInlinable(); 77 public abstract boolean isInlinable();
80 78
81 /** 79 /**
82 * Returns <code>true</code> if the {@link CallTarget} in this {@link CallNode} is inlined. A 80 * Returns <code>true</code> if the {@link CallTarget} is forced to be inlined. A
83 * {@link CallNode} can either be inlined manually by invoking {@link #inline()} or by the 81 * {@link CallNode} can either be inlined manually by invoking {@link #forceInlining()} or by
84 * runtime system which may at any point decide to inline. 82 * the runtime system which may at any point decide to inline.
85 * 83 *
86 * @return true if this method was inlined else false. 84 * @return true if this method was inlined else false.
87 */ 85 */
88 public abstract boolean isInlined(); 86 public abstract boolean isInliningForced();
89 87
90 /** 88 /**
91 * Enforces the runtime system to inline the {@link CallTarget} at this call site. If the 89 * Enforces the runtime system to inline the {@link CallTarget} at this call site. If the
92 * runtime system does not support inlining or it is already inlined this method has no effect. 90 * runtime system does not support inlining or it is already inlined this method has no effect.
93 */ 91 */
94 public abstract void inline(); 92 public abstract void forceInlining();
93
94 /**
95 * Returns true if the runtime system has decided to inline this call-site. If the
96 * {@link CallNode} was forced to inline then this does not necessarily mean that the
97 * {@link CallNode} is really going to be inlined. This depends on whether or not the runtime
98 * system supports inlining or not. The runtime system may also decide to ignore calls to
99 * {@link #forceInlining()}.
100 */
101 public abstract boolean isInlined();
95 102
96 /** 103 /**
97 * Returns <code>true</code> if this {@link CallNode} can be split. A {@link CallNode} can only 104 * Returns <code>true</code> if this {@link CallNode} can be split. A {@link CallNode} can only
98 * be split if the runtime system supports splitting and if the {@link RootNode} contained the 105 * be split if the runtime system supports splitting and if the {@link RootNode} contained the
99 * {@link CallTarget} returns <code>true</code> for {@link RootNode#isSplittable()}. 106 * {@link CallTarget} returns <code>true</code> for {@link RootNode#isSplittable()}.