typedef struct {
int argc;
char** argv;
- m_uint quit;
struct Vector_ add;
struct Vector_ rem;
struct Vector_ lib;
Vector ref;
m_bool loop;
+ unsigned quit : 1;
} Arg;
ANN void arg_init(Arg* arg);
M_Object* data;
union {
m_int* idx; // for object array
- m_uint length; // array init
+ size_t length; // array init
} d;
- unsigned is_ref;
- unsigned is_obj;
+ unsigned is_ref : 1;
+ unsigned is_obj : 1;
} ArrayInfo;
ANN m_uint m_vector_size(const M_Vector v);
#define EMIT_H
typedef struct Frame_ {
- m_uint curr_offset;
+ size_t curr_offset;
struct Vector_ stack;
} Frame;
typedef struct Code_ {
m_str name;
- m_uint stack_depth;
+ size_t stack_depth;
struct Vector_ instr;
struct Vector_ stack_cont, stack_break, stack_return;
Frame* frame;
#define NSPC(a) { nspc_push_value(env->curr); SCOPE(a); nspc_pop_value(env->curr); }
struct Switch_ {
- m_uint default_case_index;
struct Vector_ exp;
Vector vec;
Map cases;
+ size_t default_case_index;
};
typedef struct Env_ * Env;
m_str name;
Nspc curr;
Nspc global_nspc;
- m_uint scope;
struct Context_ *context;
Type class_def;
Func func;
- m_uint type_xid;
struct Gwion_ *gwion;
struct Vector_ nspc_stack;
struct Vector_ class_stack;
struct Vector_ conts;
struct Vector_ known_ctx;
struct Switch_* sw;
+ size_t scope;
+ size_t type_xid;
};
ANEW Env new_env();
struct VM_Code_* code;
Value value_ref;
Func next;
- m_uint vt_index;
struct Instr_* variadic;
+ size_t vt_index;
ae_flag flag;
HAS_OBJ
};
struct Var_Decl_List_ list;
struct Var_Decl_ var;
struct Exp_ exp;
- m_uint array_depth;
+ size_t array_depth;
} DL_Var;
typedef struct {
m_str name;
m_str type;
f_xfun addr;
- m_uint narg;
DL_Value args[DLARG_MAX];
+ uint narg;
} DL_Func;
typedef struct {
} DL_Oper;
typedef struct {
- m_uint n;
m_str* list;
+ size_t n;
} Templater;
typedef struct {
#define __NSPC
struct Nspc_ {
m_str name;
- m_uint offset;
Nspc parent;
struct VM_Code_* pre_ctor;
struct VM_Code_* dtor;
m_bit* class_data;
- m_uint class_data_size;
struct Vector_ vtable;
struct Map_ op_map;
struct Scope_ value;
struct Scope_ type;
struct Scope_ func;
+ size_t offset;
+ size_t class_data_size;
HAS_OBJ
};
typedef struct M_Object_ * M_Object;
struct M_Object_ {
m_bit* data;
- m_uint ref;
Type type_ref;
struct pool* p;
+ size_t ref;
};
ANN void instantiate_object(const VM_Shred, const Type);
} e_obj;
struct VM_Object_ {
- m_uint ref_count;
+ size_t ref_count;
e_obj type;
} __attribute__((packed));
VM* vm;
VM_Shred list;
VM_Shred curr;
- m_uint shred_ids;
struct Vector_ shreds;
+ size_t shred_ids;
m_bool loop;
};
#endif
#define __TYPE
struct Type_ {
- m_uint xid;
- m_uint size;
m_str name;
Nspc nspc;
Type parent;
Nspc owner;
- m_uint array_depth;
Class_Def def;
union type_data {
Func func;
Type base_type;
} d;
struct pool* p;
+ size_t xid;
+ size_t size;
+ size_t array_depth;
ae_flag flag;
HAS_OBJ
};
m_str name;
Nspc owner;
Type owner_class;
- m_uint offset;
union value_data{
m_uint* ptr;
Func func_ref;
} d;
struct Gwion_ *gwion;
+ size_t offset;
ae_flag flag;
HAS_OBJ
};
struct VM_Code_ {
Vector instr;
m_str name;
- m_uint stack_depth;
m_uint native_func;
void* memoize;
+ size_t stack_depth;
ae_flag flag;
HAS_OBJ
};
m_bit* mem;
m_bit* _reg;
m_bit* base;
- m_uint pc, xid;
m_str name;
VM* vm;
VM_Shred prev, next;
struct M_Object_* me;
struct Vector_ child;
struct Vector_ gc;//, gc1;
+ size_t pc, xid;
m_float wake_time;
};
ANN2(4) ANEW VM_Code new_vm_code(const Vector instr, const m_uint stack_depth, const m_bool need_this, const m_str name);