diff options
Diffstat (limited to 'vm.c')
-rw-r--r-- | vm.c | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -262,7 +262,7 @@ INLINE void vm_set(struct vm_env *dspl, unsigned ref, val newval) mut(env->vec); } -static void vm_frame(struct vm *vm, vm_word_t insn) +static void vm_do_frame(struct vm *vm, vm_word_t insn, int capturable) { int lev = vm_insn_extra(insn); int size = vm_insn_operand(insn); @@ -272,11 +272,21 @@ static void vm_frame(struct vm *vm, vm_word_t insn) vm->lev = lev; vm->dspl[lev].mem = coerce(val *, zalloca(size * sizeof (val *))); - vm->dspl[lev].vec = num_fast(size); + vm->dspl[lev].vec = (capturable ? num_fast(size) : 0); vm_execute(vm); vm->lev = lev - 1; } +static void vm_frame(struct vm *vm, vm_word_t insn) +{ + vm_do_frame(vm, insn, 1); +} + +static void vm_sframe(struct vm *vm, vm_word_t insn) +{ + vm_do_frame(vm, insn, 0); +} + static void vm_dframe(struct vm *vm, vm_word_t insn) { val saved_dyn_env = dyn_env; @@ -610,6 +620,9 @@ static val vm_execute(struct vm *vm) case FRAME: vm_frame(vm, insn); break; + case SFRAME: + vm_sframe(vm, insn); + break; case DFRAME: vm_dframe(vm, insn); break; |