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 of `ValueProfile` (and subclasses) must be held in `final` fields for compiler optimizations to take effect.

See Also:
  `createPrimitiveProfile()`, `createIdentityProfile()`, `createClassProfile()`

### Constructor Summary

Constructors
`ValueProfile()`

### Method Summary

All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
`static ValueProfile` `createClassProfile()` Returns a `ValueProfile` that speculates on the exact class of a value.
`static ValueProfile` `createIdentityProfile()` Returns a `ValueProfile` that speculates on the object identity of a value.
`static PrimitiveValueProfile` `createPrimitiveProfile()` Returns a `PrimitiveValueProfile` that speculates on the primitive equality or object identity of a value.
`abstract <T> T` `profile​(T value)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ValueProfile

    public ValueProfile()

### Method Detail

#### profile

    public abstract <T> T profile​(T value)

#### createPrimitiveProfile

    public static PrimitiveValueProfile createPrimitiveProfile()

Returns a `PrimitiveValueProfile` that speculates on the primitive equality or object identity of a value.

#### createClassProfile

    public static ValueProfile createClassProfile()

Returns a `ValueProfile` that speculates on the exact class of a value.

#### createIdentityProfile

    public static ValueProfile createIdentityProfile()

Returns a `ValueProfile` that speculates on the object identity of a value.