eGcIni,
eGcAdd,
eGcEnd,
+ eGackType,
eGackEnd,
eGack,
eNoOp,
#define GcIni (f_instr)eGcIni
#define GcAdd (f_instr)eGcAdd
#define GcEnd (f_instr)eGcEnd
+#define GackType (f_instr)eGackType
#define GackEnd (f_instr)eGackEnd
#define Gack (f_instr)eGack
#define NoOp (f_instr)eNoOp
GcIni
GcAdd
GcEnd
+GackType
GackEnd
Gack
NoOp
e->next = next;
return GW_ERROR;
}
+ regseti(emit, (m_uint)e->type);
+ if(isa(e->type, emit->gwion->type[et_object]) > 0 && !GET_FLAG(e->type, force)) {
+ emit_add_instr(emit, GackType);
+ }
const Instr instr = emit_add_instr(emit, Gack);
- instr->m_val = (m_uint)e->type;
- instr->m_val2 = emit_code_offset(emit);
+ if(isa(e->type, emit->gwion->type[et_object]) > 0 && !GET_FLAG(e->type, force))
+ emit_add_instr(emit, GackType);
+ instr->m_val = emit_code_offset(emit);
} while((e = e->next = next));
return GW_OK;
}
}
ANN void gack(const VM_Shred shred, const Instr instr) {
- Type t = (Type)instr->m_val;
- if(isa(t, shred->info->vm->gwion->type[et_object]) > 0 && !GET_FLAG(t, force)) {
- const M_Object o = *(M_Object*)(shred->reg - SZ_INT);
- if(o)
- t = o->type_ref;
- }
+ const Type t = *(Type*)shred->reg;
const VM_Code code = get_gack(t);
if(GET_FLAG(code, builtin)) {
((f_gack)code->native_func)(t, (shred->reg - t->size), shred);
&&staticint, &&staticfloat, &&staticother,
&&dotfunc, &&dotstaticfunc, &&pushstaticcode,
&&gcini, &&gcadd, &&gcend,
- &&gackend, &&gack, &&noop, &®pushimm, &&other, &&eoc
+ &&gacktype, &&gackend, &&gack, &&noop, &®pushimm, &&other, &&eoc
};
const Shreduler s = vm->shreduler;
register VM_Shred shred;
while((a.obj = (M_Object)vector_pop(&shred->gc)))
_release(a.obj, shred);
DISPATCH()
+gacktype:
+{
+ const M_Object o = *(M_Object*)(reg - SZ_INT);
+ if(o)
+ *(Type*)reg = o->type_ref;
+ DISPATCH()
+}
gackend:
{
m_str str = *(m_str*)(reg - SZ_INT);