diff options
-rw-r--r-- | libguile/vm-engine.c | 20 | ||||
-rw-r--r-- | libguile/vm.c | 15 |
2 files changed, 15 insertions, 20 deletions
diff --git a/libguile/vm-engine.c b/libguile/vm-engine.c index 2409af98d..9e0e0ef2d 100644 --- a/libguile/vm-engine.c +++ b/libguile/vm-engine.c @@ -272,7 +272,7 @@ ((uintptr_t) (ptr) % alignof_type (type) == 0) static SCM -VM_NAME (scm_thread *thread, int resume) +VM_NAME (scm_thread *thread) { /* Instruction pointer: A pointer to the opcode that is currently running. */ @@ -303,23 +303,7 @@ VM_NAME (scm_thread *thread, int resume) /* Load VM registers. */ CACHE_REGISTER (); - /* Usually a call to the VM happens on application, with the boot - continuation on the next frame. Sometimes it happens after a - non-local exit however; in that case the VM state is all set up, - and we have but to jump to the next opcode. */ - if (SCM_UNLIKELY (resume)) - NEXT (0); - - if (SCM_LIKELY (SCM_PROGRAM_P (FP_REF (0)))) - ip = SCM_PROGRAM_CODE (FP_REF (0)); - else - { - CALL_INTRINSIC (apply_non_program, (thread)); - CACHE_REGISTER (); - } - - APPLY_HOOK (); - + /* Start processing! */ NEXT (0); BEGIN_DISPATCH_SWITCH; 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; |