Mercurial > hg > truffle
comparison truffle/com.oracle.truffle.api.profiles/src/com/oracle/truffle/api/profiles/ByteValueProfile.java @ 22527:114a6a77b440
Colorifying ByteValueProfile sample code
author | Jaroslav Tulach <jaroslav.tulach@oracle.com> |
---|---|
date | Wed, 30 Dec 2015 15:33:13 +0100 |
parents | d80a5ff56f51 |
children |
comparison
equal
deleted
inserted
replaced
22526:a5e58793bbca | 22527:114a6a77b440 |
---|---|
35 * two or more values are profiled within a single profile then the profile has no effect. If the | 35 * two or more values are profiled within a single profile then the profile has no effect. If the |
36 * value assumption is invalidated in compiled code then it is invalidated. | 36 * value assumption is invalidated in compiled code then it is invalidated. |
37 * </p> | 37 * </p> |
38 * | 38 * |
39 * <p> | 39 * <p> |
40 * <b> Usage example: </b> | 40 * <b> Usage example: </b> {@codesnippet ByteValueProfileSample} |
41 * | |
42 * <pre> | |
43 * class SampleNode extends Node { | |
44 * | |
45 * final ByteValueProfile profile = ByteValueProfile.createIdentityProfile(); | |
46 * | |
47 * byte execute(byte input) { | |
48 * byte profiledValue = profile.profile(input); | |
49 * // compiler may know now more about profiledValue | |
50 * return profiledValue; | |
51 * } | |
52 * } | |
53 * </pre> | |
54 * <p> | |
55 * | |
56 * | 41 * |
57 * {@inheritDoc} | 42 * {@inheritDoc} |
58 * | 43 * |
59 * @see #createIdentityProfile() | 44 * @see #createIdentityProfile() |
60 * @see ValueProfile | 45 * @see ValueProfile |