Class CompilerAsserts

java.lang.Object
com.oracle.truffle.api.CompilerAsserts

public class CompilerAsserts extends Object
Assertions about the code produced by the Truffle compiler. All operations have no effect when either executed in the interpreter or in the compiled code. The assertions are checked during code generation and the Truffle compiler produces for failing assertions a stack trace that identifies the code position of the assertion in the context of the current compilation.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    compilationConstant(boolean value)
    Assertion that the corresponding value is reduced to a constant during compilation.
    static byte
    compilationConstant(byte value)
    Assertion that the corresponding value is reduced to a constant during compilation.
    static char
    compilationConstant(char value)
    Assertion that the corresponding value is reduced to a constant during compilation.
    static double
    compilationConstant(double value)
    Assertion that the corresponding value is reduced to a constant during compilation.
    static float
    compilationConstant(float value)
    Assertion that the corresponding value is reduced to a constant during compilation.
    static int
    Assertion that the corresponding value is reduced to a constant during compilation.
    static long
    compilationConstant(long value)
    Assertion that the corresponding value is reduced to a constant during compilation.
    static short
    compilationConstant(short value)
    Assertion that the corresponding value is reduced to a constant during compilation.
    static Object
    Assertion that the corresponding value is reduced to a constant during compilation.
    static void
    Assertion that this code position should never be reached during compilation.
    static void
     

    Methods inherited from class java.lang.Object

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

    • CompilerAsserts

      public CompilerAsserts()
  • Method Details

    • neverPartOfCompilation

      public static void neverPartOfCompilation()
      Assertion that this code position should never be reached during compilation. It can be used for exceptional code paths or rare code paths that should never be included in a compilation unit. See CompilerDirectives.transferToInterpreter() for the corresponding compiler directive.
    • neverPartOfCompilation

      public static void neverPartOfCompilation(String message)
    • compilationConstant

      public static boolean compilationConstant(boolean value)
      Assertion that the corresponding value is reduced to a constant during compilation.
      Parameters:
      value - the value that must be constant during compilation
      Returns:
      the value given as parameter
    • compilationConstant

      public static byte compilationConstant(byte value)
      Assertion that the corresponding value is reduced to a constant during compilation.
      Parameters:
      value - the value that must be constant during compilation
      Returns:
      the value given as parameter
    • compilationConstant

      public static char compilationConstant(char value)
      Assertion that the corresponding value is reduced to a constant during compilation.
      Parameters:
      value - the value that must be constant during compilation
      Returns:
      the value given as parameter
    • compilationConstant

      public static short compilationConstant(short value)
      Assertion that the corresponding value is reduced to a constant during compilation.
      Parameters:
      value - the value that must be constant during compilation
      Returns:
      the value given as parameter
    • compilationConstant

      public static int compilationConstant(int value)
      Assertion that the corresponding value is reduced to a constant during compilation.
      Parameters:
      value - the value that must be constant during compilation
      Returns:
      the value given as parameter
    • compilationConstant

      public static long compilationConstant(long value)
      Assertion that the corresponding value is reduced to a constant during compilation.
      Parameters:
      value - the value that must be constant during compilation
      Returns:
      the value given as parameter
    • compilationConstant

      public static float compilationConstant(float value)
      Assertion that the corresponding value is reduced to a constant during compilation.
      Parameters:
      value - the value that must be constant during compilation
      Returns:
      the value given as parameter
    • compilationConstant

      public static double compilationConstant(double value)
      Assertion that the corresponding value is reduced to a constant during compilation.
      Parameters:
      value - the value that must be constant during compilation
      Returns:
      the value given as parameter
    • compilationConstant

      public static Object compilationConstant(Object value)
      Assertion that the corresponding value is reduced to a constant during compilation.
      Parameters:
      value - the value that must be constant during compilation
      Returns:
      the value given as parameter