const m_uint depth = f->def->stack_depth;
regpop(emit, depth -SZ_INT);
const Instr spork = emit_add_instr(emit, SporkMemberFptr);
- spork->m_val = depth + SZ_INT;
- spork->m_val2 = -SZ_INT*2;
+ spork->m_val = depth;
} else
emit_exp_spork_finish(emit, f->def->stack_depth);
const Instr end = emit_add_instr(emit, is_spork ? SporkEnd : ForkEnd);
static MFUN(shred_yield) {
const VM_Shred s = ME(o);
const Shreduler sh = s->tick->shreduler;
- if(vector_size(shred->code->instr) - shred->pc > 1)
- shredule(sh, s, GWION_EPSILON);
- else
- vm_shred_exit(shred);
+ shredule(sh, s, GWION_EPSILON);
}
static SFUN(vm_shred_from_id) {
GWI_BB(gwi_union_add(gwi, "Vec4", "w"))
GWI_BB(gwi_union_add(gwi, "VarObject", "o"))
GWI_OB(gwi_union_end(gwi, ae_flag_const))
- gwi_func_ini(gwi, "int", "join");
+ gwi_func_ini(gwi, "void", "join");
GWI_BB(gwi_func_end(gwi, fork_join, ae_flag_none))
GWI_BB(gwi_class_end(gwi))
SET_FLAG((t_fork), abstract);
DISPATCH()
PRAGMA_POP()
sporkmemberfptr:
- for(m_uint i = 0; i < VAL-SZ_INT; i+= SZ_INT)
- *(m_uint*)(a.child->reg + i) = *(m_uint*)(reg + i + (m_int)VAL2+SZ_INT);
- *(m_uint*)(a.child->reg+VAL-SZ_INT) = *(m_uint*)(reg+SZ_INT);
- *(m_uint*)(a.child->reg+VAL-SZ_INT*2) = *(m_uint*)(reg-SZ_INT*2);
- a.child->reg += VAL;
+ for(m_uint i = 0; i < VAL; i+= SZ_INT)
+ *(m_uint*)(a.child->reg + i) = *(m_uint*)(reg - VAL + i);
+ *(m_uint*)(a.child->reg + VAL) = *(m_uint*)(reg - SZ_INT*2);
+ *(m_uint*)(a.child->reg + VAL + SZ_INT) = *(m_uint*)(reg + VAL - SZ_INT*2);
+ a.child->reg += VAL + SZ_INT*2;
DISPATCH()
sporkexp:
// LOOP_OPTIM