mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-01 04:10:18 +02:00
inline frame replacement in tail-call
* libguile/programs.c (program_print): Only try to lookup write-program if the module system is booted. * libguile/vm-engine.h (FREE_FRAME): Remove, it's now inlined everywhere. * libguile/vm-i-system.c (tail-call): Inline FREE_FRAME, and implement the calling bits here. Will make things more hackable.
This commit is contained in:
parent
1dc8f8517c
commit
28106f547d
3 changed files with 48 additions and 35 deletions
|
@ -443,35 +443,6 @@ do { \
|
|||
data[0] = external; \
|
||||
}
|
||||
|
||||
#define FREE_FRAME() \
|
||||
{ \
|
||||
SCM *last_sp = sp; \
|
||||
SCM *last_fp = fp; \
|
||||
SCM *p = fp + bp->nargs + bp->nlocs; \
|
||||
\
|
||||
/* Restore pointers */ \
|
||||
ip = SCM_FRAME_BYTE_CAST (p[3]); \
|
||||
fp = SCM_FRAME_STACK_CAST (p[2]); \
|
||||
\
|
||||
if (!SCM_FALSEP (p[1])) \
|
||||
{ \
|
||||
/* Unlink the heap stack */ \
|
||||
vp->this_frame = p[1]; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
/* Move stack items */ \
|
||||
p += 4; \
|
||||
sp = SCM_FRAME_LOWER_ADDRESS (last_fp); \
|
||||
while (p <= last_sp) \
|
||||
*sp++ = *p++; \
|
||||
sp--; \
|
||||
} \
|
||||
stack_base = fp ? \
|
||||
SCM_FRAME_UPPER_ADDRESS (fp) - 1 \
|
||||
: vp->stack_base; \
|
||||
}
|
||||
|
||||
#define CACHE_EXTERNAL() external = fp[bp->nargs + bp->nlocs]
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue