Package com.oracle.truffle.api.utilities
Class ValueProfile
- java.lang.Object
-
- com.oracle.truffle.api.utilities.ValueProfile
-
- Direct Known Subclasses:
ExactClassValueProfile
,IdentityValueProfile
,PrimitiveValueProfile
public abstract class ValueProfile extends java.lang.Object
Utility class to speculate on certain properties of values. Example usage:private final ValueProfile classProfile = ValueProfile.createClassProfile(); return classProfile.profile(value);
All instances ofValueProfile
(and subclasses) must be held infinal
fields for compiler optimizations to take effect.
-
-
Constructor Summary
Constructors Constructor Description ValueProfile()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static ValueProfile
createClassProfile()
Returns aValueProfile
that speculates on the exact class of a value.static ValueProfile
createIdentityProfile()
Returns aValueProfile
that speculates on the object identity of a value.static PrimitiveValueProfile
createPrimitiveProfile()
Returns aPrimitiveValueProfile
that speculates on the primitive equality or object identity of a value.abstract <T> T
profile(T value)
-
-
-
Method Detail
-
profile
public abstract <T> T profile(T value)
-
createPrimitiveProfile
public static PrimitiveValueProfile createPrimitiveProfile()
Returns aPrimitiveValueProfile
that speculates on the primitive equality or object identity of a value.
-
createClassProfile
public static ValueProfile createClassProfile()
Returns aValueProfile
that speculates on the exact class of a value.
-
createIdentityProfile
public static ValueProfile createIdentityProfile()
Returns aValueProfile
that speculates on the object identity of a value.
-
-