[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.2-174-g3e54f
From: |
Andy Wingo |
Subject: |
[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.2-174-g3e54fdf |
Date: |
Wed, 19 Oct 2011 09:55:35 +0000 |
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=3e54fdfc217969abb50a46ec9c9c5c02a2c7d369
The branch, stable-2.0 has been updated
via 3e54fdfc217969abb50a46ec9c9c5c02a2c7d369 (commit)
from 9cbbb400f4ac760e2f648b6b2d57f1938917376d (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 3e54fdfc217969abb50a46ec9c9c5c02a2c7d369
Author: Andy Wingo <address@hidden>
Date: Wed Oct 19 11:55:27 2011 +0200
slight frames.h refactor
* libguile/frames.h: Instead of doing a lot of nasty pointer match and
casts here, simply define a struct that aliases the contents of a
stack frame. There are some naming issues here, that the SCM_FRAME
macros access the scm_vm_frame structure, but SCM_VM_FRAME macros
access scm_frame; oh well.
-----------------------------------------------------------------------
Summary of changes:
libguile/frames.h | 49 ++++++++++++++++++++++++++++++++-----------------
1 files changed, 32 insertions(+), 17 deletions(-)
diff --git a/libguile/frames.h b/libguile/frames.h
index 47244c7..ffb577a 100644
--- a/libguile/frames.h
+++ b/libguile/frames.h
@@ -59,28 +59,43 @@
`sizeof (SCM *) == sizeof (SCM)', since pointers (the `link' parts) are
assumed to be as long as SCM objects. */
+/* This structure maps to the contents of a VM stack frame. It can
+ alias a frame directly. */
+struct scm_vm_frame
+{
+ SCM *dynamic_link;
+ scm_t_uint8 *mv_return_address;
+ scm_t_uint8 *return_address;
+ SCM program;
+ SCM stack[1]; /* Variable-length */
+};
+
+#define SCM_FRAME_STRUCT(fp) ((struct scm_vm_frame*)(((SCM*)(fp)) -
4))
+
#define SCM_FRAME_DATA_ADDRESS(fp) (fp - 4)
-#define SCM_FRAME_STACK_ADDRESS(fp) (fp)
-#define SCM_FRAME_UPPER_ADDRESS(fp) (fp - 2)
-#define SCM_FRAME_LOWER_ADDRESS(fp) (fp - 4)
+#define SCM_FRAME_STACK_ADDRESS(fp) (SCM_FRAME_STRUCT (fp)->stack)
+#define SCM_FRAME_UPPER_ADDRESS(fp) ((SCM*)&SCM_FRAME_STRUCT
(fp)->return_address)
+#define SCM_FRAME_LOWER_ADDRESS(fp) ((SCM*)SCM_FRAME_STRUCT (fp))
#define SCM_FRAME_BYTE_CAST(x) ((scm_t_uint8 *) SCM_UNPACK (x))
#define SCM_FRAME_STACK_CAST(x) ((SCM *) SCM_UNPACK (x))
-#define SCM_FRAME_RETURN_ADDRESS(fp) \
- (SCM_FRAME_BYTE_CAST (SCM_FRAME_DATA_ADDRESS (fp)[2]))
-#define SCM_FRAME_SET_RETURN_ADDRESS(fp, ra) \
- ((SCM_FRAME_DATA_ADDRESS (fp)[2])) = SCM_PACK (ra)
-#define SCM_FRAME_MV_RETURN_ADDRESS(fp) \
- (SCM_FRAME_BYTE_CAST (SCM_FRAME_DATA_ADDRESS (fp)[1]))
-#define SCM_FRAME_SET_MV_RETURN_ADDRESS(fp, mvra) \
- ((SCM_FRAME_DATA_ADDRESS (fp)[1])) = SCM_PACK (mvra)
-#define SCM_FRAME_DYNAMIC_LINK(fp) \
- (SCM_FRAME_STACK_CAST (SCM_FRAME_DATA_ADDRESS (fp)[0]))
-#define SCM_FRAME_SET_DYNAMIC_LINK(fp, dl) \
- ((SCM_FRAME_DATA_ADDRESS (fp)[0])) = SCM_PACK (dl)
-#define SCM_FRAME_VARIABLE(fp,i) SCM_FRAME_STACK_ADDRESS (fp)[i]
-#define SCM_FRAME_PROGRAM(fp) SCM_FRAME_STACK_ADDRESS (fp)[-1]
+#define SCM_FRAME_RETURN_ADDRESS(fp) \
+ (SCM_FRAME_STRUCT (fp)->return_address)
+#define SCM_FRAME_SET_RETURN_ADDRESS(fp, ra) \
+ SCM_FRAME_STRUCT (fp)->return_address = (ra)
+#define SCM_FRAME_MV_RETURN_ADDRESS(fp) \
+ (SCM_FRAME_STRUCT (fp)->mv_return_address)
+#define SCM_FRAME_SET_MV_RETURN_ADDRESS(fp, mvra) \
+ SCM_FRAME_STRUCT (fp)->mv_return_address = (mvra)
+#define SCM_FRAME_DYNAMIC_LINK(fp) \
+ (SCM_FRAME_STRUCT (fp)->dynamic_link)
+#define SCM_FRAME_SET_DYNAMIC_LINK(fp, dl) \
+ SCM_FRAME_STRUCT (fp)->dynamic_link = (dl)
+#define SCM_FRAME_VARIABLE(fp,i) \
+ (SCM_FRAME_STRUCT (fp)->stack[i])
+#define SCM_FRAME_PROGRAM(fp) \
+ (SCM_FRAME_STRUCT (fp)->program)
/*
hooks/post-receive
--
GNU Guile
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.2-174-g3e54fdf,
Andy Wingo <=