Class PrimitiveValueProfile
java.lang.Object
com.oracle.truffle.api.nodes.NodeCloneable
com.oracle.truffle.api.profiles.Profile
com.oracle.truffle.api.profiles.ValueProfile
com.oracle.truffle.api.profiles.PrimitiveValueProfile
- All Implemented Interfaces:
Cloneable
Represents a ValueProfile that speculates on the primitive equality or object identity of
values. Note that for float and double values we compare primitive equality via
Float.floatToRawIntBits(float) and Double.doubleToRawLongBits(double), so that for example
-0.0 is not considered the same as 0.0, even though primitive equality would
normally say that it was.
- Since:
- 0.10
-
Method Summary
Modifier and TypeMethodDescriptionstatic PrimitiveValueProfilecreate()Returns aPrimitiveValueProfilethat speculates on the primitive equality or object identity of a value.static PrimitiveValueProfileReturns aPrimitiveValueProfilethat speculates on the primitive equality or object identity of a value.voiddisable()Disables this profile by setting it to its generic state.static PrimitiveValueProfileReturns the uncached version of the profile.booleanprofile(boolean value) byteprofile(byte value) charprofile(char value) doubleprofile(double value) floatprofile(float value) intprofile(int value) longprofile(long value) shortprofile(short value) <T> Tprofile(T v) voidreset()Resets this profile to its uninitialized state.toString()Methods inherited from class com.oracle.truffle.api.profiles.ValueProfile
createClassProfile, createIdentityProfile, inlineMethods inherited from class com.oracle.truffle.api.nodes.NodeCloneable
clone
-
Method Details
-
profile
public <T> T profile(T v) - Specified by:
profilein classValueProfile- Since:
- 0.8 or earlier
-
profile
public byte profile(byte value) - Since:
- 0.8 or earlier
-
profile
public short profile(short value) - Since:
- 0.8 or earlier
-
profile
public int profile(int value) - Since:
- 0.8 or earlier
-
profile
public long profile(long value) - Since:
- 0.8 or earlier
-
profile
public float profile(float value) - Since:
- 0.8 or earlier
-
profile
public double profile(double value) - Since:
- 0.8 or earlier
-
profile
public boolean profile(boolean value) - Since:
- 0.8 or earlier
-
profile
public char profile(char value) - Since:
- 0.8 or earlier
-
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
-
createEqualityProfile
Returns aPrimitiveValueProfilethat speculates on the primitive equality or object identity of a value.- Since:
- 0.10
-
create
Returns aPrimitiveValueProfilethat speculates on the primitive equality or object identity of a value.- Since:
- 22.1
-
getUncached
Returns the uncached version of the profile. The uncached version of a profile does nothing.- Since:
- 19.0
-