summaryrefslogtreecommitdiff
path: root/libguile/vm.h
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2010-09-16 12:14:55 +0200
committerAndy Wingo <wingo@pobox.com>2010-09-16 12:16:02 +0200
commitc45d4d775d47bd80650e9888bf47815a03b04332 (patch)
tree69f38925f200a57d7ec3d3d487da7b5f51b50a12 /libguile/vm.h
parent7c42238610dbf5780d9aeb12ca799c83f9f6167e (diff)
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.
Diffstat (limited to 'libguile/vm.h')
-rw-r--r--libguile/vm.h26
1 files changed, 10 insertions, 16 deletions
diff --git a/libguile/vm.h b/libguile/vm.h
index 8e22d028c..eff6f1807 100644
--- a/libguile/vm.h
+++ b/libguile/vm.h
@@ -22,15 +22,13 @@
#include <libguile.h>
#include <libguile/programs.h>
-#define SCM_VM_BOOT_HOOK 0
-#define SCM_VM_HALT_HOOK 1
-#define SCM_VM_NEXT_HOOK 2
-#define SCM_VM_BREAK_HOOK 3
-#define SCM_VM_ENTER_HOOK 4
-#define SCM_VM_APPLY_HOOK 5
-#define SCM_VM_EXIT_HOOK 6
-#define SCM_VM_RETURN_HOOK 7
-#define SCM_VM_NUM_HOOKS 8
+enum {
+ SCM_VM_APPLY_HOOK,
+ SCM_VM_PUSH_CONTINUATION_HOOK,
+ SCM_VM_POP_CONTINUATION_HOOK,
+ SCM_VM_NEXT_HOOK,
+ SCM_VM_NUM_HOOKS,
+};
struct scm_vm;
@@ -73,14 +71,10 @@ SCM_API SCM scm_vm_p (SCM obj);
SCM_API SCM scm_vm_ip (SCM vm);
SCM_API SCM scm_vm_sp (SCM vm);
SCM_API SCM scm_vm_fp (SCM vm);
-SCM_API SCM scm_vm_boot_hook (SCM vm);
-SCM_API SCM scm_vm_halt_hook (SCM vm);
-SCM_API SCM scm_vm_next_hook (SCM vm);
-SCM_API SCM scm_vm_break_hook (SCM vm);
-SCM_API SCM scm_vm_enter_hook (SCM vm);
SCM_API SCM scm_vm_apply_hook (SCM vm);
-SCM_API SCM scm_vm_exit_hook (SCM vm);
-SCM_API SCM scm_vm_return_hook (SCM vm);
+SCM_API SCM scm_vm_push_continuation_hook (SCM vm);
+SCM_API SCM scm_vm_pop_continuation_hook (SCM vm);
+SCM_API SCM scm_vm_next_hook (SCM vm);
SCM_API SCM scm_vm_option (SCM vm, SCM key);
SCM_API SCM scm_set_vm_option_x (SCM vm, SCM key, SCM val);
SCM_API SCM scm_vm_trace_level (SCM vm);