Class PrimitiveValueProfile

All Implemented Interfaces:
Cloneable

public final class PrimitiveValueProfile extends ValueProfile

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 Details

    • profile

      public <T> T profile(T v)
      Specified by:
      profile in class ValueProfile
      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 never deoptimize 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.

      Overrides:
      disable in class Profile
      Since:
      22.1
    • 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.

      Overrides:
      reset in class Profile
      Since:
      22.1
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Since:
      22.1
    • createEqualityProfile

      public static PrimitiveValueProfile createEqualityProfile()
      Returns a PrimitiveValueProfile that speculates on the primitive equality or object identity of a value.
      Since:
      0.10
    • create

      public static PrimitiveValueProfile create()
      Returns a PrimitiveValueProfile that speculates on the primitive equality or object identity of a value.
      Since:
      22.1
    • getUncached

      public static PrimitiveValueProfile getUncached()
      Returns the uncached version of the profile. The uncached version of a profile does nothing.
      Since:
      19.0