@Override public String toString() { int t = trueCount; int f = falseCount; int sum = t + f; String details = String.format("trueProbability=%s (trueCount=%s, falseCount=%s)", (double) t / (double) sum, t, f); return toString(ConditionProfile.class, sum == 0, false, details); }
/** * Returns a {@link ConditionProfile} that speculates on conditions to be never * <code>true</code> or to be never <code>false</code>. Additionally to a binary profile this * method returns a condition profile that also counts the number of times the condition was * true and false. This information is reported to the underlying optimization system using * {@link CompilerDirectives#injectBranchProbability(double, boolean)}. Condition profiles are * intended to be used as part of if conditions. * * @see ConditionProfile * @see #createBinaryProfile() * @since 0.10 */ public static ConditionProfile createCountingProfile() { if (Profile.isProfilingEnabled()) { return Counting.create(); } else { return Disabled.INSTANCE; } }
/** * Returns a {@link ConditionProfile} that speculates on conditions to be never * <code>true</code> or to be never <code>false</code>. Additionally to a binary profile this * method returns a condition profile that also counts the number of times the condition was * true and false. This information is reported to the underlying optimization system using * {@link CompilerDirectives#injectBranchProbability(double, boolean)}. Condition profiles are * intended to be used as part of if conditions. * * @see ConditionProfile * @see #createBinaryProfile() * @since 0.10 */ public static ConditionProfile createCountingProfile() { if (Profile.isProfilingEnabled()) { return Counting.create(); } else { return Disabled.INSTANCE; } }
@Override public String toString() { int t = trueCount; int f = falseCount; int sum = t + f; String details = String.format("trueProbability=%s (trueCount=%s, falseCount=%s)", (double) t / (double) sum, t, f); return toString(ConditionProfile.class, sum == 0, false, details); }
static ConditionProfile create() { return new Counting(); } }
static ConditionProfile create() { return new Counting(); } }