PrimitiveBType

dotty.tools.backend.jvm.BTypes.PrimitiveBType
sealed trait PrimitiveBType extends BType

Attributes

Graph
Supertypes
trait BType
class Object
trait Matchable
class Any
Known subtypes
object BOOL
object BYTE
object CHAR
object DOUBLE
object FLOAT
object INT
object LONG
object SHORT
object UNIT
Show all

Members list

Value members

Concrete methods

final def maxValueType(other: BType): BType

The upper bound of two primitive types. The other type has to be either a primitive type or Nothing.

The upper bound of two primitive types. The other type has to be either a primitive type or Nothing.

The maxValueType of (Char, Byte) and of (Char, Short) is Int, to encompass the negative values of Byte and Short. See ticket #2087.

Attributes

Inherited methods

Attributes

Inherited from:
BType

Attributes

Inherited from:
BType

Attributes

Inherited from:
BType

Attributes

Inherited from:
BType
final def conformsTo(other: BType): Boolean

Attributes

Inherited from:
BType
final def descriptor: String

Attributes

Returns

The Java descriptor of this type. Examples:

  • int: I
  • java.lang.String: Ljava/lang/String;
  • int[]: [I
  • Object m(String s, double d): (Ljava/lang/String;D)Ljava/lang/Object;
Inherited from:
BType
final def isArray: Boolean

Attributes

Inherited from:
BType
final def isBoxed: Boolean

Attributes

Inherited from:
BType
final def isClass: Boolean

Attributes

Inherited from:
BType
final def isIntSizedType: Boolean

Attributes

Inherited from:
BType
final def isIntegralType: Boolean

Attributes

Inherited from:
BType
final def isMethod: Boolean

Attributes

Inherited from:
BType

Attributes

Inherited from:
BType
final def isNothingType: Boolean

Attributes

Inherited from:
BType
final def isNullType: Boolean

Attributes

Inherited from:
BType
final def isNumericType: Boolean

Attributes

Inherited from:
BType
final def isPrimitive: Boolean

Attributes

Inherited from:
BType
final def isRealType: Boolean

Attributes

Inherited from:
BType
final def isRef: Boolean

Attributes

Inherited from:
BType
final def isWideType: Boolean

Attributes

Inherited from:
BType
final def maxType(other: BType): BType

Compute the upper bound of two types. Takes promotions of numeric primitives into account.

Compute the upper bound of two types. Takes promotions of numeric primitives into account.

Attributes

Inherited from:
BType
final def size: Int

Attributes

Returns

0 for void, 2 for long and double, 1 otherwise

Inherited from:
BType

The asm.Type corresponding to this BType.

The asm.Type corresponding to this BType.

Note about asm.Type.getObjectType (*): For class types, the method expects the internal name, i.e. without the surrounding 'L' and ';'. For array types on the other hand, the method expects a full descriptor, for example "[Ljava/lang/String;".

See method asm.Type.getType that creates a asm.Type from a type descriptor

  • for an OBJECT type, the 'L' and ';' are not part of the range of the created Type
  • for an ARRAY type, the full descriptor is part of the range

Attributes

Inherited from:
BType
final override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
BType -> Any
Inherited from:
BType
final def typedOpcode(opcode: Int): Int

Some JVM opcodes have typed variants. This method returns the correct opcode according to the type.

Some JVM opcodes have typed variants. This method returns the correct opcode according to the type.

Value parameters

opcode

A JVM instruction opcode. This opcode must be one of ILOAD, ISTORE, IALOAD, IASTORE, IADD, ISUB, IMUL, IDIV, IREM, INEG, ISHL, ISHR, IUSHR, IAND, IOR IXOR and IRETURN.

Attributes

Returns

The opcode adapted to this java type. For example, if this type is float and opcode is IRETURN, this method returns FRETURN.

Inherited from:
BType