Class OptimizedAssumption

java.lang.Object
com.oracle.truffle.api.impl.AbstractAssumption
com.oracle.truffle.runtime.OptimizedAssumption
All Implemented Interfaces:
com.oracle.truffle.api.Assumption

public final class OptimizedAssumption extends com.oracle.truffle.api.impl.AbstractAssumption
An assumption that when invalidated will cause all registered dependencies to be invalidated.
  • Field Summary

    Fields inherited from class com.oracle.truffle.api.impl.AbstractAssumption

    isValid, name

    Fields inherited from interface com.oracle.truffle.api.Assumption

    ALWAYS_VALID, NEVER_VALID
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    int
    Gets the number of dependencies registered with this assumption.
    void
     
    void
    invalidate(String message)
     
    boolean
     
    Consumer<com.oracle.truffle.compiler.OptimizedAssumptionDependency>
    Registers some dependent code with this assumption.
    void
    Removes all invalid dependencies.

    Methods inherited from class com.oracle.truffle.api.impl.AbstractAssumption

    getName, toString

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • OptimizedAssumption

      public OptimizedAssumption(String name)
  • Method Details

    • check

      public void check() throws com.oracle.truffle.api.nodes.InvalidAssumptionException
      Specified by:
      check in interface com.oracle.truffle.api.Assumption
      Throws:
      com.oracle.truffle.api.nodes.InvalidAssumptionException
    • invalidate

      public void invalidate()
      Specified by:
      invalidate in interface com.oracle.truffle.api.Assumption
    • invalidate

      public void invalidate(String message)
      Specified by:
      invalidate in interface com.oracle.truffle.api.Assumption
    • removeDeadDependencies

      public void removeDeadDependencies()
      Removes all invalid dependencies.
    • countDependencies

      public int countDependencies()
      Gets the number of dependencies registered with this assumption.
    • registerDependency

      public Consumer<com.oracle.truffle.compiler.OptimizedAssumptionDependency> registerDependency()
      Registers some dependent code with this assumption. As the dependent code may not yet be available, a Consumer is returned that must be notified when the code becomes available. If there is an error while compiling or installing the code, the returned consumer must be called with a null argument. If this assumption is already invalid, then null is returned in which case the caller (e.g., the compiler) must ensure the dependent code is never executed.
    • isValid

      public boolean isValid()
      Specified by:
      isValid in interface com.oracle.truffle.api.Assumption