This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project GNU Guile.
http://git.savannah.gnu.org/cgit/guile.git/commit/?id=b636cdb0f3e1b7e8723c214db7a9c80edac9ead6
The branch, master has been updated
via b636cdb0f3e1b7e8723c214db7a9c80edac9ead6 (commit)
from cb8ea3805f02684c17c5dd8b55714dc1e8ce6c48 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -
commit b636cdb0f3e1b7e8723c214db7a9c80edac9ead6
Author: Andy Wingo wi...@pobox.com
Date: Sun Nov 17 22:07:44 2013 +0100
Frame pointer points to local 0 instead of local 1
* libguile/frames.h: Change so that fp points at local 0 instead of
local 1, and clean up a bit.
(struct scm_vm_frame): Remove program, and rename stack to locals.
(SCM_FRAME_DATA_ADDRESS): Remove; it was redundant with
SCM_FRAME_LOWER_ADDRESS.
(SCM_FRAME_STACK_ADDRESS): Remove; replace with the new
SCM_FRAME_LOCALS_ADDRESS.
(SCM_FRAME_UPPER_ADDRESS): Remove; unused.
(SCM_FRAME_NUM_LOCALS, SCM_FRAME_PREVIOUS_SP): New defines.
(SCM_FRAME_BYTE_CAST, SCM_FRAME_STACK_CAST): Remove; unused;
(SCM_FRAME_LOCAL): New define, replaces SCM_FRAME_VARIABLE.
(SCM_FRAME_PROGRAM): Add cautionary commentary.
* libguile/frames.c: Adapt static asserts.
(scm_frame_num_locals, scm_frame_local_ref, scm_frame_local_set_x):
Adapt. This means that frame-local-ref 0 now returns the procedure.
* libguile/vm-engine.c (ALLOC_FRAME, RESET_FRAME)
(FRAME_LOCALS_COUNT, LOCAL_REF, LOCAL_SET, RETURN_VALUE_LIST): Adapt
to change in fp.
(LOCAL_ADDRESS): New helper.
(POP_CONTINUATION_HOOK): Reimplement, taking the previous FP as an
argument.
(ABORT_CONTINUATION_HOOK): Reimplement, taking no arguments.
(RETURN_ONE_VALUE): Reimplement.
(RETURN_VALUE_LIST): Adapt to FP change.
(halt, return-values, subr-call, foreign-call, prompt)
(continuation-call, compose-continuation, call/cc, abort): Adapt to FP
change, mostly via using LOCAL_ADDRESS, etc abstractions instead of
using the raw frame pointer.
* libguile/control.c (reify_partial_continuation): Update for fp
change.
* libguile/vm.c (vm_reinstate_partial_continuation): Adapt to removal of
SCM_FRAME_UPPER_ADDRESS.
* module/system/vm/frame.scm (frame-call-representation): Adapt to
frame-local-ref change.
* module/system/vm/trace.scm (print-return): Remove unused
frame-num-locals call.
---
Summary of changes:
libguile/control.c |2 +-
libguile/frames.c | 26 +-
libguile/frames.h | 126 +++
libguile/vm-engine.c | 129 +++-
libguile/vm.c |2 +-
module/system/vm/frame.scm |5 +-
module/system/vm/trace.scm |3 +-
7 files changed, 166 insertions(+), 127 deletions(-)
diff --git a/libguile/control.c b/libguile/control.c
index aad5aba..3e5c0d8 100644
--- a/libguile/control.c
+++ b/libguile/control.c
@@ -109,7 +109,7 @@ reify_partial_continuation (SCM vm,
abort();
/* Capture from the top of the thunk application frame up to the end. */
- vm_cont = scm_i_vm_capture_stack (bottom_fp - 1,
+ vm_cont = scm_i_vm_capture_stack (SCM_FRAME_LOCAL (bottom_fp, 0),
SCM_VM_DATA (vm)-fp,
SCM_VM_DATA (vm)-sp,
SCM_VM_DATA (vm)-ip,
diff --git a/libguile/frames.c b/libguile/frames.c
index 5ba600b..8ca628a 100644
--- a/libguile/frames.c
+++ b/libguile/frames.c
@@ -28,7 +28,7 @@
/* Make sure assumptions on the layout of `struct scm_vm_frame' hold. */
verify (sizeof (SCM) == sizeof (SCM *));
-verify (sizeof (struct scm_vm_frame) == 4 * sizeof (SCM));
+verify (sizeof (struct scm_vm_frame) == 3 * sizeof (SCM));
verify (offsetof (struct scm_vm_frame, dynamic_link) == 0);
@@ -115,14 +115,14 @@ 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;
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));
- return scm_from_ptrdiff_t (sp + 1 - p);
+ return scm_from_ptrdiff_t (SCM_FRAME_NUM_LOCALS (fp, sp));
}
#undef FUNC_NAME
@@ -131,17 +131,17 @@ SCM_DEFINE (scm_frame_local_ref, frame-local-ref, 2, 0,
0,
)
#define FUNC_NAME s_scm_frame_local_ref
{
- SCM *sp, *p;
+ SCM *fp, *sp;
unsigned int i;