Mercurial > hg > truffle
diff graal/com.oracle.truffle.api/src/com/oracle/truffle/api/utilities/ValueProfile.java @ 18164:53afdc71b311
Truffle: added PrimitiveValueProfile.
author | Chris Seaton <chris.seaton@oracle.com> |
---|---|
date | Fri, 24 Oct 2014 22:50:04 +0100 |
parents | 1e542561783e |
children | e93507e232c9 |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/utilities/ValueProfile.java Fri Oct 24 16:18:10 2014 +0200 +++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/utilities/ValueProfile.java Fri Oct 24 22:50:04 2014 +0100 @@ -31,13 +31,14 @@ * * <pre> * private final ValueProfile classProfile = ValueProfile.createClassProfile(); - * + * * return classProfile.profile(value); * </pre> * * All instances of {@code ValueProfile} (and subclasses) must be held in {@code final} fields for * compiler optimizations to take effect. * + * @see #createPrimitiveProfile() * @see #createIdentityProfile() * @see #createClassProfile() */ @@ -48,6 +49,13 @@ /** * Returns a {@link ValueProfile} that speculates on the exact class of a value. */ + public static PrimitiveValueProfile createPrimitiveProfile() { + return new PrimitiveValueProfile(); + } + + /** + * Returns a {@link ValueProfile} that speculates on the exact class of a value. + */ public static ValueProfile createClassProfile() { return new ExactClassValueProfile(); }