Class InlinedByteValueProfile

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

public final class InlinedByteValueProfile 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 ByteProfileNode extends Node {

     abstract byte execute(byte input);

     @Specialization
     byte doDefault(byte input, @Cached InlinedByteValueProfile profile) {
         byte 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 byte profile(Node node, byte 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

      public static InlinedByteValueProfile inline(InlineSupport.InlineTarget target)
      Returns an inlined version of the profile. This version is automatically used by Truffle DSL node inlining.
      Since:
      23.0
    • getUncached

      public static InlinedByteValueProfile 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