Class InlinedExactClassProfile

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

public final class InlinedExactClassProfile extends InlinedProfile
Specialized value profile to capture the exact class of reference 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 ReferenceProfileNode extends Node {

     abstract Object execute(Object input);

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

  • Method Details

    • profile

      public <T> T profile(Node node, T 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 InlinedExactClassProfile 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