Package com.oracle.truffle.api.profiles
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 PrimitiveValueProfile
create()
Returns aPrimitiveValueProfile
that speculates on the primitive equality or object identity of a value.static PrimitiveValueProfile
Returns aPrimitiveValueProfile
that speculates on the primitive equality or object identity of a value.void
disable()
Disables this profile by setting it to its generic state.static PrimitiveValueProfile
Returns the uncached version of the profile.boolean
profile
(boolean value) byte
profile
(byte value) char
profile
(char value) double
profile
(double value) float
profile
(float value) int
profile
(int value) long
profile
(long value) short
profile
(short value) <T> T
profile
(T v) void
reset()
Resets this profile to its uninitialized state.toString()
Methods inherited from class com.oracle.truffle.api.profiles.ValueProfile
createClassProfile, createIdentityProfile, inline
Methods inherited from class com.oracle.truffle.api.nodes.NodeCloneable
clone
-
Method Details
-
profile
public <T> T profile(T v) - Specified by:
profile
in 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 neverdeoptimize
on 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 aPrimitiveValueProfile
that speculates on the primitive equality or object identity of a value.- Since:
- 0.10
-
create
Returns aPrimitiveValueProfile
that 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
-