diff options
author | Andy Wingo <wingo@pobox.com> | 2013-05-23 14:52:29 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2013-05-23 15:23:16 +0200 |
commit | 083ea264cbeec5367a7cc584db43dc4757593f90 (patch) | |
tree | d08e0ec9a8bed0fa99bfb7e3aae54429d5639824 /libguile/frames.c | |
parent | 6ea7e853008cfbf4fba1cb270532c306792e632c (diff) | |
download | guile-wip-rtl-vm.tar.gz |
add new rtl vmwip-rtl-vm
* libguile/vm-engine.c (rtl_vm_engine): Add new VM.
(vm_engine): Add support for calling RTL programs.
* libguile/tags.h (scm_tc7_rtl_program): New type for procedures that
run on the new VM.
* libguile/evalext.c (scm_self_evaluating_p):
* libguile/goops.c (scm_class_of):
* libguile/print.c (iprin1):
* libguile/procprop.c (scm_i_procedure_arity):
* libguile/procs.c (scm_procedure_p): Add hooks for the new tc7.
* libguile/programs.h:
* libguile/programs.c (scm_make_rtl_program, scm_i_rtl_program_print)
(scm_rtl_program_p, scm_rtl_program_code):
* module/system/vm/program.scm: Add constructors and accessors for the
new "RTL programs".
* libguile/vm.c (rtl_boot_continuation): Define a boot program.
(rtl_apply, rtl_values): New static RTL programs.
* libguile/frames.c (scm_frame_num_locals): Adapt for frames of RTL
programs.
* libguile/frames.h: Add description of RTL frames.
* libguile/Makefile.am: Add rules to generate vm-operations.h.
* .gitignore: Ignore vm-operations.h.
* module/system/vm/instruction.scm:
* libguile/instructions.c:
* libguile/instructions.h: Use vm-operations.h to define enumerated
values for the new RTL opcodes. Define some helper macros to pack and
unpack 32-bit instruction words.
(rtl-instruction-list): New function, exported by (system vm
instruction).
* libguile/objcodes.c: Wire up the bits needed to detect the new RTL
bytecode and load it, as appropriate.
Diffstat (limited to 'libguile/frames.c')
-rw-r--r-- | libguile/frames.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/libguile/frames.c b/libguile/frames.c index 0338d18db..8ce5aa0b0 100644 --- a/libguile/frames.c +++ b/libguile/frames.c @@ -129,11 +129,21 @@ SCM_DEFINE (scm_frame_num_locals, "frame-num-locals", 1, 0, 0, "") #define FUNC_NAME s_scm_frame_num_locals { - SCM *sp, *p; + SCM *fp, *sp, *p; unsigned int n = 0; SCM_VALIDATE_VM_FRAME (1, frame); + fp = SCM_VM_FRAME_FP (frame); + sp = SCM_VM_FRAME_SP (frame); + p = SCM_FRAME_STACK_ADDRESS (SCM_VM_FRAME_FP (frame)); + + if (SCM_RTL_PROGRAM_P (fp[-1])) + /* The frame size of an RTL program is fixed, except in the case of + passing a wrong number of arguments to the program. So we do + need to use an SP for determining the number of locals. */ + return scm_from_uint32 (sp + 1 - p); + sp = SCM_VM_FRAME_SP (frame); p = SCM_FRAME_STACK_ADDRESS (SCM_VM_FRAME_FP (frame)); while (p <= sp) |