Interface for names stored in chrs
Class or Interface type.
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 using classSymbol.javaBinaryName
.
This already adds the necessary string to the chrs
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).
Create a new name in chrs
.
Create a new name in chrs
. Names are assumed to be hash-consed. Equality on BType will use
reference equality to compare the names.
Map from type kinds to the Java reference types.
Map from type kinds to the Java reference types. Useful when pushing class literals onto the operand stack (ldc instruction taking a class literal).
genConstant()
TODO @lry rename to "boxedClassOfPrimitive" or so, check usages
Predef.classOf
BTypes is a backend component that defines the class BType, a number of basic instances and some utilities.
A BType is essentially an slice of the array
chrs
denoting the name of the type, and a field denoting the kind (object, array, method, or one of the primitive types).BTypes depends on Global just because it re-uses hash-consing of Name. It would be cleaner to create an interface for BTypeName and extend it in scala.reflect.internal.Names#Name, that would simplify testing BTypes (no Global needed).