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 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 Object
compilationConstant
(Object value) 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
neverPartOfCompilation
(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
-