mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-12 06:41:13 +02:00
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.
This commit is contained in:
parent
64d114817a
commit
9c8c4060dd
2 changed files with 15 additions and 20 deletions
|
@ -272,7 +272,7 @@
|
||||||
((uintptr_t) (ptr) % alignof_type (type) == 0)
|
((uintptr_t) (ptr) % alignof_type (type) == 0)
|
||||||
|
|
||||||
static SCM
|
static SCM
|
||||||
VM_NAME (scm_thread *thread, int resume)
|
VM_NAME (scm_thread *thread)
|
||||||
{
|
{
|
||||||
/* Instruction pointer: A pointer to the opcode that is currently
|
/* Instruction pointer: A pointer to the opcode that is currently
|
||||||
running. */
|
running. */
|
||||||
|
@ -303,23 +303,7 @@ VM_NAME (scm_thread *thread, int resume)
|
||||||
/* Load VM registers. */
|
/* Load VM registers. */
|
||||||
CACHE_REGISTER ();
|
CACHE_REGISTER ();
|
||||||
|
|
||||||
/* Usually a call to the VM happens on application, with the boot
|
/* Start processing! */
|
||||||
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 ();
|
|
||||||
|
|
||||||
NEXT (0);
|
NEXT (0);
|
||||||
|
|
||||||
BEGIN_DISPATCH_SWITCH;
|
BEGIN_DISPATCH_SWITCH;
|
||||||
|
|
|
@ -464,7 +464,7 @@ scm_i_call_with_current_continuation (SCM proc)
|
||||||
#undef VM_USE_HOOKS
|
#undef VM_USE_HOOKS
|
||||||
#undef VM_NAME
|
#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] =
|
static const scm_t_vm_engine vm_engines[SCM_VM_NUM_ENGINES] =
|
||||||
{ vm_regular_engine, vm_debug_engine };
|
{ vm_regular_engine, vm_debug_engine };
|
||||||
|
@ -1420,9 +1420,20 @@ scm_call_n (SCM proc, SCM *argv, size_t nargs)
|
||||||
/* Non-local return. */
|
/* Non-local return. */
|
||||||
vm_dispatch_abort_hook (vp);
|
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;
|
thread->vm.registers = ®isters;
|
||||||
ret = vm_engines[vp->engine](thread, resume);
|
ret = vm_engines[vp->engine](thread);
|
||||||
thread->vm.registers = prev_registers;
|
thread->vm.registers = prev_registers;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue