comparison graal/com.oracle.truffle.api.dsl/src/com/oracle/truffle/api/dsl/Cached.java @ 19771:b249bdba508b

Truffle-DSL: @Cached javadoc fixes.
author Christian Humer <christian.humer@gmail.com>
date Wed, 11 Mar 2015 15:44:32 +0100
parents 67ab244ab689
children
comparison
equal deleted inserted replaced
19770:7108d2319169 19771:b249bdba508b
84 * the dynamic value of the operand while the cachedOperand is initialized once at first execution 84 * the dynamic value of the operand while the cachedOperand is initialized once at first execution
85 * of the specialization (specialization instantiation time). 85 * of the specialization (specialization instantiation time).
86 * 86 *
87 * <pre> 87 * <pre>
88 * &#064;Specialization 88 * &#064;Specialization
89 * void doCached(int operand, @Local(&quot;operand&quot;) int cachedOperand) { 89 * void doCached(int operand, @Cached(&quot;operand&quot;) int cachedOperand) {
90 * CompilerAsserts.compilationConstant(cachedOperand); 90 * CompilerAsserts.compilationConstant(cachedOperand);
91 * ... 91 * ...
92 * } 92 * }
93 * 93 *
94 * Example executions: 94 * Example executions:
109 * specializations are instantiated. Like for other specializations if there are no more 109 * specializations are instantiated. Like for other specializations if there are no more
110 * specializations defined an {@link UnsupportedSpecializationException} is thrown. The default 110 * specializations defined an {@link UnsupportedSpecializationException} is thrown. The default
111 * specialization instantiation limit is <code>3</code>. 111 * specialization instantiation limit is <code>3</code>.
112 * 112 *
113 * <pre> 113 * <pre>
114 * &#064;Specialization(guards = &quot;==(operand, cachedOperand)&quot;) 114 * &#064;Specialization(guards = &quot;operand == cachedOperand&quot;)
115 * void doCached(int operand, @Cached(&quot;operand&quot;) int cachedOperand) { 115 * void doCached(int operand, @Cached(&quot;operand&quot;) int cachedOperand) {
116 * CompilerAsserts.compilationConstant(cachedOperand); 116 * CompilerAsserts.compilationConstant(cachedOperand);
117 * ... 117 * ...
118 * } 118 * }
119 * 119 *
137 * that all instantiations of <code>doCached</code> get removed if <code>doNormal</code> is 137 * that all instantiations of <code>doCached</code> get removed if <code>doNormal</code> is
138 * instantiated. Alternatively if the <code>contains</code> relation is omitted then all 138 * instantiated. Alternatively if the <code>contains</code> relation is omitted then all
139 * <code>doCached</code> instances remain but no new instances are created. 139 * <code>doCached</code> instances remain but no new instances are created.
140 * 140 *
141 * <code> 141 * <code>
142 * &#064;Specialization(guards = &quot;==(operand, cachedOperand)&quot;) 142 * &#064;Specialization(guards = &quot;operand == cachedOperand&quot;)
143 * void doCached(int operand, @Cached(&quot;operand&quot;) int cachedOperand) { 143 * void doCached(int operand, @Cached(&quot;operand&quot;) int cachedOperand) {
144 * CompilerAsserts.compilationConstant(cachedOperand); 144 * CompilerAsserts.compilationConstant(cachedOperand);
145 * ... 145 * ...
146 * } 146 * }
147 * 147 *
207 * just referencing its static factory method and its parameters. In this case 207 * just referencing its static factory method and its parameters. In this case
208 * {@link BranchProfile#create()} is used to instantiate the {@link BranchProfile} instance. 208 * {@link BranchProfile#create()} is used to instantiate the {@link BranchProfile} instance.
209 * 209 *
210 * <pre> 210 * <pre>
211 * &#064;Specialization 211 * &#064;Specialization
212 * void s(int operand, @Local(&quot;create()&quot;) BranchProfile profile) { 212 * void s(int operand, @Cached(&quot;create()&quot;) BranchProfile profile) {
213 * } 213 * }
214 * </pre> 214 * </pre>
215 * 215 *
216 * </li> 216 * </li>
217 * </ol> 217 * </ol>