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

trim our set of vm hooks

* libguile/vm.h (SCM_VM_PUSH_CONTINUATION_HOOK)
  (SCM_VM_POP_CONTINUATION_HOOK): New hooks, to replace
  enter/exit/return.
  (SCM_VM_BOOT_HOOK, SCM_VM_HALT_HOOK, SCM_VM_BREAK_HOOK): Remove these
  useless hooks.

* libguile/vm.c (scm_vm_push_continuation_hook)
  (scm_vm_pop_continuation_hook): New accessors.

* libguile/vm-i-system.c: Remove boot, halt, break, enter, exit, and
  return hooks. Also remove the break instruction. Instead now when we
  push a new continuation onto the stack we call PUSH_CONTINUATION_HOOK,
  and when we pop via a return we call POP_CONTINUATION_HOOK. APPLY_HOOK
  is now decoupled from continuation pushes and pops.

* libguile/vm-engine.h:
* libguile/vm-engine.c: Adapt for hooks.

* module/system/vm/trace.scm (vm-trace): Adapt for hooks. Also revive
  the #:instructions? #t mode.

* module/system/vm/vm.scm: Adapt exports for new set of hooks.
This commit is contained in:
Andy Wingo 2010-09-16 12:14:55 +02:00
parent 7c42238610
commit c45d4d775d
7 changed files with 103 additions and 153 deletions

View file

@ -224,14 +224,14 @@
#define RUN_HOOK1(h, x)
#endif
#define BOOT_HOOK() RUN_HOOK (SCM_VM_BOOT_HOOK)
#define HALT_HOOK() RUN_HOOK (SCM_VM_HALT_HOOK)
#define NEXT_HOOK() RUN_HOOK (SCM_VM_NEXT_HOOK)
#define BREAK_HOOK() RUN_HOOK (SCM_VM_BREAK_HOOK)
#define ENTER_HOOK() RUN_HOOK (SCM_VM_ENTER_HOOK)
#define APPLY_HOOK() RUN_HOOK (SCM_VM_APPLY_HOOK)
#define EXIT_HOOK() RUN_HOOK (SCM_VM_EXIT_HOOK)
#define RETURN_HOOK(n) RUN_HOOK1 (SCM_VM_RETURN_HOOK, SCM_I_MAKINUM (n))
#define APPLY_HOOK() \
RUN_HOOK (SCM_VM_APPLY_HOOK)
#define PUSH_CONTINUATION_HOOK() \
RUN_HOOK (SCM_VM_PUSH_CONTINUATION_HOOK)
#define POP_CONTINUATION_HOOK(n) \
RUN_HOOK1 (SCM_VM_POP_CONTINUATION_HOOK, SCM_I_MAKINUM (n))
#define NEXT_HOOK() \
RUN_HOOK (SCM_VM_NEXT_HOOK)
#define VM_HANDLE_INTERRUPTS \
SCM_ASYNC_TICK_WITH_CODE (SYNC_REGISTER ())