DotStatic2,
DotStatic3,
DotFunc,
+ DotStaticFunc,
PushStaticCode,
RegPushStr,
GcIni,
#define DotStatic2 (f_instr)DotStatic2
#define DotStatic3 (f_instr)DotStatic3
#define DotFunc (f_instr)DotFunc
+#define DotStaticFunc (f_instr)DotStaticFunc
#define PushStaticCode (f_instr)PushStaticCode
#define RegPushStr (f_instr)RegPushStr
#define GcIni (f_instr)GcIni
push_func_code(emit, f);
else {
const Instr back = (Instr)vector_back(&emit->code->instr);
- if((f_instr)(m_uint)back->opcode == DotFunc)
+ if((f_instr)(m_uint)back->opcode == DotFunc || (f_instr)(m_uint)back->opcode == DotStaticFunc)
back->m_val = f->vt_index;
}
if(GET_FLAG(f, member) && isa(actual_type(f->value_ref->type), t_fptr) > 0) {
return GW_OK;
}
if(!func->def->tmpl) {
- const Instr func_i = emit_add_instr(emit, DotFunc);
+ const Instr func_i = emit_add_instr(emit, GET_FLAG(func, member) ? DotFunc : DotStaticFunc);
func_i->m_val = func->vt_index;
return GW_OK;
}
&&addref, &&assign, &&remref,
&&except, &&allocmemberaddr, &&dotmember, &&dotfloat, &&dotother, &&dotaddr,
&&staticint, &&staticfloat, &&staticother,
- &&dotfunc,&&staticcode, &&pushstr,
+ &&dotfunc, &&dotstaticfunc, &&staticcode, &&pushstr,
&&gcini, &&gcadd, &&gcend,
&&gack, &&other
};
DISPATCH()
dotfunc:
assert(a.obj);
- *(VM_Code*)(reg) = ((Func)vector_at(a.obj->vtable, instr->m_val))->code;
reg += SZ_INT;
+dotstaticfunc:
+ *(VM_Code*)(reg-SZ_INT) = ((Func)vector_at(a.obj->vtable, instr->m_val))->code;
DISPATCH()
staticcode:
(*(VM_Code*)reg = ((Func)instr->m_val)->code);