diff options
author | Andy Wingo <wingo@pobox.com> | 2008-09-13 19:15:20 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2008-09-13 19:22:28 +0200 |
commit | da320011a31f4b58570d8cb7e67cde39133572eb (patch) | |
tree | 85626c75e2be87d1e1dd0301eeff20c280f82e0b /libguile/frames.h | |
parent | 28106f547dc88723e02a38de7d4dc4ffc6434590 (diff) | |
download | guile-da320011a31f4b58570d8cb7e67cde39133572eb.tar.gz |
add a multiple values return address to stack frames
* libguile/frames.c (frame-mv-return-address): New accessor.
* libguile/frames.h: Update frame diagram.
(SCM_FRAME_UPPER_ADDRESS): Update for data area
growing by one pointer.
(SCM_FRAME_MV_RETURN_ADDRESS): New macro.
* libguile/vm-engine.h (NEW_FRAME): Update for frame getting bigger by a
pointer. In a normal NEW_FRAME, set the MV return address to NULL, to
indicate that this continuation does not accept multiple values.
* libguile/vm-i-system.c (tail-call): Update frame replacement code to
understand the MV return address.
(return): Make room for the MVRA.
Diffstat (limited to 'libguile/frames.h')
-rw-r--r-- | libguile/frames.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libguile/frames.h b/libguile/frames.h index 53fc4e858..f5323f712 100644 --- a/libguile/frames.h +++ b/libguile/frames.h @@ -56,6 +56,7 @@ | | <- fp + bp->nargs + bp->nlocs + 4 +------------------+ = SCM_FRAME_UPPER_ADDRESS (fp) | Return address | + | MV return address| | Dynamic link | | Heap link | | External link | <- fp + bp->nargs + bp->nlocs @@ -74,13 +75,15 @@ #define SCM_FRAME_DATA_ADDRESS(fp) \ (fp + SCM_PROGRAM_DATA (SCM_FRAME_PROGRAM (fp))->nargs \ + SCM_PROGRAM_DATA (SCM_FRAME_PROGRAM (fp))->nlocs) -#define SCM_FRAME_UPPER_ADDRESS(fp) (SCM_FRAME_DATA_ADDRESS (fp) + 4) +#define SCM_FRAME_UPPER_ADDRESS(fp) (SCM_FRAME_DATA_ADDRESS (fp) + 5) #define SCM_FRAME_LOWER_ADDRESS(fp) (fp - 1) #define SCM_FRAME_BYTE_CAST(x) ((scm_byte_t *) 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)[4])) +#define SCM_FRAME_MV_RETURN_ADDRESS(fp) \ (SCM_FRAME_BYTE_CAST (SCM_FRAME_DATA_ADDRESS (fp)[3])) #define SCM_FRAME_DYNAMIC_LINK(fp) \ (SCM_FRAME_STACK_CAST (SCM_FRAME_DATA_ADDRESS (fp)[2])) @@ -109,6 +112,7 @@ extern SCM scm_frame_program (SCM frame); extern SCM scm_frame_local_ref (SCM frame, SCM index); extern SCM scm_frame_local_set_x (SCM frame, SCM index, SCM val); extern SCM scm_frame_return_address (SCM frame); +extern SCM scm_frame_mv_return_address (SCM frame); extern SCM scm_frame_dynamic_link (SCM frame); extern SCM scm_frame_external_link (SCM frame); |