ValueProfile
public abstract class ValueProfile extends Profile- Inheritance
ObjectNodeCloneableProfileValueProfile
- 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;
}
}Methods6 + 3 inherited
T profile(T)No description.
profile
abstractsince 0.10public abstract < T> T profile(T value)No description.
Parameters
valueT- No description.
Returns
T- No description.
static ValueProfile createClassProfile()
createClassProfile
staticsince 0.10public 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.
See also
static ValueProfile create()
create
staticsince 23.0public 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.
See also
static ValueProfile createIdentityProfile()
createIdentityProfile
staticsince 0.10public 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.0public 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.0public 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
InlinedExactClassProfile- No description.