mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-14 23:50:19 +02:00
Remove push continuation hook; return hook runs before FP pop
* libguile/frames.c (scm_frame_return_values): New function, for use when a frame is at "return-values". (scm_init_frames_builtins): Register frame-return-values. * libguile/vm-engine.c (RETURN_HOOK): Rename from POP_CONTINUATION_HOOK. (call, call-label): Remove PUSH_CONTINUATION_HOOK; it's unneeded, as you can always check the FP from an apply hook. (return-values): Run return hook before popping frame. * libguile/vm.c (vm_dispatch_return_hook): Rename from vm_dispatch_pop_continuation_hook. Remove push continuation hook. (scm_vm_return_hook): * libguile/vm.h (SCM_VM_PUSH_CONTINUATION_HOOK): Remove. (SCM_VM_RETURN_HOOK): Rename from SCM_VM_POP_CONTINUATION_HOOK. * module/system/vm/frame.scm (frame-return-values): Export. * module/system/vm/trace.scm (print-return, trace-calls-to-procedure) (trace-calls-in-procedure): Adapt to not receiving values as arguments. * module/system/vm/traps.scm (trap-in-procedure, trap-frame-finish): Adapt to return hook coming from returning frame. (program-sources-by-line): Update to use match instead of pmatch. * module/system/vm/traps.scm (trap-in-dynamic-extent) (trap-calls-to-procedure): Adapt to return hook not receiving values. * module/system/vm/vm.scm: Remove push continuation hook and rename return hook.
This commit is contained in:
parent
dedf73d370
commit
f4c50447dd
8 changed files with 132 additions and 110 deletions
|
@ -126,8 +126,7 @@
|
|||
#define RUN_HOOK1(h, arg) RUN_HOOK (vm_dispatch_##h##_hook (thread, arg))
|
||||
|
||||
#define APPLY_HOOK() RUN_HOOK0 (apply)
|
||||
#define PUSH_CONTINUATION_HOOK() RUN_HOOK0 (push_continuation)
|
||||
#define POP_CONTINUATION_HOOK(old_fp) RUN_HOOK1 (pop_continuation, old_fp)
|
||||
#define RETURN_HOOK() RUN_HOOK0 (return)
|
||||
#define NEXT_HOOK() RUN_HOOK0 (next)
|
||||
#define ABORT_CONTINUATION_HOOK() RUN_HOOK0 (abort)
|
||||
|
||||
|
@ -367,8 +366,6 @@ VM_NAME (scm_thread *thread)
|
|||
UNPACK_24 (op, proc);
|
||||
UNPACK_24 (ip[1], nlocals);
|
||||
|
||||
PUSH_CONTINUATION_HOOK ();
|
||||
|
||||
old_fp = VP->fp;
|
||||
VP->fp = SCM_FRAME_SLOT (old_fp, proc - 1);
|
||||
SCM_FRAME_SET_DYNAMIC_LINK (VP->fp, old_fp);
|
||||
|
@ -409,8 +406,6 @@ VM_NAME (scm_thread *thread)
|
|||
UNPACK_24 (ip[1], nlocals);
|
||||
label = ip[2];
|
||||
|
||||
PUSH_CONTINUATION_HOOK ();
|
||||
|
||||
old_fp = VP->fp;
|
||||
VP->fp = SCM_FRAME_SLOT (old_fp, proc - 1);
|
||||
SCM_FRAME_SET_DYNAMIC_LINK (VP->fp, old_fp);
|
||||
|
@ -569,6 +564,8 @@ VM_NAME (scm_thread *thread)
|
|||
union scm_vm_stack_element *old_fp;
|
||||
size_t frame_size = 3;
|
||||
|
||||
RETURN_HOOK ();
|
||||
|
||||
old_fp = VP->fp;
|
||||
ip = SCM_FRAME_VIRTUAL_RETURN_ADDRESS (VP->fp);
|
||||
VP->fp = SCM_FRAME_DYNAMIC_LINK (VP->fp);
|
||||
|
@ -577,8 +574,6 @@ VM_NAME (scm_thread *thread)
|
|||
while (frame_size--)
|
||||
old_fp[frame_size].as_scm = SCM_BOOL_F;
|
||||
|
||||
POP_CONTINUATION_HOOK (old_fp);
|
||||
|
||||
NEXT (0);
|
||||
}
|
||||
|
||||
|
@ -3014,8 +3009,7 @@ VM_NAME (scm_thread *thread)
|
|||
#undef SP_SET
|
||||
#undef NEXT
|
||||
#undef NEXT_HOOK
|
||||
#undef POP_CONTINUATION_HOOK
|
||||
#undef PUSH_CONTINUATION_HOOK
|
||||
#undef RETURN_HOOK
|
||||
#undef RUN_HOOK
|
||||
#undef RUN_HOOK0
|
||||
#undef RUN_HOOK1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue