mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-14 23:50:19 +02:00
make catch cache and restore vm regs, not the vm itself -- speedy speedy
* libguile/throw.c (scm_c_catch): Stash away the current vm's regs, and restore them if there's a nonlocal exit. There is a terrible case we have to handle if we catch from when the vm smob type isn't registered but the throw has the vm registered, but I think we handle this fine. * libguile/vm-engine.c (vm_run): * libguile/vm-i-system.c (halt): Don't make a dynwind context, so that entering the VM doesn't cons at all, except for the arg list. Maybe we can fix that bit too. * libguile/vm.c (vm_reset_stack): Remove, as there is no more dynwind. (make_vm): Return #f if the tc16 hasn't yet been registered.
This commit is contained in:
parent
f775e51bce
commit
747a163532
4 changed files with 39 additions and 35 deletions
|
@ -72,7 +72,6 @@ vm_run (SCM vm, SCM program, SCM args)
|
|||
#if VM_USE_HOOKS
|
||||
SCM hook_args = SCM_LIST1 (vm);
|
||||
#endif
|
||||
struct vm_unwind_data wind_data;
|
||||
|
||||
#ifdef HAVE_LABELS_AS_VALUES
|
||||
static void **jump_table = NULL;
|
||||
|
@ -92,19 +91,6 @@ vm_run (SCM vm, SCM program, SCM args)
|
|||
}
|
||||
#endif
|
||||
|
||||
/* dynwind ended in the halt instruction */
|
||||
scm_dynwind_begin (SCM_F_DYNWIND_REWINDABLE);
|
||||
wind_data.vp = vp;
|
||||
wind_data.sp = vp->sp;
|
||||
wind_data.fp = vp->fp;
|
||||
scm_dynwind_unwind_handler (vm_reset_stack, &wind_data, 0);
|
||||
|
||||
/* could do this if we reified all vm stacks -- for now, don't bother changing
|
||||
*the-vm*
|
||||
if (scm_fluid_ref (scm_the_vm_fluid) != vm)
|
||||
scm_dynwind_fluid (scm_the_vm_fluid, vm);
|
||||
*/
|
||||
|
||||
/* Initialization */
|
||||
{
|
||||
SCM prog = program;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue