__attribute__((hot));
__attribute__((hot)) ANN static inline void
vm_shred_exit(const VM_Shred shred) {
- shreduler_remove(shred->info->vm->shreduler, shred, true);
+ shreduler_remove(shred->tick->shreduler, shred, true);
}
void free_vm_shred(const VM_Shred shred) __attribute__((hot, nonnull));
ANN static m_bool emit_class_def(const Emitter emit, const Class_Def cdef) {
if (tmpl_base(cdef->base.tmpl)) return GW_OK;
const Type t = cdef->base.type;
+ const Class_Def c = t->info->cdef;
if (tflag(t, tflag_emit)) return GW_OK;
set_tflag(t, tflag_emit);
const Type owner = t->info->value->from->owner_class;
if (owner) CHECK_BB(ensure_emit(emit, owner));
- if (cdef->base.ext && t->info->parent->info->cdef &&
+ if (c->base.ext && t->info->parent->info->cdef &&
!tflag(t->info->parent, tflag_emit)) // ?????
- CHECK_BB(cdef_parent(emit, cdef));
+ CHECK_BB(cdef_parent(emit, c));
nspc_allocdata(emit->gwion->mp, t->nspc);
- if (cdef->body) {
+ if (c->body) {
emit_class_code(emit, t->name);
- if (scanx_body(emit->env, cdef, (_exp_func)emit_section, emit) > 0)
+ if (scanx_body(emit->env, c, (_exp_func)emit_section, emit) > 0)
t->nspc->pre_ctor = finalyze(emit, FuncReturn);
else {
free_code(emit->gwion->mp, emit->code);
ANN m_bool check_class_def(const Env env, const Class_Def cdef) {
if (tmpl_base(cdef->base.tmpl)) return GW_OK;
const Type t = cdef->base.type;
+ const Class_Def c = t->info->cdef;
struct Op_Import opi = {.op = insert_symbol("@class_check"),
.lhs = t,
- .data = (uintptr_t)cdef,
- .pos = cdef->pos};
+ .data = (uintptr_t)c,
+ .pos = c->pos};
CHECK_OB(op_check(env, &opi));
if (t->info->value->from->owner_class)
CHECK_BB(ensure_check(env, t->info->value->from->owner_class));
if (tflag(t, tflag_check)) return GW_OK;
set_tflag(t, tflag_check);
- return _check_class_def(env, cdef);
+ return _check_class_def(env, c);
}
ANN static inline void check_unhandled(const Env env) {
ANN m_bool scan1_class_def(const Env env, const Class_Def cdef) {
if (tmpl_base(cdef->base.tmpl)) return GW_OK;
const Type t = cdef->base.type;
+ const Class_Def c = t->info->cdef;
if (tflag(t, tflag_scan1)) return GW_OK;
set_tflag(t, tflag_scan1);
if (t->info->value->from->owner_class)
CHECK_BB(ensure_scan1(env, t->info->value->from->owner_class));
- if (cdef->base.ext) CHECK_BB(cdef_parent(env, cdef));
- if (cdef->body) CHECK_BB(env_body(env, cdef, scan1_section));
+ if (c->base.ext) CHECK_BB(cdef_parent(env, c));
+ if (c->body) CHECK_BB(env_body(env, c, scan1_section));
return GW_OK;
}
ANN m_bool scan2_class_def(const Env env, const Class_Def cdef) {
if (tmpl_base(cdef->base.tmpl)) return GW_OK;
const Type t = cdef->base.type;
+ const Class_Def c = t->info->cdef;
if (tflag(t, tflag_scan2)) return GW_OK;
if (t->info->value->from->owner_class)
CHECK_BB(ensure_scan2(env, t->info->value->from->owner_class));
set_tflag(t, tflag_scan2);
- if (cdef->base.ext) CHECK_BB(cdef_parent(env, cdef));
- if (cdef->body) CHECK_BB(env_body(env, cdef, scan2_section));
+ if (c->base.ext) CHECK_BB(cdef_parent(env, c));
+ if (c->body) CHECK_BB(env_body(env, c, scan2_section));
return GW_OK;
}