diff graal/com.oracle.truffle.api/src/com/oracle/truffle/api/utilities/CountingConditionProfile.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 3c114b3e08c3
children b1530a6cce8c
line wrap: on
line diff
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/utilities/CountingConditionProfile.java	Mon Aug 18 21:02:51 2014 +0200
+++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/utilities/CountingConditionProfile.java	Tue Aug 19 14:56:19 2014 +0200
@@ -34,28 +34,17 @@
  * optimization system using {@link CompilerDirectives#injectBranchProbability(double, boolean)}.
  * Condition profiles are intended to be used as part of if conditions.
  *
- * Example usage:
- *
- * <pre>
- * private final ConditionProfile zero = new IntegerConditionProfile();
- * 
- * int value = ...;
- * if (zero.profile(value == 0)) {
- *   return 0;
- * } else {
- *   return value;
- * }
- *
- * </pre>
- *
- * @see ConditionProfile
- * @see CountingConditionProfile
+ * @see ConditionProfile#createCountingProfile()
  */
-public class CountingConditionProfile extends ConditionProfile {
+public final class CountingConditionProfile extends ConditionProfile {
 
     @CompilationFinal private int trueCount;
     @CompilationFinal private int falseCount;
 
+    CountingConditionProfile() {
+        /* package protected constructor */
+    }
+
     @Override
     public boolean profile(boolean value) {
         if (value) {