trampoline_iseq is no longer mutable

This commit is contained in:
Yuichi Nishiwaki 2014-06-23 00:54:11 +09:00
parent 711b53eb72
commit fa179dc152
1 changed files with 3 additions and 8 deletions

View File

@ -994,14 +994,11 @@ pic_apply(pic_state *pic, struct pic_proc *proc, pic_value argv)
} VM_LOOP_END;
}
static pic_code trampoline_iseq[] = {
{ OP_NOP, {0} },
{ OP_TAILCALL, {0} },
};
pic_value
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_callinfo *ci;
@ -1012,10 +1009,8 @@ pic_apply_trampoline(pic_state *pic, struct pic_proc *proc, pic_value args)
*sp++ = v;
}
trampoline_iseq[1].u.i = -1;
ci = PUSHCI();
ci->ip = trampoline_iseq;
ci->ip = (pic_code *)iseq;
ci->fp = pic->sp;
ci->retc = pic_length(pic, args);
return pic_obj_value(proc);