reorganized the kernel class table with the index to the superclass slot for bootstrapping of initial class chains
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
fb25712133
commit
b040c2c05a
721
lib/gc.c
721
lib/gc.c
@ -87,8 +87,8 @@ static struct
|
|||||||
* FixedSizedCollection
|
* FixedSizedCollection
|
||||||
* Array
|
* Array
|
||||||
* ByteArray
|
* ByteArray
|
||||||
* String
|
* String
|
||||||
* Symbol
|
* Symbol
|
||||||
* Set
|
* Set
|
||||||
* Dictionary
|
* Dictionary
|
||||||
* SystemDictionary
|
* SystemDictionary
|
||||||
@ -110,57 +110,124 @@ static struct
|
|||||||
struct kernel_class_info_t
|
struct kernel_class_info_t
|
||||||
{
|
{
|
||||||
const hcl_bch_t* name;
|
const hcl_bch_t* name;
|
||||||
|
int superclass_kci;
|
||||||
int class_brand;
|
int class_brand;
|
||||||
int class_flags;
|
int class_flags; /* class flags for selfspec */
|
||||||
int class_num_classvars;
|
int class_ncvars; /* number of class variables */
|
||||||
|
|
||||||
int class_spec_named_instvars;
|
int class_spec_nivars; /* number of named instance variables */
|
||||||
int class_spec_flags;
|
int class_spec_flags;
|
||||||
int class_spec_indexed_type;
|
int class_spec_indexed_type;
|
||||||
|
|
||||||
hcl_oow_t offset;
|
hcl_oow_t offset; /* offset to the field in hcl_t that stored the class pointer */
|
||||||
};
|
};
|
||||||
typedef struct kernel_class_info_t kernel_class_info_t;
|
typedef struct kernel_class_info_t kernel_class_info_t;
|
||||||
|
|
||||||
static kernel_class_info_t kernel_classes[] =
|
enum {
|
||||||
|
KCI_APEX = 0,
|
||||||
|
KCI_CLASS,
|
||||||
|
KCI_UNDEFINED_OBJECT,
|
||||||
|
KCI_NIL_OBJECT,
|
||||||
|
KCI_OBJECT,
|
||||||
|
KCI_COLLECTION,
|
||||||
|
KCI_INDEXED_COLLECTION,
|
||||||
|
KCI_FIXED_SIZED_COLLECTION,
|
||||||
|
KCI_STRING,
|
||||||
|
KCI_SYMBOL,
|
||||||
|
KCI_ARRAY,
|
||||||
|
KCI_BYTE_ARRAY,
|
||||||
|
KCI_SYMBOL_TABLE,
|
||||||
|
KCI_DICTIONARY,
|
||||||
|
KCI_CONS,
|
||||||
|
KCI_METHOD_DICTIONARY,
|
||||||
|
KCI_FUNCTION,
|
||||||
|
KCI_COMPILED_BLOCK,
|
||||||
|
KCI_METHOD_CONTEXT,
|
||||||
|
KCI_BLOCK_CONTEXT,
|
||||||
|
KCI_PROCESS,
|
||||||
|
KCI_SEMAPHORE,
|
||||||
|
KCI_SEMAPHORE_GROUP,
|
||||||
|
KCI_PROCESS_SCHEDULER,
|
||||||
|
KCI_ERROR,
|
||||||
|
KCI_TRUE,
|
||||||
|
KCI_FALSE,
|
||||||
|
KCI_MAGNITUDE,
|
||||||
|
KCI_CHARACTER,
|
||||||
|
KCI_NUMBER,
|
||||||
|
KCI_SMALL_INTEGER,
|
||||||
|
KCI_LARGE_POSITIVE_INTEGER,
|
||||||
|
KCI_LARGE_NEGATIVE_INTEGER,
|
||||||
|
KCI_FIXED_POINT_DECIMAL,
|
||||||
|
KCI_SMALL_POINTER,
|
||||||
|
KCI_LARGE_POINTER,
|
||||||
|
KCI_SYSTEM,
|
||||||
|
|
||||||
|
__KCI_MAX__
|
||||||
|
};
|
||||||
|
#define KCI(x) HCL_AID(x)
|
||||||
|
|
||||||
|
static kernel_class_info_t kernel_classes[__KCI_MAX__] =
|
||||||
{
|
{
|
||||||
/* --------------------------------------------------------------
|
/* --------------------------------------------------------------
|
||||||
* Apex - proto-object with 1 class variable.
|
* Apex - proto-object with 1 class variable.
|
||||||
* UndefinedObject - class for the nil object.
|
* Class
|
||||||
* Object - top of all ordinary objects.
|
* UndefinedObject - class for the undefined state
|
||||||
* String
|
* NilObject - class for nil
|
||||||
* Symbol
|
* Object - top of all ordinary objects.
|
||||||
* Array
|
* String
|
||||||
* ByteArray
|
* Symbol
|
||||||
* SymbolSet
|
* Array
|
||||||
* Character
|
* ByteArray
|
||||||
* SmallIntger
|
* Character
|
||||||
|
* SmallIntger
|
||||||
* -------------------------------------------------------------- */
|
* -------------------------------------------------------------- */
|
||||||
|
KCI(KCI_APEX) {
|
||||||
|
"Apex",
|
||||||
|
-1, /* no superclass */
|
||||||
|
0, /* brand */
|
||||||
|
0, /* selfspec flags */
|
||||||
|
0, /* ncvars */
|
||||||
|
0, /* nivars */
|
||||||
|
0, /* spec flags */
|
||||||
|
HCL_OBJ_TYPE_OOP, /* indexed type */
|
||||||
|
HCL_OFFSETOF(hcl_t, c_apex)
|
||||||
|
},
|
||||||
|
|
||||||
{ "Apex", 0,
|
KCI(KCI_CLASS) {
|
||||||
0,
|
"Class",
|
||||||
0,
|
KCI_APEX,
|
||||||
0,
|
HCL_BRAND_CLASS,
|
||||||
0,
|
HCL_CLASS_SELFSPEC_FLAG_LIMITED,
|
||||||
HCL_OBJ_TYPE_OOP,
|
0, /* ncvars */
|
||||||
HCL_OFFSETOF(hcl_t, c_apex) },
|
HCL_CLASS_NAMED_INSTVARS, /* nivars */
|
||||||
|
HCL_CLASS_SPEC_FLAG_INDEXED | HCL_CLASS_SPEC_FLAG_UNCOPYABLE,
|
||||||
|
HCL_OBJ_TYPE_OOP,
|
||||||
|
HCL_OFFSETOF(hcl_t, c_class)
|
||||||
|
},
|
||||||
|
|
||||||
{ "UndefinedObject", HCL_BRAND_UNDEF,
|
KCI(KCI_UNDEFINED_OBJECT) {
|
||||||
0,
|
"UndefinedObject",
|
||||||
0,
|
KCI_APEX,
|
||||||
0,
|
HCL_BRAND_UNDEF,
|
||||||
0,
|
0,
|
||||||
HCL_OBJ_TYPE_OOP,
|
0,
|
||||||
HCL_OFFSETOF(hcl_t, c_undefobj) },
|
0,
|
||||||
|
0,
|
||||||
|
HCL_OBJ_TYPE_OOP,
|
||||||
|
HCL_OFFSETOF(hcl_t, c_undefobj)
|
||||||
|
},
|
||||||
|
|
||||||
#define KCI_CLASS 2 /* index to the Class entry in this table */
|
KCI(KCI_NIL_OBJECT) {
|
||||||
{ "Class", HCL_BRAND_CLASS,
|
"NilObject",
|
||||||
HCL_CLASS_SELFSPEC_FLAG_LIMITED,
|
KCI_APEX,
|
||||||
0,
|
HCL_BRAND_NIL,
|
||||||
HCL_CLASS_NAMED_INSTVARS,
|
0,
|
||||||
HCL_CLASS_SPEC_FLAG_INDEXED | HCL_CLASS_SPEC_FLAG_UNCOPYABLE,
|
0,
|
||||||
HCL_OBJ_TYPE_OOP,
|
0,
|
||||||
HCL_OFFSETOF(hcl_t, c_class) },
|
0,
|
||||||
|
HCL_OBJ_TYPE_OOP,
|
||||||
|
HCL_OFFSETOF(hcl_t, c_nilobj)
|
||||||
|
},
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
{ "Interface",
|
{ "Interface",
|
||||||
@ -172,72 +239,140 @@ static kernel_class_info_t kernel_classes[] =
|
|||||||
HCL_OFFSETOF(hcl_t, _interface) },
|
HCL_OFFSETOF(hcl_t, _interface) },
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
{ "Object", 0,
|
KCI(KCI_OBJECT) {
|
||||||
0,
|
"Object",
|
||||||
0,
|
KCI_APEX,
|
||||||
0,
|
0, /* brand */
|
||||||
0,
|
0, /* selfspec flags */
|
||||||
HCL_OBJ_TYPE_OOP,
|
0, /* ncvars */
|
||||||
HCL_OFFSETOF(hcl_t, c_object) },
|
0, /* nivars */
|
||||||
|
0, /* spec flags */
|
||||||
|
HCL_OBJ_TYPE_OOP,
|
||||||
|
HCL_OFFSETOF(hcl_t, c_object)
|
||||||
|
},
|
||||||
|
|
||||||
{ "String", HCL_BRAND_STRING,
|
KCI(KCI_COLLECTION) {
|
||||||
0,
|
"Collection",
|
||||||
0,
|
KCI_OBJECT,
|
||||||
0,
|
0, /* brand */
|
||||||
HCL_CLASS_SPEC_FLAG_INDEXED,
|
0,
|
||||||
HCL_OBJ_TYPE_CHAR,
|
0,
|
||||||
HCL_OFFSETOF(hcl_t, c_string) },
|
0,
|
||||||
|
0,
|
||||||
|
HCL_OBJ_TYPE_OOP,
|
||||||
|
HCL_OFFSETOF(hcl_t, c_collection)
|
||||||
|
},
|
||||||
|
|
||||||
{ "Symbol", HCL_BRAND_SYMBOL,
|
KCI(KCI_INDEXED_COLLECTION) {
|
||||||
HCL_CLASS_SELFSPEC_FLAG_FINAL | HCL_CLASS_SELFSPEC_FLAG_LIMITED,
|
"IndexedCollection",
|
||||||
0,
|
KCI_COLLECTION,
|
||||||
0,
|
0, /* brand */
|
||||||
HCL_CLASS_SPEC_FLAG_INDEXED | HCL_CLASS_SPEC_FLAG_IMMUTABLE,
|
0,
|
||||||
HCL_OBJ_TYPE_CHAR,
|
0,
|
||||||
HCL_OFFSETOF(hcl_t, c_symbol) },
|
0,
|
||||||
|
0,
|
||||||
|
HCL_OBJ_TYPE_OOP,
|
||||||
|
HCL_OFFSETOF(hcl_t, c_indexed_collection)
|
||||||
|
},
|
||||||
|
|
||||||
{ "Array", HCL_BRAND_ARRAY,
|
KCI(KCI_FIXED_SIZED_COLLECTION) {
|
||||||
0,
|
"FixedSizedCollection",
|
||||||
0,
|
KCI_INDEXED_COLLECTION,
|
||||||
0,
|
0, /* brand */
|
||||||
HCL_CLASS_SPEC_FLAG_INDEXED,
|
0,
|
||||||
HCL_OBJ_TYPE_OOP,
|
0,
|
||||||
HCL_OFFSETOF(hcl_t, c_array) },
|
0,
|
||||||
|
0,
|
||||||
|
HCL_OBJ_TYPE_OOP,
|
||||||
|
HCL_OFFSETOF(hcl_t, c_fixed_sized_collection)
|
||||||
|
},
|
||||||
|
|
||||||
{ "ByteArray", HCL_BRAND_BYTE_ARRAY,
|
KCI(KCI_STRING) {
|
||||||
0,
|
"String",
|
||||||
0,
|
KCI_FIXED_SIZED_COLLECTION,
|
||||||
0,
|
HCL_BRAND_STRING,
|
||||||
HCL_CLASS_SPEC_FLAG_INDEXED,
|
0,
|
||||||
HCL_OBJ_TYPE_BYTE,
|
0,
|
||||||
HCL_OFFSETOF(hcl_t, c_byte_array) },
|
0,
|
||||||
|
HCL_CLASS_SPEC_FLAG_INDEXED,
|
||||||
|
HCL_OBJ_TYPE_CHAR,
|
||||||
|
HCL_OFFSETOF(hcl_t, c_string)
|
||||||
|
},
|
||||||
|
|
||||||
|
KCI(KCI_SYMBOL) {
|
||||||
|
"Symbol",
|
||||||
|
KCI_STRING,
|
||||||
|
HCL_BRAND_SYMBOL,
|
||||||
|
HCL_CLASS_SELFSPEC_FLAG_FINAL | HCL_CLASS_SELFSPEC_FLAG_LIMITED,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
HCL_CLASS_SPEC_FLAG_INDEXED | HCL_CLASS_SPEC_FLAG_IMMUTABLE,
|
||||||
|
HCL_OBJ_TYPE_CHAR,
|
||||||
|
HCL_OFFSETOF(hcl_t, c_symbol)
|
||||||
|
},
|
||||||
|
|
||||||
|
KCI(KCI_ARRAY) {
|
||||||
|
"Array",
|
||||||
|
KCI_FIXED_SIZED_COLLECTION,
|
||||||
|
HCL_BRAND_ARRAY,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
HCL_CLASS_SPEC_FLAG_INDEXED,
|
||||||
|
HCL_OBJ_TYPE_OOP,
|
||||||
|
HCL_OFFSETOF(hcl_t, c_array)
|
||||||
|
},
|
||||||
|
|
||||||
|
KCI(KCI_BYTE_ARRAY) {
|
||||||
|
"ByteArray",
|
||||||
|
KCI_FIXED_SIZED_COLLECTION,
|
||||||
|
HCL_BRAND_BYTE_ARRAY,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
HCL_CLASS_SPEC_FLAG_INDEXED,
|
||||||
|
HCL_OBJ_TYPE_BYTE,
|
||||||
|
HCL_OFFSETOF(hcl_t, c_byte_array)
|
||||||
|
},
|
||||||
|
|
||||||
/* A special incarnation of a dictionary that allows only a symbol as a value.
|
/* A special incarnation of a dictionary that allows only a symbol as a value.
|
||||||
* The value in bucket is a symbol while the value in a normal dictionary is a
|
* The value in bucket is a symbol while the value in a normal dictionary is a
|
||||||
* pair(cons) that contains a key and a value. */
|
* pair(cons) that contains a key and a value. */
|
||||||
{ "SymbolTable", HCL_BRAND_DIC, /* TODO: make this a special child class of Dictionary?? */
|
KCI(KCI_SYMBOL_TABLE) {
|
||||||
0,
|
"SymbolTable",
|
||||||
0,
|
KCI_COLLECTION,
|
||||||
HCL_DIC_NAMED_INSTVARS,
|
HCL_BRAND_DIC, /* TODO: make this a special child class of Dictionary?? */
|
||||||
0,
|
0,
|
||||||
HCL_OBJ_TYPE_OOP,
|
0,
|
||||||
HCL_OFFSETOF(hcl_t, c_symtab) },
|
HCL_DIC_NAMED_INSTVARS,
|
||||||
|
0,
|
||||||
|
HCL_OBJ_TYPE_OOP,
|
||||||
|
HCL_OFFSETOF(hcl_t, c_symtab)
|
||||||
|
},
|
||||||
|
|
||||||
{ "Dictionary", HCL_BRAND_DIC,
|
KCI(KCI_DICTIONARY) {
|
||||||
0,
|
"Dictionary",
|
||||||
0,
|
KCI_COLLECTION,
|
||||||
HCL_DIC_NAMED_INSTVARS,
|
HCL_BRAND_DIC,
|
||||||
0,
|
0,
|
||||||
HCL_OBJ_TYPE_OOP,
|
0,
|
||||||
HCL_OFFSETOF(hcl_t, c_dictionary) },
|
HCL_DIC_NAMED_INSTVARS,
|
||||||
|
0,
|
||||||
|
HCL_OBJ_TYPE_OOP,
|
||||||
|
HCL_OFFSETOF(hcl_t, c_dictionary)
|
||||||
|
},
|
||||||
|
|
||||||
{ "Cons", HCL_BRAND_CONS,
|
KCI(KCI_CONS) {
|
||||||
0,
|
"Cons",
|
||||||
0,
|
KCI_OBJECT,
|
||||||
HCL_CONS_NAMED_INSTVARS,
|
HCL_BRAND_CONS,
|
||||||
0,
|
0,
|
||||||
HCL_OBJ_TYPE_OOP,
|
0,
|
||||||
HCL_OFFSETOF(hcl_t, c_cons) },
|
HCL_CONS_NAMED_INSTVARS,
|
||||||
|
0,
|
||||||
|
HCL_OBJ_TYPE_OOP,
|
||||||
|
HCL_OFFSETOF(hcl_t, c_cons)
|
||||||
|
},
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
{ "Namespace",
|
{ "Namespace",
|
||||||
@ -257,13 +392,17 @@ static kernel_class_info_t kernel_classes[] =
|
|||||||
HCL_OFFSETOF(hcl_t, c_pool_dictionary) },
|
HCL_OFFSETOF(hcl_t, c_pool_dictionary) },
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
{ "MethodDictionary", 0,
|
KCI(KCI_METHOD_DICTIONARY) {
|
||||||
0,
|
"MethodDictionary",
|
||||||
0,
|
KCI_DICTIONARY,
|
||||||
HCL_DIC_NAMED_INSTVARS,
|
0,
|
||||||
0,
|
0,
|
||||||
HCL_OBJ_TYPE_OOP,
|
0,
|
||||||
HCL_OFFSETOF(hcl_t, c_method_dictionary) },
|
HCL_DIC_NAMED_INSTVARS,
|
||||||
|
0,
|
||||||
|
HCL_OBJ_TYPE_OOP,
|
||||||
|
HCL_OFFSETOF(hcl_t, c_method_dictionary)
|
||||||
|
},
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
{ "CompiledMethod",
|
{ "CompiledMethod",
|
||||||
@ -285,13 +424,17 @@ static kernel_class_info_t kernel_classes[] =
|
|||||||
|
|
||||||
/* special function created with MAKE_FUNCTION in interactive mode
|
/* special function created with MAKE_FUNCTION in interactive mode
|
||||||
* for execution of code fed and compiled. */
|
* for execution of code fed and compiled. */
|
||||||
{ "Function", HCL_BRAND_FUNCTION,
|
KCI(KCI_FUNCTION) {
|
||||||
0,
|
"Function",
|
||||||
0,
|
KCI_OBJECT,
|
||||||
HCL_FUNCTION_NAMED_INSTVARS,
|
HCL_BRAND_FUNCTION,
|
||||||
HCL_CLASS_SPEC_FLAG_INDEXED,
|
0,
|
||||||
HCL_OBJ_TYPE_OOP,
|
0,
|
||||||
HCL_OFFSETOF(hcl_t, c_function) },
|
HCL_FUNCTION_NAMED_INSTVARS,
|
||||||
|
HCL_CLASS_SPEC_FLAG_INDEXED,
|
||||||
|
HCL_OBJ_TYPE_OOP,
|
||||||
|
HCL_OFFSETOF(hcl_t, c_function)
|
||||||
|
},
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
{ "Primitive", HCL_BRAND_PRIM,
|
{ "Primitive", HCL_BRAND_PRIM,
|
||||||
@ -303,152 +446,248 @@ static kernel_class_info_t kernel_classes[] =
|
|||||||
HCL_OFFSETOF(hcl_t, c_prim) },
|
HCL_OFFSETOF(hcl_t, c_prim) },
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
{ "CompiledBlock", HCL_BRAND_BLOCK,
|
KCI(KCI_COMPILED_BLOCK) {
|
||||||
0,
|
"CompiledBlock",
|
||||||
0,
|
KCI_OBJECT,
|
||||||
HCL_BLOCK_NAMED_INSTVARS,
|
HCL_BRAND_BLOCK,
|
||||||
0,
|
0,
|
||||||
HCL_OBJ_TYPE_OOP,
|
0,
|
||||||
HCL_OFFSETOF(hcl_t, c_block) },
|
HCL_BLOCK_NAMED_INSTVARS,
|
||||||
|
0,
|
||||||
|
HCL_OBJ_TYPE_OOP,
|
||||||
|
HCL_OFFSETOF(hcl_t, c_block)
|
||||||
|
},
|
||||||
|
|
||||||
{ "MethodContext", 0,
|
KCI(KCI_METHOD_CONTEXT) {
|
||||||
HCL_CLASS_SELFSPEC_FLAG_FINAL | HCL_CLASS_SELFSPEC_FLAG_LIMITED,
|
"MethodContext",
|
||||||
0,
|
KCI_OBJECT,
|
||||||
HCL_CONTEXT_NAMED_INSTVARS,
|
0,
|
||||||
HCL_CLASS_SPEC_FLAG_INDEXED,
|
HCL_CLASS_SELFSPEC_FLAG_FINAL | HCL_CLASS_SELFSPEC_FLAG_LIMITED,
|
||||||
HCL_OBJ_TYPE_OOP,
|
0,
|
||||||
HCL_OFFSETOF(hcl_t, c_method_context) },
|
HCL_CONTEXT_NAMED_INSTVARS,
|
||||||
|
HCL_CLASS_SPEC_FLAG_INDEXED,
|
||||||
|
HCL_OBJ_TYPE_OOP,
|
||||||
|
HCL_OFFSETOF(hcl_t, c_method_context)
|
||||||
|
},
|
||||||
|
|
||||||
{ "BlockContext", HCL_BRAND_CONTEXT,
|
KCI(KCI_BLOCK_CONTEXT) {
|
||||||
HCL_CLASS_SELFSPEC_FLAG_FINAL | HCL_CLASS_SELFSPEC_FLAG_LIMITED,
|
"BlockContext",
|
||||||
0,
|
KCI_OBJECT,
|
||||||
HCL_CONTEXT_NAMED_INSTVARS,
|
HCL_BRAND_CONTEXT,
|
||||||
HCL_CLASS_SPEC_FLAG_INDEXED,
|
HCL_CLASS_SELFSPEC_FLAG_FINAL | HCL_CLASS_SELFSPEC_FLAG_LIMITED,
|
||||||
HCL_OBJ_TYPE_OOP,
|
0,
|
||||||
HCL_OFFSETOF(hcl_t, c_block_context) },
|
HCL_CONTEXT_NAMED_INSTVARS,
|
||||||
|
HCL_CLASS_SPEC_FLAG_INDEXED,
|
||||||
|
HCL_OBJ_TYPE_OOP,
|
||||||
|
HCL_OFFSETOF(hcl_t, c_block_context)
|
||||||
|
},
|
||||||
|
|
||||||
{ "Process", HCL_BRAND_PROCESS,
|
KCI(KCI_PROCESS) {
|
||||||
HCL_CLASS_SELFSPEC_FLAG_FINAL | HCL_CLASS_SELFSPEC_FLAG_LIMITED,
|
"Process",
|
||||||
0,
|
KCI_OBJECT,
|
||||||
HCL_PROCESS_NAMED_INSTVARS,
|
HCL_BRAND_PROCESS,
|
||||||
HCL_CLASS_SPEC_FLAG_INDEXED | HCL_CLASS_SPEC_FLAG_UNCOPYABLE,
|
HCL_CLASS_SELFSPEC_FLAG_FINAL | HCL_CLASS_SELFSPEC_FLAG_LIMITED,
|
||||||
HCL_OBJ_TYPE_OOP,
|
0,
|
||||||
HCL_OFFSETOF(hcl_t, c_process) },
|
HCL_PROCESS_NAMED_INSTVARS,
|
||||||
|
HCL_CLASS_SPEC_FLAG_INDEXED | HCL_CLASS_SPEC_FLAG_UNCOPYABLE,
|
||||||
|
HCL_OBJ_TYPE_OOP,
|
||||||
|
HCL_OFFSETOF(hcl_t, c_process)
|
||||||
|
},
|
||||||
|
|
||||||
{ "Semaphore", HCL_BRAND_SEMAPHORE,
|
KCI(KCI_SEMAPHORE) {
|
||||||
0,
|
"Semaphore",
|
||||||
0,
|
KCI_OBJECT,
|
||||||
HCL_SEMAPHORE_NAMED_INSTVARS,
|
HCL_BRAND_SEMAPHORE,
|
||||||
HCL_CLASS_SPEC_FLAG_UNCOPYABLE,
|
0,
|
||||||
HCL_OBJ_TYPE_OOP,
|
0,
|
||||||
HCL_OFFSETOF(hcl_t, c_semaphore) },
|
HCL_SEMAPHORE_NAMED_INSTVARS,
|
||||||
|
HCL_CLASS_SPEC_FLAG_UNCOPYABLE,
|
||||||
|
HCL_OBJ_TYPE_OOP,
|
||||||
|
HCL_OFFSETOF(hcl_t, c_semaphore)
|
||||||
|
},
|
||||||
|
|
||||||
{ "SemaphoreGroup", HCL_BRAND_SEMAPHORE_GROUP,
|
KCI(KCI_SEMAPHORE_GROUP) {
|
||||||
0,
|
"SemaphoreGroup",
|
||||||
0,
|
KCI_OBJECT,
|
||||||
HCL_SEMAPHORE_GROUP_NAMED_INSTVARS,
|
HCL_BRAND_SEMAPHORE_GROUP,
|
||||||
HCL_CLASS_SPEC_FLAG_UNCOPYABLE,
|
0,
|
||||||
HCL_OBJ_TYPE_OOP,
|
0,
|
||||||
HCL_OFFSETOF(hcl_t, c_semaphore_group) },
|
HCL_SEMAPHORE_GROUP_NAMED_INSTVARS,
|
||||||
|
HCL_CLASS_SPEC_FLAG_UNCOPYABLE,
|
||||||
|
HCL_OBJ_TYPE_OOP,
|
||||||
|
HCL_OFFSETOF(hcl_t, c_semaphore_group)
|
||||||
|
},
|
||||||
|
|
||||||
{ "ProcessScheduler", HCL_BRAND_PROCESS_SCHEDULER,
|
KCI(KCI_PROCESS_SCHEDULER) {
|
||||||
HCL_CLASS_SELFSPEC_FLAG_FINAL | HCL_CLASS_SELFSPEC_FLAG_LIMITED,
|
"ProcessScheduler",
|
||||||
0,
|
KCI_OBJECT,
|
||||||
HCL_PROCESS_SCHEDULER_NAMED_INSTVARS,
|
HCL_BRAND_PROCESS_SCHEDULER,
|
||||||
HCL_CLASS_SPEC_FLAG_UNCOPYABLE,
|
HCL_CLASS_SELFSPEC_FLAG_FINAL | HCL_CLASS_SELFSPEC_FLAG_LIMITED,
|
||||||
HCL_OBJ_TYPE_OOP,
|
0,
|
||||||
HCL_OFFSETOF(hcl_t, c_process_scheduler) },
|
HCL_PROCESS_SCHEDULER_NAMED_INSTVARS,
|
||||||
|
HCL_CLASS_SPEC_FLAG_UNCOPYABLE,
|
||||||
|
HCL_OBJ_TYPE_OOP,
|
||||||
|
HCL_OFFSETOF(hcl_t, c_process_scheduler)
|
||||||
|
},
|
||||||
|
|
||||||
{ "Error", 0,
|
KCI(KCI_ERROR) {
|
||||||
HCL_CLASS_SELFSPEC_FLAG_LIMITED,
|
"Error",
|
||||||
0,
|
KCI_OBJECT,
|
||||||
0,
|
0,
|
||||||
0,
|
HCL_CLASS_SELFSPEC_FLAG_LIMITED,
|
||||||
HCL_OBJ_TYPE_OOP,
|
0,
|
||||||
HCL_OFFSETOF(hcl_t, c_error) },
|
0,
|
||||||
|
0,
|
||||||
|
HCL_OBJ_TYPE_OOP,
|
||||||
|
HCL_OFFSETOF(hcl_t, c_error)
|
||||||
|
},
|
||||||
|
|
||||||
{ "True", HCL_BRAND_TRUE,
|
KCI(KCI_TRUE) {
|
||||||
HCL_CLASS_SELFSPEC_FLAG_LIMITED | HCL_CLASS_SELFSPEC_FLAG_FINAL,
|
"True",
|
||||||
0,
|
KCI_OBJECT,
|
||||||
0,
|
HCL_BRAND_TRUE,
|
||||||
0,
|
HCL_CLASS_SELFSPEC_FLAG_LIMITED | HCL_CLASS_SELFSPEC_FLAG_FINAL,
|
||||||
HCL_OBJ_TYPE_OOP,
|
0,
|
||||||
HCL_OFFSETOF(hcl_t, c_true) },
|
0,
|
||||||
|
0,
|
||||||
|
HCL_OBJ_TYPE_OOP,
|
||||||
|
HCL_OFFSETOF(hcl_t, c_true)
|
||||||
|
},
|
||||||
|
|
||||||
{ "False", HCL_BRAND_FALSE,
|
KCI(KCI_FALSE) {
|
||||||
HCL_CLASS_SELFSPEC_FLAG_LIMITED | HCL_CLASS_SELFSPEC_FLAG_FINAL,
|
"False",
|
||||||
0,
|
KCI_OBJECT,
|
||||||
0,
|
HCL_BRAND_FALSE,
|
||||||
0,
|
HCL_CLASS_SELFSPEC_FLAG_LIMITED | HCL_CLASS_SELFSPEC_FLAG_FINAL,
|
||||||
HCL_OBJ_TYPE_OOP,
|
0,
|
||||||
HCL_OFFSETOF(hcl_t, c_false) },
|
0,
|
||||||
|
0,
|
||||||
|
HCL_OBJ_TYPE_OOP,
|
||||||
|
HCL_OFFSETOF(hcl_t, c_false)
|
||||||
|
},
|
||||||
|
|
||||||
|
KCI(KCI_MAGNITUDE) {
|
||||||
|
"Magnitude",
|
||||||
|
KCI_OBJECT,
|
||||||
|
0, /* brand */
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
HCL_OBJ_TYPE_OOP,
|
||||||
|
HCL_OFFSETOF(hcl_t, c_magnitude)
|
||||||
|
},
|
||||||
|
|
||||||
/* TOOD: what is a proper spec for Character and SmallInteger?
|
/* TOOD: what is a proper spec for Character and SmallInteger?
|
||||||
* If the fixed part is 0, its instance must be an object of 0 payload fields.
|
* If the fixed part is 0, its instance must be an object of 0 payload fields.
|
||||||
* Does this make sense? */
|
* Does this make sense? */
|
||||||
{ "Character", HCL_BRAND_CHARACTER,
|
KCI(KCI_CHARACTER) {
|
||||||
HCL_CLASS_SELFSPEC_FLAG_LIMITED,
|
"Character",
|
||||||
0,
|
KCI_MAGNITUDE,
|
||||||
0,
|
HCL_BRAND_CHARACTER,
|
||||||
0,
|
HCL_CLASS_SELFSPEC_FLAG_LIMITED,
|
||||||
HCL_OBJ_TYPE_OOP,
|
0,
|
||||||
HCL_OFFSETOF(hcl_t, c_character) },
|
0,
|
||||||
|
0,
|
||||||
|
HCL_OBJ_TYPE_OOP,
|
||||||
|
HCL_OFFSETOF(hcl_t, c_character)
|
||||||
|
},
|
||||||
|
|
||||||
{ "SmallInteger", HCL_BRAND_SMOOI,
|
KCI(KCI_NUMBER) {
|
||||||
HCL_CLASS_SELFSPEC_FLAG_LIMITED,
|
"Number",
|
||||||
0,
|
KCI_MAGNITUDE,
|
||||||
0,
|
0, /* brand */
|
||||||
0,
|
0,
|
||||||
HCL_OBJ_TYPE_OOP,
|
0,
|
||||||
HCL_OFFSETOF(hcl_t, c_small_integer) },
|
0,
|
||||||
|
0,
|
||||||
|
HCL_OBJ_TYPE_OOP,
|
||||||
|
HCL_OFFSETOF(hcl_t, c_number)
|
||||||
|
},
|
||||||
|
|
||||||
{ "LargePositiveInteger", 0,
|
KCI(KCI_SMALL_INTEGER) {
|
||||||
HCL_CLASS_SELFSPEC_FLAG_LIMITED,
|
"SmallInteger",
|
||||||
0,
|
KCI_NUMBER,
|
||||||
0,
|
HCL_BRAND_SMOOI,
|
||||||
HCL_CLASS_SPEC_FLAG_INDEXED | HCL_CLASS_SPEC_FLAG_IMMUTABLE,
|
HCL_CLASS_SELFSPEC_FLAG_LIMITED,
|
||||||
HCL_OBJ_TYPE_LIWORD,
|
0,
|
||||||
HCL_OFFSETOF(hcl_t, c_large_positive_integer) },
|
0,
|
||||||
|
0,
|
||||||
|
HCL_OBJ_TYPE_OOP,
|
||||||
|
HCL_OFFSETOF(hcl_t, c_small_integer)
|
||||||
|
},
|
||||||
|
|
||||||
{ "LargeNegativeInteger", 0,
|
KCI(KCI_LARGE_POSITIVE_INTEGER) {
|
||||||
HCL_CLASS_SELFSPEC_FLAG_LIMITED,
|
"LargePositiveInteger",
|
||||||
0,
|
KCI_NUMBER,
|
||||||
0,
|
0,
|
||||||
HCL_CLASS_SPEC_FLAG_INDEXED | HCL_CLASS_SPEC_FLAG_IMMUTABLE,
|
HCL_CLASS_SELFSPEC_FLAG_LIMITED,
|
||||||
HCL_OBJ_TYPE_LIWORD,
|
0,
|
||||||
HCL_OFFSETOF(hcl_t, c_large_negative_integer) },
|
0,
|
||||||
|
HCL_CLASS_SPEC_FLAG_INDEXED | HCL_CLASS_SPEC_FLAG_IMMUTABLE,
|
||||||
|
HCL_OBJ_TYPE_LIWORD,
|
||||||
|
HCL_OFFSETOF(hcl_t, c_large_positive_integer)
|
||||||
|
},
|
||||||
|
|
||||||
{ "FixedPointDecimal", HCL_BRAND_FPDEC,
|
KCI(KCI_LARGE_NEGATIVE_INTEGER) {
|
||||||
HCL_CLASS_SELFSPEC_FLAG_LIMITED,
|
"LargeNegativeInteger",
|
||||||
0,
|
KCI_NUMBER,
|
||||||
HCL_FPDEC_NAMED_INSTVARS,
|
0,
|
||||||
HCL_CLASS_SPEC_FLAG_IMMUTABLE,
|
HCL_CLASS_SELFSPEC_FLAG_LIMITED,
|
||||||
HCL_OBJ_TYPE_OOP,
|
0,
|
||||||
HCL_OFFSETOF(hcl_t, c_fixed_point_decimal) },
|
0,
|
||||||
|
HCL_CLASS_SPEC_FLAG_INDEXED | HCL_CLASS_SPEC_FLAG_IMMUTABLE,
|
||||||
|
HCL_OBJ_TYPE_LIWORD,
|
||||||
|
HCL_OFFSETOF(hcl_t, c_large_negative_integer)
|
||||||
|
},
|
||||||
|
|
||||||
{ "SmallPointer", HCL_BRAND_SMPTR,
|
KCI(KCI_FIXED_POINT_DECIMAL) {
|
||||||
HCL_CLASS_SELFSPEC_FLAG_LIMITED,
|
"FixedPointDecimal",
|
||||||
0,
|
KCI_NUMBER,
|
||||||
0,
|
HCL_BRAND_FPDEC,
|
||||||
0,
|
HCL_CLASS_SELFSPEC_FLAG_LIMITED,
|
||||||
HCL_OBJ_TYPE_OOP,
|
0,
|
||||||
HCL_OFFSETOF(hcl_t, c_small_pointer) },
|
HCL_FPDEC_NAMED_INSTVARS,
|
||||||
|
HCL_CLASS_SPEC_FLAG_IMMUTABLE,
|
||||||
|
HCL_OBJ_TYPE_OOP,
|
||||||
|
HCL_OFFSETOF(hcl_t, c_fixed_point_decimal)
|
||||||
|
},
|
||||||
|
|
||||||
{ "LargePointer", 0,
|
KCI(KCI_SMALL_POINTER) {
|
||||||
HCL_CLASS_SELFSPEC_FLAG_LIMITED,
|
"SmallPointer",
|
||||||
0,
|
KCI_MAGNITUDE,
|
||||||
1, /* #word(1) */
|
HCL_BRAND_SMPTR,
|
||||||
HCL_CLASS_SPEC_FLAG_IMMUTABLE | HCL_CLASS_SPEC_FLAG_INDEXED,
|
HCL_CLASS_SELFSPEC_FLAG_LIMITED,
|
||||||
HCL_OBJ_TYPE_WORD,
|
0,
|
||||||
HCL_OFFSETOF(hcl_t, c_large_pointer) },
|
0,
|
||||||
|
0,
|
||||||
|
HCL_OBJ_TYPE_OOP,
|
||||||
|
HCL_OFFSETOF(hcl_t, c_small_pointer)
|
||||||
|
},
|
||||||
|
|
||||||
{ "System", 0,
|
KCI(KCI_LARGE_POINTER) {
|
||||||
0,
|
"LargePointer",
|
||||||
5, /* asyncsg, gcfin_sem, gcfin_should_exit, ossig_pid, shr */
|
KCI_MAGNITUDE,
|
||||||
0,
|
0,
|
||||||
0,
|
HCL_CLASS_SELFSPEC_FLAG_LIMITED,
|
||||||
HCL_OBJ_TYPE_OOP,
|
0,
|
||||||
HCL_OFFSETOF(hcl_t, c_system) }
|
1, /* #word(1) */
|
||||||
|
HCL_CLASS_SPEC_FLAG_IMMUTABLE | HCL_CLASS_SPEC_FLAG_INDEXED,
|
||||||
|
HCL_OBJ_TYPE_WORD,
|
||||||
|
HCL_OFFSETOF(hcl_t, c_large_pointer)
|
||||||
|
},
|
||||||
|
|
||||||
|
KCI(KCI_SYSTEM) {
|
||||||
|
"System",
|
||||||
|
KCI_OBJECT,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
5, /* asyncsg, gcfin_sem, gcfin_should_exit, ossig_pid, shr */
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
HCL_OBJ_TYPE_OOP,
|
||||||
|
HCL_OFFSETOF(hcl_t, c_system)
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ========================================================================= */
|
/* ========================================================================= */
|
||||||
@ -1183,10 +1422,6 @@ static hcl_oop_class_t alloc_kernel_class (hcl_t* hcl, int class_flags, hcl_oow_
|
|||||||
HCL_OBJ_SET_CLASS (c, (hcl_oop_t)hcl->c_class);
|
HCL_OBJ_SET_CLASS (c, (hcl_oop_t)hcl->c_class);
|
||||||
c->spec = HCL_SMOOI_TO_OOP(spec);
|
c->spec = HCL_SMOOI_TO_OOP(spec);
|
||||||
c->selfspec = HCL_SMOOI_TO_OOP(HCL_CLASS_SELFSPEC_MAKE(num_classvars, 0, class_flags));
|
c->selfspec = HCL_SMOOI_TO_OOP(HCL_CLASS_SELFSPEC_MAKE(num_classvars, 0, class_flags));
|
||||||
|
|
||||||
/* TODO: remove the following two duplicate fields with the spec fields */
|
|
||||||
//c->nivars = HCL_SMOOI_TO_OOP(HCL_CLASS_SPEC_NAMED_INSTVARS(spec));
|
|
||||||
//c->ncvars = HCL_SMOOI_TO_OOP(num_classvars);
|
|
||||||
c->nivars_super = HCL_SMOOI_TO_OOP(0); /* TODO: encode it into spec? */
|
c->nivars_super = HCL_SMOOI_TO_OOP(0); /* TODO: encode it into spec? */
|
||||||
c->ibrand = HCL_SMOOI_TO_OOP(ibrand);
|
c->ibrand = HCL_SMOOI_TO_OOP(ibrand);
|
||||||
|
|
||||||
@ -1215,8 +1450,8 @@ static int ignite_1 (hcl_t* hcl)
|
|||||||
hcl->c_class = alloc_kernel_class(
|
hcl->c_class = alloc_kernel_class(
|
||||||
hcl,
|
hcl,
|
||||||
kernel_classes[KCI_CLASS].class_flags,
|
kernel_classes[KCI_CLASS].class_flags,
|
||||||
kernel_classes[KCI_CLASS].class_num_classvars,
|
kernel_classes[KCI_CLASS].class_ncvars,
|
||||||
HCL_CLASS_SPEC_MAKE(kernel_classes[KCI_CLASS].class_spec_named_instvars,
|
HCL_CLASS_SPEC_MAKE(kernel_classes[KCI_CLASS].class_spec_nivars,
|
||||||
kernel_classes[KCI_CLASS].class_spec_flags,
|
kernel_classes[KCI_CLASS].class_spec_flags,
|
||||||
kernel_classes[KCI_CLASS].class_spec_indexed_type),
|
kernel_classes[KCI_CLASS].class_spec_indexed_type),
|
||||||
kernel_classes[KCI_CLASS].class_brand);
|
kernel_classes[KCI_CLASS].class_brand);
|
||||||
@ -1240,8 +1475,8 @@ static int ignite_1 (hcl_t* hcl)
|
|||||||
tmp = alloc_kernel_class(
|
tmp = alloc_kernel_class(
|
||||||
hcl,
|
hcl,
|
||||||
kernel_classes[i].class_flags,
|
kernel_classes[i].class_flags,
|
||||||
kernel_classes[i].class_num_classvars,
|
kernel_classes[i].class_ncvars,
|
||||||
HCL_CLASS_SPEC_MAKE(kernel_classes[i].class_spec_named_instvars,
|
HCL_CLASS_SPEC_MAKE(kernel_classes[i].class_spec_nivars,
|
||||||
kernel_classes[i].class_spec_flags,
|
kernel_classes[i].class_spec_flags,
|
||||||
kernel_classes[i].class_spec_indexed_type),
|
kernel_classes[i].class_spec_indexed_type),
|
||||||
kernel_classes[i].class_brand);
|
kernel_classes[i].class_brand);
|
||||||
|
@ -1695,13 +1695,17 @@ struct hcl_t
|
|||||||
* kernel_classes table in gc.c
|
* kernel_classes table in gc.c
|
||||||
* ============================================================= */
|
* ============================================================= */
|
||||||
hcl_oop_class_t c_apex; /* Apex */
|
hcl_oop_class_t c_apex; /* Apex */
|
||||||
hcl_oop_class_t c_undefobj; /* UndefinedObject */
|
|
||||||
hcl_oop_class_t c_class; /* Class */
|
hcl_oop_class_t c_class; /* Class */
|
||||||
|
hcl_oop_class_t c_undefobj; /* UndefinedObject */
|
||||||
|
hcl_oop_class_t c_nilobj; /* NilObject */
|
||||||
#if 0
|
#if 0
|
||||||
hcl_oop_class_t c_interface; /* Interface */
|
hcl_oop_class_t c_interface; /* Interface */
|
||||||
#endif
|
#endif
|
||||||
hcl_oop_class_t c_object; /* Object */
|
hcl_oop_class_t c_object; /* Object */
|
||||||
|
|
||||||
|
hcl_oop_class_t c_collection; /* Collection */
|
||||||
|
hcl_oop_class_t c_indexed_collection; /* IndexedCollection */
|
||||||
|
hcl_oop_class_t c_fixed_sized_collection; /* FixedSizedCollection */
|
||||||
hcl_oop_class_t c_string; /* String */
|
hcl_oop_class_t c_string; /* String */
|
||||||
hcl_oop_class_t c_symbol; /* Symbol */
|
hcl_oop_class_t c_symbol; /* Symbol */
|
||||||
hcl_oop_class_t c_array; /* Array */
|
hcl_oop_class_t c_array; /* Array */
|
||||||
@ -1733,7 +1737,9 @@ struct hcl_t
|
|||||||
hcl_oop_class_t c_error; /* Error */
|
hcl_oop_class_t c_error; /* Error */
|
||||||
hcl_oop_class_t c_true; /* True */
|
hcl_oop_class_t c_true; /* True */
|
||||||
hcl_oop_class_t c_false; /* False */
|
hcl_oop_class_t c_false; /* False */
|
||||||
|
hcl_oop_class_t c_magnitude; /* Magnitude */
|
||||||
hcl_oop_class_t c_character; /* Character */
|
hcl_oop_class_t c_character; /* Character */
|
||||||
|
hcl_oop_class_t c_number; /* Number */
|
||||||
hcl_oop_class_t c_small_integer; /* SmallInteger */
|
hcl_oop_class_t c_small_integer; /* SmallInteger */
|
||||||
|
|
||||||
hcl_oop_class_t c_large_positive_integer; /* LargePositiveInteger */
|
hcl_oop_class_t c_large_positive_integer; /* LargePositiveInteger */
|
||||||
|
Loading…
Reference in New Issue
Block a user