comparison graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/GraphBuilderContext.java @ 21365:27cd1491237f

improved javadoc for GraphBuilderContext
author Doug Simon <doug.simon@oracle.com>
date Wed, 13 May 2015 13:25:08 +0200
parents 600d37d28494
children 77a775ebd6d4
comparison
equal deleted inserted replaced
21364:600d37d28494 21365:27cd1491237f
34 import com.oracle.graal.nodes.calc.*; 34 import com.oracle.graal.nodes.calc.*;
35 import com.oracle.graal.nodes.spi.*; 35 import com.oracle.graal.nodes.spi.*;
36 import com.oracle.graal.nodes.type.*; 36 import com.oracle.graal.nodes.type.*;
37 37
38 /** 38 /**
39 * Used by a {@link GraphBuilderPlugin} to interface with a graph builder object. 39 * Used by a {@link GraphBuilderPlugin} to interface with an object that parses the bytecode of a
40 * single {@linkplain #getMethod() method} as part of building a {@linkplain #getGraph() graph} .
40 */ 41 */
41 public interface GraphBuilderContext { 42 public interface GraphBuilderContext {
42 43
43 /** 44 /**
44 * Raw operation for adding a node to the graph when neither {@link #add}, 45 * Raw operation for adding a node to the graph when neither {@link #add},
185 } 186 }
186 return ancestor; 187 return ancestor;
187 } 188 }
188 189
189 /** 190 /**
190 * Gets the method currently being parsed. 191 * Gets the method being parsed by this context.
191 */ 192 */
192 ResolvedJavaMethod getMethod(); 193 ResolvedJavaMethod getMethod();
193 194
194 /** 195 /**
195 * Gets the index of the bytecode instruction currently being parsed. 196 * Gets the index of the bytecode instruction currently being parsed.
205 * Gets the return type of the invocation currently being parsed. 206 * Gets the return type of the invocation currently being parsed.
206 */ 207 */
207 JavaType getInvokeReturnType(); 208 JavaType getInvokeReturnType();
208 209
209 /** 210 /**
210 * Gets the inline depth of this context. 0 implies this is the context for the compilation root 211 * Gets the inline depth of this context. A return value of 0 implies that this is the context
211 * method. 212 * for the parse root.
212 */ 213 */
213 default int getDepth() { 214 default int getDepth() {
214 GraphBuilderContext parent = getParent(); 215 GraphBuilderContext parent = getParent();
215 return parent == null ? 0 : 1 + parent.getDepth(); 216 return parent == null ? 0 : 1 + parent.getDepth();
216 } 217 }
217 218
218 /** 219 /**
219 * Determines if the current parsing context is a snippet or method substitution. 220 * Determines if this parsing context is within the bytecode of an intrinsic or a method inlined
221 * by an intrinsic.
220 */ 222 */
221 default boolean parsingIntrinsic() { 223 default boolean parsingIntrinsic() {
222 return getIntrinsic() != null; 224 return getIntrinsic() != null;
223 } 225 }
224 226