diff options
author | Andy Wingo <wingo@pobox.com> | 2012-05-10 12:43:33 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2012-05-10 12:59:45 +0200 |
commit | 67b699cc77d5e2f74daca77aa26b1ba8af0d0808 (patch) | |
tree | 42dd52d6cad54d3c5acf63796bf17ffc87ad6bca /libguile/frames.c | |
parent | 0eba699d12f638c624efcdc2b617b0aa9099ee1f (diff) | |
download | guile-67b699cc77d5e2f74daca77aa26b1ba8af0d0808.tar.gz |
refactor vm application of non-programs; boot continuation refactor
* libguile/frames.c (scm_frame_instruction_pointer):
* module/system/vm/frame.scm (frame-bindings):
(frame-next-source, frame-call-representation): Fix a few locations
that thought that the frame-procedure will always be a VM
procedure. This will not not be the case when traversing the stack of
an application of a non-procedure.
* libguile/vm-i-system.c (call, tail-call, mv-call): Instead of
special-casing structs and smobs at these call sites, just set up the
stack, and jump to a generic apply loop if the proc is not a program.
* libguile/vm-engine.c: The generic apply loop is here. Also, the boot
program is now simply a boot continuation, and can handle any number
of arguments.
* libguile/vm.c (make_boot_program): Update the code that makes the boot
continuation.
Diffstat (limited to 'libguile/frames.c')
-rw-r--r-- | libguile/frames.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libguile/frames.c b/libguile/frames.c index c7505b262..45f1c8d92 100644 --- a/libguile/frames.c +++ b/libguile/frames.c @@ -237,11 +237,16 @@ SCM_DEFINE (scm_frame_instruction_pointer, "frame-instruction-pointer", 1, 0, 0, "") #define FUNC_NAME s_scm_frame_instruction_pointer { + SCM program; const struct scm_objcode *c_objcode; SCM_VALIDATE_VM_FRAME (1, frame); + program = scm_frame_procedure (frame); - c_objcode = SCM_PROGRAM_DATA (scm_frame_procedure (frame)); + if (!SCM_PROGRAM_P (program)) + return SCM_INUM0; + + c_objcode = SCM_PROGRAM_DATA (program); return scm_from_unsigned_integer ((SCM_VM_FRAME_IP (frame) - SCM_C_OBJCODE_BASE (c_objcode))); } |