Construct a ClassBType for a given java class name.
Construct a ClassBType for a given java class name.
A class name of the form "java/lang/String", without the surrounding 'L' and ';'.
Construct a ClassBType for a given (intenred) class name.
Construct a ClassBType for a given (intenred) class name.
The class name as a slice of the chrs
array, without the surrounding 'L' and ';'.
Note that classSymbol.javaBinaryName
returns exactly such a name.
The class or array type of this reference type.
The class or array type of this reference type. Used for ANEWARRAY, MULTIANEWARRAY, INSTANCEOF and CHECKCAST instructions. Also used for emitting invokevirtual calls to (a: Array[T]).clone() for any T, see genApply.
In contrast to the descriptor, this string does not contain the surrounding 'L' and ';' for class types, for example "java/lang/String". However, for array types, the full descriptor is used, for example "[Ljava/lang/String;".
This can be verified for example using javap or ASMifier.
The Java descriptor of this type. Examples:
Custom equals / hashCode are needed because this is not a case class.
Custom equals / hashCode are needed because this is not a case class.
The internal name of a class is the string returned by java.lang.Class.getName, with all '.' replaced by '/'.
The internal name of a class is the string returned by java.lang.Class.getName, with all '.' replaced by '/'. For example "java/lang/String".
The class name without the package prefix
0 for void, 2 for long and double, 1 otherwise
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
Some JVM opcodes have typed variants.
Some JVM opcodes have typed variants. This method returns the correct opcode according to the type.
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.
The opcode adapted to this java type. For example, if this type is float
and
opcode
is IRETURN
, this method returns FRETURN
.
Class or Interface type.
Classes are represented using their name as a slice of the
chrs
array. This representation is efficient because the JVM class name is initially created usingclassSymbol.javaBinaryName
. This already adds the necessary string to thechrs
array, so it makes sense to reuse the same name table in the backend.Not a case class because that would expose the (Int, Int) constructor (didn't find a way to make it private, also the factory in the companion).