Package com.oracle.truffle.api
Class CompilerAsserts
java.lang.Object
com.oracle.truffle.api.CompilerAsserts
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancompilationConstant(boolean value) Assertion that the corresponding value is reduced to a constant during compilation.static bytecompilationConstant(byte value) Assertion that the corresponding value is reduced to a constant during compilation.static charcompilationConstant(char value) Assertion that the corresponding value is reduced to a constant during compilation.static doublecompilationConstant(double value) Assertion that the corresponding value is reduced to a constant during compilation.static floatcompilationConstant(float value) Assertion that the corresponding value is reduced to a constant during compilation.static intcompilationConstant(int value) Assertion that the corresponding value is reduced to a constant during compilation.static longcompilationConstant(long value) Assertion that the corresponding value is reduced to a constant during compilation.static shortcompilationConstant(short value) Assertion that the corresponding value is reduced to a constant during compilation.static ObjectcompilationConstant(Object value) Assertion that the corresponding value is reduced to a constant during compilation.static voidAssertion that this code position should never be reached during compilation.static voidneverPartOfCompilation(String message)
-
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. SeeCompilerDirectives.transferToInterpreter()for the corresponding compiler directive. -
neverPartOfCompilation
-
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
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
-