public abstract class SLTypes extends Object
SLLanguage. Based on the TypeSystem
annotation, the Truffle DSL generates the subclass SLTypesGen with type test and type
conversion methods for some types. In this class, we only cover types where the automatically
generated ones would not be sufficient.| Constructor and Description |
|---|
SLTypes() |
| Modifier and Type | Method and Description |
|---|---|
static SLNull |
asSLNull(Object value)
Example of a manually specified type cast that replaces the automatically generated type cast
that the Truffle DSL would generate.
|
static SLBigNumber |
castBigNumber(long value)
Informs the Truffle DSL that a primitive
long value can be used in all
specializations where a SLBigNumber is expected. |
static boolean |
isSLNull(Object value)
Example of a manually specified type check that replaces the automatically generated type
check that the Truffle DSL would generate.
|
public static boolean isSLNull(Object value)
public static SLBigNumber castBigNumber(long value)
long value can be used in all
specializations where a SLBigNumber is expected. This models the semantic of SL: It
only has an arbitrary precision Number type (implemented as SLBigNumber, and
long is only used as a performance optimization to avoid the costly
SLBigNumber arithmetic for values that fit into a 64-bit primitive value.