Package com.oracle.truffle.api

## Class CompilerAsserts

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

    public class CompilerAsserts
    extends java.lang.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
`CompilerAsserts()`

### Method Summary

All Methods Static Methods Concrete Methods
`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` `compilationConstant​(int value)` 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 java.lang.Object` `compilationConstant​(java.lang.Object value)` Assertion that the corresponding value is reduced to a constant during compilation.
`static void` `neverPartOfCompilation()` Assertion that this code position should never be reached during compilation.
`static void` `neverPartOfCompilation​(java.lang.String message)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### CompilerAsserts

    public CompilerAsserts()

### Method Detail

#### 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​(java.lang.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 java.lang.Object compilationConstant​(java.lang.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