First, arrays are now objects. Although this makes arrays a little heavier weight, it means that they can be used in any situation an Object can be, without any transformations. Arrays and nullable arrays are different types although their memory layout is the same. This change improves memory management since there is no concern about creating and freeing wrapper classes for arrays.
Second, all Class objects, including those for generic classes, are constructed at compile time. Although the design is somewhat different, this change actually reverts back to the style of class construction from a couple of years ago. Classes that contain partial parameterization (such as a CanIterate<T> inside of a LinkedList<T>) are recorded in the .meta file so that they can be reconstructed without needing the full source code.
The disadvantage of constructing all Class objects is that executable size will be larger since a lot of class data needs to be stored.
The advantages are many:
Getting the necessary Class object (for an allocation or a type comparison) is constant-time (not to mention a pretty small number of operations)
No clunky runtime system that looks up classes when they are available and constructs them otherwise
No hash table containing all of these classes
It may be possible to move to using HashMap<ulong> instead of AddressMap for copies, since the existence of generic types is guaranteed
Class information is no longer being copied from LLVM files as text, so we can easily move to storing pre-optimized .bc files instead of .ll files, making partial compilation faster and shrinking the size of the intermediate files that are stored
First, arrays are now objects. Although this makes arrays a little heavier weight, it means that they can be used in any situation an
Object
can be, without any transformations. Arrays and nullable arrays are different types although their memory layout is the same. This change improves memory management since there is no concern about creating and freeing wrapper classes for arrays.Second, all
Class
objects, including those for generic classes, are constructed at compile time. Although the design is somewhat different, this change actually reverts back to the style of class construction from a couple of years ago. Classes that contain partial parameterization (such as aCanIterate<T>
inside of aLinkedList<T>
) are recorded in the.meta
file so that they can be reconstructed without needing the full source code.The disadvantage of constructing all
Class
objects is that executable size will be larger since a lot of class data needs to be stored.The advantages are many:
Class
object (for an allocation or a type comparison) is constant-time (not to mention a pretty small number of operations)HashMap<ulong>
instead ofAddressMap
for copies, since the existence of generic types is guaranteed.bc
files instead of.ll
files, making partial compilation faster and shrinking the size of the intermediate files that are stored