Class InlinedDoubleValueProfile

java.lang.Object
com.oracle.truffle.api.profiles.InlinedProfile
com.oracle.truffle.api.profiles.InlinedDoubleValueProfile

public final class InlinedDoubleValueProfile extends InlinedProfile
Specialized value profile to capture certain properties of byte 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:

 abstract class DoubleProfileNode extends Node {

     abstract double execute(double input);

     @Specialization
     double doDefault(double input, @Cached InlinedDoubleValueProfile profile) {
         double profiledValue = profile.profile(this, input);
         // compiler may now see profiledValue as a partial evaluation constant
         return profiledValue;
     }
 }
 
Since:
23.0
  • Field Details

  • Method Details

    • profile

      public double profile(Node node, double value)
      Since:
      23.0
    • toString

      public String toString(Node node)
      Prints a string representation of this inlined profile given a target node.
      Specified by:
      toString in class InlinedProfile
      Since:
      23.0
    • inline

      Returns an inlined version of the profile. This version is automatically used by Truffle DSL node inlining.
      Since:
      23.0
    • getUncached

      public static InlinedDoubleValueProfile getUncached()
      Returns the uncached version of the profile. The uncached version of a profile does not perform any profiling.
      Since:
      23.0
    • disable

      public final void disable(Node node)
      Description copied from class: InlinedProfile
      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.

      Specified by:
      disable in class InlinedProfile
    • reset

      public final void reset(Node node)
      Description copied from class: InlinedProfile
      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.

      Specified by:
      reset in class InlinedProfile