public final class CompilerAsserts extends Object
Modifier and Type | Method and Description |
---|---|
static <T> void |
compilationConstant(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(String message)
Assertion that this code position should never be reached during compilation.
|
static <T> void |
partialEvaluationConstant(boolean value)
Specialized version of
CompilerAsserts.compilationConstant(Object) for
boolean values. |
static <T> void |
partialEvaluationConstant(double value)
Specialized version of
CompilerAsserts.compilationConstant(Object) for
double values. |
static <T> void |
partialEvaluationConstant(float value)
Specialized version of
CompilerAsserts.compilationConstant(Object) for
float values. |
static <T> void |
partialEvaluationConstant(int value)
Specialized version of
CompilerAsserts.compilationConstant(Object) for
int values. |
static <T> void |
partialEvaluationConstant(long value)
Specialized version of
CompilerAsserts.compilationConstant(Object) for
long values. |
static <T> void |
partialEvaluationConstant(Object value)
Assertion that the corresponding value is reduced to a constant during the initial partial
evaluation phase.
|
public static void neverPartOfCompilation()
CompilerDirectives.transferToInterpreter()
for the corresponding compiler
directive.
CompilerDirectives.bailout(String)
should be used if failing compilation is desired,
e.g., for testing. neverPartOfCompilation()
must not be reachable for runtime
compilation, see the TruffleCheckNeverPartOfCompilation option.
public static void neverPartOfCompilation(String message)
CompilerDirectives.transferToInterpreter()
for the corresponding compiler
directive.
CompilerDirectives.bailout(String)
should be used if failing compilation is desired,
e.g., for testing. neverPartOfCompilation()
must not be reachable for runtime
compilation, see the TruffleCheckNeverPartOfCompilation option.
message
- text associated with the bailout exceptionpublic static <T> void compilationConstant(Object value)
CompilerAsserts.partialEvaluationConstant(Object)
and its specialized variants.value
- the value that must be constant during compilationCompilerAsserts.partialEvaluationConstant(Object)
public static <T> void partialEvaluationConstant(Object value)
CompilerAsserts.compilationConstant(Object)
, the
constantness of the value is checked much earlier in the compilation pipeline. It should
therefore be preferred, also because its specialized variants avoid boxing.value
- the value that must be constant during compilationCompilerAsserts.compilationConstant(Object)
public static <T> void partialEvaluationConstant(boolean value)
CompilerAsserts.compilationConstant(Object)
for
boolean
values.value
- the value that must be constant during partial evaluation.CompilerAsserts.partialEvaluationConstant(Object)
public static <T> void partialEvaluationConstant(int value)
CompilerAsserts.compilationConstant(Object)
for
int
values.value
- the value that must be constant during partial evaluation.CompilerAsserts.partialEvaluationConstant(Object)
public static <T> void partialEvaluationConstant(float value)
CompilerAsserts.compilationConstant(Object)
for
float
values.value
- the value that must be constant during partial evaluation.CompilerAsserts.partialEvaluationConstant(Object)
public static <T> void partialEvaluationConstant(long value)
CompilerAsserts.compilationConstant(Object)
for
long
values.value
- the value that must be constant during partial evaluation.CompilerAsserts.partialEvaluationConstant(Object)
public static <T> void partialEvaluationConstant(double value)
CompilerAsserts.compilationConstant(Object)
for
double
values.value
- the value that must be constant during partial evaluation.CompilerAsserts.partialEvaluationConstant(Object)