directly change pic->sp via PUSH/POP macros

This commit is contained in:
Yuichi Nishiwaki 2013-10-15 19:15:51 +09:00
parent 266e6c6400
commit e5ada35d9d
1 changed files with 2 additions and 4 deletions

View File

@ -198,18 +198,16 @@ pic_codegen(pic_state *pic, pic_value obj, struct pic_env *env)
#define JUMP break #define JUMP break
#define VM_LOOP_END } } #define VM_LOOP_END } }
#define PUSH(v) (*++sp = (v)) #define PUSH(v) do { pic_value v__ = (v); *++pic->sp = v__; } while (0)
#define POP() (*sp--) #define POP() (*pic->sp--)
pic_value pic_value
pic_run(pic_state *pic, struct pic_proc *proc, pic_value args) pic_run(pic_state *pic, struct pic_proc *proc, pic_value args)
{ {
struct pic_code *pc; struct pic_code *pc;
pic_value *sp;
int ai = pic_gc_arena_preserve(pic); int ai = pic_gc_arena_preserve(pic);
pc = proc->u.irep->code; pc = proc->u.irep->code;
sp = pic->sp;
VM_LOOP { VM_LOOP {
CASE(OP_PUSHNIL) { CASE(OP_PUSHNIL) {