Elide GraalVM25.6.0-elide.4
All types
Versions and modules

ValueProfile

Javaabstract classin com.oracle.truffle.api.profilessince 0.10

public abstract class ValueProfile extends Profile
Inheritance
  1. Object
  2. NodeCloneable
  3. Profile
  4. ValueProfile
Known subtypes

Specialized value profile to capture certain properties of Object runtime values. Value profiles require a runtime check in their initialized state to verify their profiled assumption. Value profiles are limited to capture monomorphic profiles only. This means that if two or more identities or classes are profiles within a single profile then the profile has no effect and no overhead after compilation. There are specialized versions of this profile with less interpreter footprint for boolean, byte, int, long, float and double values.

Usage example:

class SampleNode extends Node {

final ValueProfile profile = ValueProfile.create{Identity,Class}Profile();

    Object execute(Object input) {
        Object profiledValue = profile.profile(input);
        // compiler may know now more about profiledValue
        return profieldValue;
    }
}
Members shown

Methods6 + 3 inherited

T profile(T)No description.

profile

abstractsince 0.10
public abstract <T> T profile(T value)

No description.

Parameters

valueT
No description.

Returns

T
No description.
static ValueProfile createClassProfile()

createClassProfile

staticsince 0.10
public static ValueProfile createClassProfile()

Returns a value profile that profiles the exact class of a value. It will check the class of the profiled value and provide additional information to the compiler if only non-null values of exactly one concrete Java class are passed as a parameter to the ValueProfile.profile method. This can be beneficial if subsequent code can take advantage of knowing the concrete class of the value. The profile will degrade to the generic case if a null value or if at least two instances of two different Java classes are registered.

Compilation notes: Value profiles require a runtime check in their initialized state to verify their profiled class. If two classes have been seen on a single profile instance then this profile will transition to a generic state with no overhead.

Returns

ValueProfile
No description.
static ValueProfile create()

create

staticsince 23.0
public static ValueProfile create()

Returns a value profile that profiles the exact class of a value. It will check the class of the profiled value and provide additional information to the compiler if only non-null values of exactly one concrete Java class are passed as a parameter to the ValueProfile.profile method. This can be beneficial if subsequent code can take advantage of knowing the concrete class of the value. The profile will degrade to the generic case if a null value or if at least two instances of two different Java classes are registered.

Compilation notes: Value profiles require a runtime check in their initialized state to verify their profiled class. If two classes have been seen on a single profile instance then this profile will transition to a generic state with no overhead.

Returns

ValueProfile
No description.
static ValueProfile createIdentityProfile()

createIdentityProfile

staticsince 0.10
public static ValueProfile createIdentityProfile()

Returns a value profile that profiles the object identity of a value. A single instance can only profile one particular instance.

Compilation notes: Identity profiles require a runtime check to verify their profiled object identity. If two identities have been seen on a single profile instance then this profile will transition to a generic state with no overhead.

Returns

ValueProfile
No description.
static ValueProfile getUncached()

getUncached

staticsince 19.0
public static ValueProfile getUncached()

Returns the uncached version of the profile. The uncached version of a profile does nothing.

Returns

ValueProfile
No description.
static InlinedExactClassProfile inline(InlineSupport.InlineTarget)

inline

staticsince 23.0
public static InlinedExactClassProfile inline(InlineSupport.InlineTarget target)

Returns an inlined version of the profile. This version is automatically used by Truffle DSL node inlining.

Parameters

targetInlineSupport.InlineTarget
No description.

Returns

Inherited members