trampoline_iseq is no longer mutable
This commit is contained in:
parent
711b53eb72
commit
fa179dc152
11
src/vm.c
11
src/vm.c
|
@ -994,14 +994,11 @@ pic_apply(pic_state *pic, struct pic_proc *proc, pic_value argv)
|
||||||
} VM_LOOP_END;
|
} VM_LOOP_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
static pic_code trampoline_iseq[] = {
|
|
||||||
{ OP_NOP, {0} },
|
|
||||||
{ OP_TAILCALL, {0} },
|
|
||||||
};
|
|
||||||
|
|
||||||
pic_value
|
pic_value
|
||||||
pic_apply_trampoline(pic_state *pic, struct pic_proc *proc, pic_value args)
|
pic_apply_trampoline(pic_state *pic, struct pic_proc *proc, pic_value args)
|
||||||
{
|
{
|
||||||
|
static const pic_code iseq[] = { { OP_NOP, {0} }, { OP_TAILCALL, { .i = -1 } } };
|
||||||
|
|
||||||
pic_value v, *sp;
|
pic_value v, *sp;
|
||||||
pic_callinfo *ci;
|
pic_callinfo *ci;
|
||||||
|
|
||||||
|
@ -1012,10 +1009,8 @@ pic_apply_trampoline(pic_state *pic, struct pic_proc *proc, pic_value args)
|
||||||
*sp++ = v;
|
*sp++ = v;
|
||||||
}
|
}
|
||||||
|
|
||||||
trampoline_iseq[1].u.i = -1;
|
|
||||||
|
|
||||||
ci = PUSHCI();
|
ci = PUSHCI();
|
||||||
ci->ip = trampoline_iseq;
|
ci->ip = (pic_code *)iseq;
|
||||||
ci->fp = pic->sp;
|
ci->fp = pic->sp;
|
||||||
ci->retc = pic_length(pic, args);
|
ci->retc = pic_length(pic, args);
|
||||||
return pic_obj_value(proc);
|
return pic_obj_value(proc);
|
||||||
|
|
Loading…
Reference in New Issue