Package com.oracle.truffle.api.utilities
Class ValueProfile
java.lang.Object
com.oracle.truffle.api.utilities.ValueProfile
- Direct Known Subclasses:
ExactClassValueProfile,IdentityValueProfile,PrimitiveValueProfile
Utility class to speculate on certain properties of values.
Example usage:
private final ValueProfile classProfile = ValueProfile.createClassProfile(); return classProfile.profile(value);All instances of
ValueProfile (and subclasses) must be held in final fields for
compiler optimizations to take effect.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ValueProfileReturns aValueProfilethat speculates on the exact class of a value.static ValueProfileReturns aValueProfilethat speculates on the object identity of a value.static PrimitiveValueProfileReturns aPrimitiveValueProfilethat speculates on the primitive equality or object identity of a value.abstract <T> Tprofile(T value)
-
Constructor Details
-
ValueProfile
public ValueProfile()
-
-
Method Details
-
profile
public abstract <T> T profile(T value) -
createPrimitiveProfile
Returns aPrimitiveValueProfilethat speculates on the primitive equality or object identity of a value. -
createClassProfile
Returns aValueProfilethat speculates on the exact class of a value. -
createIdentityProfile
Returns aValueProfilethat speculates on the object identity of a value.
-