1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-15 08:10:17 +02:00

less overhead for handling interrupts in the vm

* libguile/__scm.h (SCM_ASYNC_TICK): Add some branch prediction.
  (SCM_ASYNC_TICK_WITH_CODE): New helper for when BUILDING_LIBGUILE,
  runs code only if we're going to call async_click().
* libguile/vm-engine.h (VM_HANDLE_INTERRUPTS): New helper, uses
  SCM_ASYNC_TICK_WITH_CODE to only save regs if we'll handle an
  interrupt.
* libguile/vm-i-system.c (call, goto/args, return): use
  VM_HANDLE_INTERRUPTS.
This commit is contained in:
Andy Wingo 2009-12-11 11:15:12 +01:00
parent aa3819aa34
commit e8c3777214
3 changed files with 26 additions and 12 deletions

View file

@ -747,8 +747,7 @@ VM_DEFINE_INSTRUCTION (54, call, "call", 1, -1, 1)
vm_call:
x = sp[-nargs];
SYNC_REGISTER ();
SCM_TICK; /* allow interrupt here */
VM_HANDLE_INTERRUPTS;
/*
* Subprogram call
@ -813,8 +812,7 @@ VM_DEFINE_INSTRUCTION (55, goto_args, "goto/args", 1, -1, 1)
vm_goto_args:
x = sp[-nargs];
SYNC_REGISTER ();
SCM_TICK; /* allow interrupt here */
VM_HANDLE_INTERRUPTS;
/*
* Tail call
@ -1085,8 +1083,9 @@ VM_DEFINE_INSTRUCTION (63, return, "return", 0, 1, 1)
vm_return:
EXIT_HOOK ();
RETURN_HOOK ();
SYNC_REGISTER ();
SCM_TICK; /* allow interrupt here */
VM_HANDLE_INTERRUPTS;
{
SCM ret;