diff options
author | Andy Wingo <wingo@pobox.com> | 2018-06-27 18:57:37 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2018-06-27 18:57:37 +0200 |
commit | 9c8c4060dd61fd9eb1296a17f6496a1fe2537494 (patch) | |
tree | ecd3fcbc45facf43123a950c09757e9f504a4d17 /libguile/vm.c | |
parent | 64d114817ac080029641792db3e199f614ad5e6d (diff) | |
download | guile-9c8c4060dd61fd9eb1296a17f6496a1fe2537494.tar.gz |
Remove "resume" arg from vm engine
* libguile/vm-engine.c (vm_engine): Remove "resume" argument; scm_call_n
will handle the differences.
* libguile/vm.c (scm_call_n): Inline handling of what to do in normal
and resume cases. Remove resume argument to vm_engine.
Diffstat (limited to 'libguile/vm.c')
-rw-r--r-- | libguile/vm.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/libguile/vm.c b/libguile/vm.c index ef423b0db..e28f3f660 100644 --- a/libguile/vm.c +++ b/libguile/vm.c @@ -464,7 +464,7 @@ scm_i_call_with_current_continuation (SCM proc) #undef VM_USE_HOOKS #undef VM_NAME -typedef SCM (*scm_t_vm_engine) (scm_thread *current_thread, int resume); +typedef SCM (*scm_t_vm_engine) (scm_thread *current_thread); static const scm_t_vm_engine vm_engines[SCM_VM_NUM_ENGINES] = { vm_regular_engine, vm_debug_engine }; @@ -1420,9 +1420,20 @@ scm_call_n (SCM proc, SCM *argv, size_t nargs) /* Non-local return. */ vm_dispatch_abort_hook (vp); } + else + { + if (SCM_LIKELY (SCM_PROGRAM_P (proc))) + vp->ip = SCM_PROGRAM_CODE (proc); + else + /* FIXME: Make this return an IP. */ + apply_non_program (thread); + + if (vp->engine == SCM_VM_DEBUG_ENGINE && vp->trace_level > 0) + vm_dispatch_apply_hook (vp); + } thread->vm.registers = ®isters; - ret = vm_engines[vp->engine](thread, resume); + ret = vm_engines[vp->engine](thread); thread->vm.registers = prev_registers; return ret; |