Mercurial > hg > graal-compiler
diff graal/com.oracle.truffle.api/src/com/oracle/truffle/api/utilities/BinaryConditionProfile.java @ 16860:fa5e62620593
Truffle: made constructors of condition profiles package protected to delegate them later to TruffleRuntime.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Tue, 19 Aug 2014 14:56:19 +0200 |
parents | fc6f12ee71e5 |
children | b026b6d86ab6 |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/utilities/BinaryConditionProfile.java Mon Aug 18 21:02:51 2014 +0200 +++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/utilities/BinaryConditionProfile.java Tue Aug 19 14:56:19 2014 +0200 @@ -31,28 +31,17 @@ * Utility class to speculate on conditions to be never true or to be never false. Condition * profiles are intended to be used as part of if conditions. * - * Example usage: - * - * <pre> - * private final ConditionProfile zero = new BooleanConditionProfile(); - * - * int value = ...; - * if (zero.profile(value == 0)) { - * return 0; - * } else { - * return value; - * } - * - * </pre> - * - * @see ConditionProfile - * @see CountingConditionProfile + * @see ConditionProfile#createBinaryProfile() */ -public class BinaryConditionProfile extends ConditionProfile { +public final class BinaryConditionProfile extends ConditionProfile { @CompilationFinal private boolean wasTrue; @CompilationFinal private boolean wasFalse; + BinaryConditionProfile() { + /* package protected constructor */ + } + @Override public boolean profile(boolean value) { if (value) {