push_spork_code(emit, SPORK_FUNC_PREFIX, exp->self->pos);
if(GET_FLAG(exp->m_func, member))
SET_FLAG(emit->code, member);
- const Instr p = emit_add_instr(emit, RegPushImm);
- p->m_val = (m_uint)exp->m_func->code;
+ if(exp->m_func->code) {
+ const Instr p = emit_add_instr(emit, RegPushImm);
+ p->m_val = (m_uint)exp->m_func->code;
+ } else {
+ const Instr p = emit_add_instr(emit, PushStaticCode);
+ p->m_val = (m_uint)exp->m_func;
+ }
CHECK_BB(emit_exp_call1(emit, exp->m_func))
const VM_Code code = finalyze(emit);
const m_uint size = exp->m_func->def->stack_depth - (GET_FLAG(exp->m_func,
*(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);
+ instr->m_val = (m_uint)((*(VM_Code*)reg = ((Func)instr->m_val)->code));
+ instr->opcode = (m_bit)(m_uint)RegPushImm;
reg += SZ_INT;
DISPATCH()
pushstr: