Dotty Documentation

0.14.0-bin-SNAPSHOT

abstract class BTypes
extends Object

The BTypes component defines The BType class hierarchy. BTypes encapsulates all type information that is required after building the ASM nodes. This includes optimizations, geneartion of InnerClass attributes and generation of stack map frames.

This representation is immutable and independent of the compiler data structures, hence it can be queried by concurrent threads.

[-] Constructors

BTypes ( )

[-] Members

[+] case class ArrayBType
[+] object ArrayBType
[+] object BOOL
[+] trait BType
[+] object BYTE
[+] object CHAR
[+] final class ClassBType

A ClassBType represents a class or interface type. The necessary information to build a ClassBType is extracted from compiler symbols and types, see BTypesFromSymbols.

The offset and length fields are used to represent the internal name of the class. They are indices into some character array. The internal name can be obtained through the method internalNameString, which is abstract in this component. Name creation is assumed to be hash-consed, so if two ClassBTypes have the same internal name, they NEED to have the same offset and length.

The actual implementation in subclass BTypesFromSymbols uses the global chrs array from the name table. This representation is efficient because the JVM class name is obtained through 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.

ClassBType is not a case class because we want a custom equals method, and because the extractor extracts the internalName, which is what you typically need.

[+] object ClassBType
[+] case class ClassInfo

The type info for a class. Used for symboltable-independent subtype checks in the backend.

[+] object ClassInfo

The type info for a class. Used for symboltable-independent subtype checks in the backend.

[+] object DOUBLE
[+] object FLOAT
[+] object INT
[+] case class InnerClassEntry

This class holds the data for an entry in the InnerClass table. See the InnerClass summary above in this file.

There's some overlap with the class NestedInfo, but it's not exactly the same and cleaner to keep separate.

[+] object InnerClassEntry

This class holds the data for an entry in the InnerClass table. See the InnerClass summary above in this file.

There's some overlap with the class NestedInfo, but it's not exactly the same and cleaner to keep separate.

[+] object LONG
[+] case class MethodBType
[+] object MethodBType
[+] case class MethodNameAndType
[+] object MethodNameAndType
[+] case class NestedInfo

Information required to add a class to an InnerClass table. The spec summary above explains what information is required for the InnerClass entry.

[+] object NestedInfo

Information required to add a class to an InnerClass table. The spec summary above explains what information is required for the InnerClass entry.

[+] @Child @Child @Child @Child @Child @Child @Child @Child @Child sealed trait PrimitiveBType
[+] @Child @Child sealed trait RefBType
[+] object SHORT
[+] object UNIT
[+] val coreBTypes : CoreBTypesProxyGlobalIndependent [ BTypes ]
[+] val int : BackendInterface
[+] def classBTypeFromInternalName ( internalName: String ) : ClassBType

Obtain a previously constructed ClassBType for a given internal name.

[+] protected def classBTypeFromInternalNameMap : Map [ String, ClassBType ]

A map from internal names to ClassBTypes. Every ClassBType is added to this map on its construction.

This map is used when computing stack map frames. The asm.ClassWriter invokes the method getCommonSuperClass. In this method we need to obtain the ClassBType for a given internal name. The method assumes that every class type that appears in the bytecode exists in the map.

Concurrent because stack map frames are computed when in the class writer, which might run on multiple classes concurrently.