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 ValueProfile
Returns aValueProfile
that speculates on the exact class of a value.static ValueProfile
Returns aValueProfile
that speculates on the object identity of a value.static PrimitiveValueProfile
Returns aPrimitiveValueProfile
that speculates on the primitive equality or object identity of a value.abstract <T> T
profile
(T value)
-
Constructor Details
-
ValueProfile
public ValueProfile()
-
-
Method Details
-
profile
public abstract <T> T profile(T value) -
createPrimitiveProfile
Returns aPrimitiveValueProfile
that speculates on the primitive equality or object identity of a value. -
createClassProfile
Returns aValueProfile
that speculates on the exact class of a value. -
createIdentityProfile
Returns aValueProfile
that speculates on the object identity of a value.
-