mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-16 16:50:21 +02:00
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.
This commit is contained in:
parent
0eba699d12
commit
67b699cc77
5 changed files with 139 additions and 197 deletions
|
@ -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)));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue