Val

object Val
Companion:
class
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Val.type

Type members

Classlikes

final case class ArrayValue(elemty: Type, values: Seq[Val]) extends Val

A homogeneous collection of data members.

A homogeneous collection of data members.

object Bool extends Boolean => Val

A Boolean constant.

A Boolean constant.

final case class Byte(value: Byte) extends Val

A 8-bit signed two’s complement integer.

A 8-bit signed two’s complement integer.

final case class ByteString(bytes: Array[Byte]) extends Val

A collection of bytes.

A collection of bytes.

Unlike arrays, byte strings are implicitly null-terminated. Hence, they correspond to C-string literals. For example, ByteString(Array(97)) will be compiled to c"a\0".

final case class Char(value: Char) extends Val

16-bit unsigned Unicode character

16-bit unsigned Unicode character

final case class ClassOf(name: Top) extends Val

A reference to java.lang.Class[_] of given symbol name.

A reference to java.lang.Class[_] of given symbol name.

Instances are emitted as global variables during code feneration. They are used to deduplicate Class instances. There should be only 1 instance per type.

Note that, althrough they are currently emitted as global variables, instances of this type could be constants. However, when we added multithreading and object monitors, we needed to edit one of its fields (specifically, lockWord), which contains an ObjectMonitor or a bit set of lock word.

final case class Const(value: Val) extends Val

A constant.

A constant.

Note that this class does not behave like a literal constant, which are represented by ByteString, Zero, Int, etc. Instead, it represents a pointer to some constant value.

final case class Double(value: Double) extends Val

A 64-bit IEEE 754 double-precision float.

A 64-bit IEEE 754 double-precision float.

case object False extends Val

The constant Boolean 'false'.

The constant Boolean 'false'.

final case class Float(value: Float) extends Val

A 32-bit IEEE 754 single-precision float.

A 32-bit IEEE 754 single-precision float.

final case class Global(name: Global, valty: Type) extends Val

A reference to a global variable, constant, or method.

A reference to a global variable, constant, or method.

final case class Int(value: Int) extends Val

A 32-bit signed two’s complement integer.

A 32-bit signed two’s complement integer.

final case class Local(id: Local, valty: Type) extends Val

A local SSA variable.

A local SSA variable.

final case class Long(value: Long) extends Val

A 64-bit signed two’s complement integer.

A 64-bit signed two’s complement integer.

case object Null extends Val

The constant 'null' value.

The constant 'null' value.

final case class Short(value: Short) extends Val

A 16-bit signed two’s complement integer.

A 16-bit signed two’s complement integer.

final case class Size(value: Long) extends Val

A numerical value suitable to represent the size of a container.

A numerical value suitable to represent the size of a container.

final case class String(value: String) extends Val

A character string.

A character string.

Values of this type correspond to instances of java.lang.String and are compiled as global arrays of UTF-16 characters. Use ByteString to represent C-string literals.

final case class StructValue(values: Seq[Val]) extends Val

A heterogeneous collection of data members.

A heterogeneous collection of data members.

case object True extends Val

The constant Boolean 'true'.

The constant Boolean 'true'.

case object Unit extends Val

The unit value.

The unit value.

final case class Virtual(key: Long) extends Val

A virtual value.

A virtual value.

Virtual values only serve as placeholders during optimization. They are not serializable and are never emitted by the compiler plugin.

final case class Zero(of: Type) extends Val

The "zero" value of the given NIR type.

The "zero" value of the given NIR type.

Inherited types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Inherited from:
Mirror

The name of the type

The name of the type

Inherited from:
Mirror