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.ObjectUtility 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 infinalfields 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 ValueProfilecreateClassProfile()Returns aValueProfilethat speculates on the exact class of a value.static ValueProfilecreateIdentityProfile()Returns aValueProfilethat speculates on the object identity of a value.static PrimitiveValueProfilecreatePrimitiveProfile()Returns aPrimitiveValueProfilethat speculates on the primitive equality or object identity of a value.abstract <T> Tprofile(T value)
-
-
-
Method Detail
-
profile
public abstract <T> T profile(T value)
-
createPrimitiveProfile
public static PrimitiveValueProfile createPrimitiveProfile()
Returns aPrimitiveValueProfilethat speculates on the primitive equality or object identity of a value.
-
createClassProfile
public static ValueProfile createClassProfile()
Returns aValueProfilethat speculates on the exact class of a value.
-
createIdentityProfile
public static ValueProfile createIdentityProfile()
Returns aValueProfilethat speculates on the object identity of a value.
-
-