summaryrefslogtreecommitdiff
path: root/libguile/vm-engine.h
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2009-08-15 14:13:08 +0200
committerAndy Wingo <wingo@pobox.com>2009-08-20 18:52:49 +0200
commit03e6c1659623d1aac4121730c1e453c626042c47 (patch)
tree4137603e61a866ff9ab725d21c0d11c7b3648103 /libguile/vm-engine.h
parentd94be25f72d217a484b4f4c9b742c610fc9e501c (diff)
downloadguile-03e6c1659623d1aac4121730c1e453c626042c47.tar.gz
reorder frame layout
* libguile/frames.h: Reorder the frame layout so the return address comes below the arguments.working (SCM_FRAME_SET_RETURN_ADDRESS, SCM_FRAME_SET_MV_RETURN_ADDRESS): New macros. * libguile/frames.c (scm_vm_frame_arguments): Use the macros to access the arguments. * libguile/vm-engine.c (vm_engine): Fix for new calling convention. * libguile/vm-engine.h (INIT_FRAME): New macro. Does part of what NEW_FRAME used to do. * libguile/vm-i-system.c (call, mv-call): Shuffle args up to make room for the stack, and adapt to new calling convention. (goto/args): Shuffling down is easier now. (return, return/args): Adapt to new frame layout. * libguile/vm.c (vm_mark_stack): Adapt to new frame layout, and the possibility of there being crap on the stack. (really_make_boot_program): Remove extraneous comment.
Diffstat (limited to 'libguile/vm-engine.h')
-rw-r--r--libguile/vm-engine.h29
1 files changed, 12 insertions, 17 deletions
diff --git a/libguile/vm-engine.h b/libguile/vm-engine.h
index 240969c37..36d4d2867 100644
--- a/libguile/vm-engine.h
+++ b/libguile/vm-engine.h
@@ -386,34 +386,29 @@ do { \
/* See frames.h for the layout of stack frames */
/* When this is called, bp points to the new program data,
and the arguments are already on the stack */
-#define NEW_FRAME() \
+#define INIT_FRAME() \
{ \
int i; \
- SCM *dl, *data; \
- scm_byte_t *ra = ip; \
- \
- /* Save old registers */ \
- ra = ip; \
- dl = fp; \
\
/* New registers */ \
- fp = sp - bp->nargs + 1; \
- data = SCM_FRAME_DATA_ADDRESS (fp); \
- sp = data + 2; \
+ sp += bp->nlocs; \
CHECK_OVERFLOW (); \
stack_base = sp; \
ip = bp->base; \
\
/* Init local variables */ \
- for (i=bp->nlocs; i; i--) \
- data[-i] = SCM_UNDEFINED; \
- \
- /* Set frame data */ \
- data[2] = (SCM)ra; \
- data[1] = 0x0; \
- data[0] = (SCM)dl; \
+ for (i=bp->nlocs; i;) \
+ sp[-(--i)] = SCM_UNDEFINED; \
}
+#define DROP_FRAME() \
+ { \
+ sp -= 3; \
+ NULLSTACK (3); \
+ CHECK_UNDERFLOW (); \
+ }
+
+
/*
Local Variables:
c-file-style: "gnu"