Mercurial > hg > graal-jvmci-8
comparison graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/Node.java @ 14566:6681b9eb3f4c
Truffle: API cleanup and javadoc for CallNodes.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Mon, 17 Mar 2014 14:29:45 +0100 |
parents | 5d1308c78ddc |
children | 6189c1983cd3 |
comparison
equal
deleted
inserted
replaced
14565:9c01fabfb167 | 14566:6681b9eb3f4c |
---|---|
79 } | 79 } |
80 } | 80 } |
81 this.sourceSection = section; | 81 this.sourceSection = section; |
82 } | 82 } |
83 | 83 |
84 /** | |
85 * Returns a rough estimate for the cost of this {@link Node}. This estimate can be used by | |
86 * runtime systems or guest languages to implement heuristics based on Truffle ASTs. This method | |
87 * is intended to be overridden by subclasses. The default implementation returns the value of | |
88 * {@link NodeInfo#cost()} of the {@link NodeInfo} annotation declared at the subclass. If no | |
89 * {@link NodeInfo} annotation is declared the method returns {@link NodeCost#MONOMORPHIC} as a | |
90 * default value. | |
91 */ | |
84 public NodeCost getCost() { | 92 public NodeCost getCost() { |
85 NodeInfo info = getClass().getAnnotation(NodeInfo.class); | 93 NodeInfo info = getClass().getAnnotation(NodeInfo.class); |
86 if (info != null) { | 94 if (info != null) { |
87 return info.cost(); | 95 return info.cost(); |
88 } | 96 } |