comparison truffle/com.oracle.truffle.api.profiles/src/com/oracle/truffle/api/profiles/BranchProfile.java @ 22526:a5e58793bbca

BranchProfile Javadoc sample was uncompilable. Fixed with the help of codesnippet tag.
author Jaroslav Tulach <jaroslav.tulach@oracle.com>
date Wed, 30 Dec 2015 11:06:33 +0100
parents d80a5ff56f51
children
comparison
equal deleted inserted replaced
22525:89db2519ef18 22526:a5e58793bbca
34 * {@link #enter()} is invoked is enabled for compilation. Otherwise if the {@link #enter()} method 34 * {@link #enter()} is invoked is enabled for compilation. Otherwise if the {@link #enter()} method
35 * was never invoked the branch will not get compiled. 35 * was never invoked the branch will not get compiled.
36 * </p> 36 * </p>
37 * 37 *
38 * <p> 38 * <p>
39 * <b> Usage example: </b> 39 * <b> Usage example: </b> {@codesnippet BranchProfileSample}
40 *
41 * <pre>
42 * class SampleNode extends Node {
43 *
44 * final BranchProfile errorProfile = BranchProfile.create();
45 *
46 * void execute(int value) {
47 * if (value == Integer.MAX_VALUE) {
48 * errorProfile.enter();
49 * throw new Error(&quot;Invalid input value&quot;)
50 * }
51 * return value;
52 * }
53 * }
54 * </pre>
55 * 40 *
56 * {@inheritDoc} 41 * {@inheritDoc}
57 * 42 *
58 * @see BranchProfile#enter() 43 * @see BranchProfile#enter()
59 */ 44 */