Package com.oracle.truffle.api.utilities
Class CountingConditionProfile
- java.lang.Object
-
- com.oracle.truffle.api.nodes.NodeCloneable
-
- com.oracle.truffle.api.utilities.ConditionProfile
-
- com.oracle.truffle.api.utilities.CountingConditionProfile
-
- All Implemented Interfaces:
java.lang.Cloneable
public final class CountingConditionProfile extends ConditionProfile
Utility class to speculate on conditions to be never true or to be never false. Additionally toBinaryConditionProfile
this implementation ofConditionProfile
also counts the number of times the condition was true and false. This information is reported to the underlying optimization system usingCompilerDirectives.injectBranchProbability(double, boolean)
. Condition profiles are intended to be used as part of if conditions.- See Also:
ConditionProfile.createCountingProfile()
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getFalseCount()
int
getTrueCount()
boolean
profile(boolean value)
java.lang.String
toString()
-
Methods inherited from class com.oracle.truffle.api.utilities.ConditionProfile
createBinaryProfile, createCountingProfile
-
Methods inherited from class com.oracle.truffle.api.nodes.NodeCloneable
clone
-
-
-
-
Method Detail
-
profile
public boolean profile(boolean value)
- Specified by:
profile
in classConditionProfile
-
getTrueCount
public int getTrueCount()
-
getFalseCount
public int getFalseCount()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-