Class DoubleValueProfile
- All Implemented Interfaces:
Cloneable
Specialized value profile to capture certain properties of double 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 values are profiled within a single profile then the profile has no effect. If the
value assumption is invalidated in compiled code then it is invalidated.
Usage example:
class SampleNode extends Node {
final DoubleValueProfile profile = DoubleValueProfile.createRawIdentityProfile();
double execute(double input) {
double profiledValue = profile.profile(input);
// compiler may know now more about profiledValue
return profiledValue;
}
}
- Since:
- 0.10
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic DoubleValueProfilecreate()Returns a value profile that profiles the exact value of adoubleusingDouble.doubleToRawLongBits(double).static DoubleValueProfileReturns a value profile that profiles the exact value of adoubleusingDouble.doubleToRawLongBits(double).voiddisable()Disables this profile by setting it to its generic state.static DoubleValueProfileReturns the uncached version of the profile.static InlinedDoubleValueProfileinline(InlineSupport.InlineTarget target) Returns an inlined version of the profile.doubleprofile(double value) voidreset()Resets this profile to its uninitialized state.toString()Methods inherited from class com.oracle.truffle.api.nodes.NodeCloneable
clone
-
Method Details
-
profile
public double profile(double value) - Since:
- 0.10
-
disable
public void disable()Disables this profile by setting it to its generic state. After disabling it is guaranteed to neverdeoptimizeon any invocation of a profile method.This method must not be called on compiled code paths. Note that disabling the profile will not invalidate existing compiled code that uses this profile.
-
reset
public void reset()Resets this profile to its uninitialized state. Has no effect if this profile is already in its uninitialized state or a disabled version of this profile is used.This method must not be called on compiled code paths. Note that disabling the profile will not invalidate existing compiled code that uses this profile.
-
toString
-
createRawIdentityProfile
Returns a value profile that profiles the exact value of adoubleusingDouble.doubleToRawLongBits(double).- Since:
- 0.10
- See Also:
-
create
Returns a value profile that profiles the exact value of adoubleusingDouble.doubleToRawLongBits(double).- Since:
- 22.1
- See Also:
-
getUncached
Returns the uncached version of the profile. The uncached version of a profile does nothing.- Since:
- 19.0
-
inline
Returns an inlined version of the profile. This version is automatically used by Truffle DSL node inlining.- Since:
- 23.0
-