comparison truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java @ 22219:1c0f490984d5

Merge with f47b601edbc626dcfe8b3636933b4834c89f7779
author Michael Van De Vanter <michael.van.de.vanter@oracle.com>
date Wed, 16 Sep 2015 15:36:22 -0700
parents dc83cc1f94f2 3aad794eec0e
children f78c72e2e0b6
comparison
equal deleted inserted replaced
22160:0599e2df6a9f 22219:1c0f490984d5
34 import com.oracle.truffle.api.frame.FrameDescriptor; 34 import com.oracle.truffle.api.frame.FrameDescriptor;
35 import com.oracle.truffle.api.frame.FrameInstance; 35 import com.oracle.truffle.api.frame.FrameInstance;
36 import com.oracle.truffle.api.frame.VirtualFrame; 36 import com.oracle.truffle.api.frame.VirtualFrame;
37 import com.oracle.truffle.api.impl.DefaultCompilerOptions; 37 import com.oracle.truffle.api.impl.DefaultCompilerOptions;
38 import com.oracle.truffle.api.instrument.ASTProber; 38 import com.oracle.truffle.api.instrument.ASTProber;
39 import com.oracle.truffle.api.instrument.Probe;
40 import com.oracle.truffle.api.source.SourceSection; 39 import com.oracle.truffle.api.source.SourceSection;
41 40
42 /** 41 /**
43 * A root node is a node with a method to execute it given only a frame as a parameter. Therefore, a 42 * A root node is a node with a method to execute it given only a frame as a parameter. Therefore, a
44 * root node can be used to create a call target using 43 * root node can be used to create a call target using
160 * the correct <code>ExecutionContext</code> to be determined for a <code>RootNode</code> (and 159 * the correct <code>ExecutionContext</code> to be determined for a <code>RootNode</code> (and
161 * so also for a {@link RootCallTarget} and a {@link FrameInstance} obtained from the call 160 * so also for a {@link RootCallTarget} and a {@link FrameInstance} obtained from the call
162 * stack) without prior knowledge of the language it has come from. 161 * stack) without prior knowledge of the language it has come from.
163 * 162 *
164 * Used for instance to determine the language of a <code>RootNode<code>: 163 * Used for instance to determine the language of a <code>RootNode<code>:
165 * 164 *
166 * <pre> 165 * <pre>
167 * <code> 166 * <code>
168 * rootNode.getExecutionContext().getLanguageShortName(); 167 * rootNode.getExecutionContext().getLanguageShortName();
169 * </code> </pre> 168 * </code> </pre>
170 * 169 *
186 return context.getCompilerOptions(); 185 return context.getCompilerOptions();
187 } 186 }
188 } 187 }
189 188
190 /** 189 /**
191 * Apply all registered instances of {@link ASTProber} to the AST, if any, held by this root 190 * Apply to the AST all instances of {@link ASTProber} specified for the language, if any, held
192 * node. This can only be done once the AST is complete, notably once all parent pointers are 191 * by this root node. This can only be done once the AST is complete, notably once all parent
193 * correctly assigned. But it also must be done before any AST cloning or execution. 192 * pointers are correctly assigned. But it also must be done before any AST cloning or
193 * execution.
194 * <p> 194 * <p>
195 * If this is not done, then the AST will not be subject to debugging or any other 195 * If this is not done, then the AST will not be subject to debugging or any other
196 * instrumentation-supported tooling. 196 * instrumentation-supported tooling.
197 * <p> 197 * <p>
198 * Implementations should ensure that instrumentation is never applied more than once to an AST, 198 * Implementations should ensure that instrumentation is never applied more than once to an AST,
199 * as this is not guaranteed to be error-free. 199 * as this is not guaranteed to be error-free.
200 * 200 *
201 * @see Probe#registerASTProber(com.oracle.truffle.api.instrument.ASTProber) 201 * @see TruffleLanguage
202 */ 202 */
203 public void applyInstrumentation() { 203 public void applyInstrumentation() {
204 } 204 }
205 205
206 /** 206 /**