Runtime Type System

Revision as of 15:21, 25 September 2008 by Manus (Talk | contribs) (Type description)

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).