Difference between revisions of "Runtime Type System"

(Type nomenclature)
(Type description)
Line 17: Line 17:
  
 
==Type description==
 
==Type description==
For every computed type, we have a structure EIF_GEN_DER which contains the
+
For every computed type, we have a structure EIF_GEN_DER which contains a solved type encoding (formals replaced by actual, generic type replaced by their full dynamic type) as well information about the kind of type it is (TUPLE, BIT, expanded, number of generic parameter).

Revision as of 16:21, 25 September 2008

Description of all the information related to the type system at runtime.

Introduction

As described in the Runtime Type Encoding page, every type created at runtime have an encoding. Then encoding contains information which enables creation of objects, object tests, geting the type of the i-th generic of a class.

Type nomenclature

At runtime we have to distinguish between 2 types for each object:

  • dtype corresponds to {CLASS_TYPE}.type_id
  • dftype correponds to a runtime computed type

When talking about those types at runtime, we refer to dynamic type for dtype and full dynamic type for dftype.

For non-generic classes (without an attachment mark), dtype and dftype are the same.

For generic classes, the full dynamic type is computed from the type encoding. We have a mapping between dftype and dtype stored in the C structure eif_cid_map.

Type description

For every computed type, we have a structure EIF_GEN_DER which contains a solved type encoding (formals replaced by actual, generic type replaced by their full dynamic type) as well information about the kind of type it is (TUPLE, BIT, expanded, number of generic parameter).