diff options
author | Andy Wingo <wingo@pobox.com> | 2010-02-06 17:00:03 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2010-02-08 13:00:54 +0100 |
commit | 1d1cae0e2e063d9a36e7d600f87cf3d6eaf940f3 (patch) | |
tree | 136a102cc12ca78edbcb740ecc11f89fa0920e7b /libguile/programs.h | |
parent | 217167c6b2e6e400306c8cb4a0bff86c17eef28c (diff) | |
download | guile-1d1cae0e2e063d9a36e7d600f87cf3d6eaf940f3.tar.gz |
continuations are vm procedures
* libguile/vm-i-system.c (continuation-call): New op, like subr-call or
foreign-call, but for continuations.
* libguile/continuations.h: Add scm_i_continuation_call internal
declaration.
(SCM_CONTINUATIONP): Reimplement in terms of
SCM_PROGRAM_IS_CONTINUATION.
(scm_tc16_continuation, SCM_CONTREGS, SCM_CONTINUATION_LENGTH)
(SCM_SET_CONTINUATION_LENGTH, SCM_JMPBUF, SCM_DYNENV, SCM_THROW_VALUE)
(SCM_CONTINUATION_ROOT, SCM_DFRAME): Remove these from the exposed
API.
(scm_i_continuation_to_frame): New internal declaration.
* libguile/continuations.c
* libguile/continuations.c: Add trickery like in foreign.c, smob.c, and
gsubr.c, so that we can make procedural trampolines for continuations.
(scm_i_continuation_to_frame): New internal function, from stacks.c.
* libguile/programs.h (SCM_F_PROGRAM_IS_CONTINUATION)
(SCM_PROGRAM_IS_CONTINUATION): Add a flag for programs that are
continuations. Probably should add flags for the other trampoline
types too.
* libguile/programs.c (scm_i_program_print): Print continuations as
before.
* libguile/stacks.c (scm_stack_id, scm_make_stack): Use
scm_i_continuation_to_frame in the continuation case.
Diffstat (limited to 'libguile/programs.h')
-rw-r--r-- | libguile/programs.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libguile/programs.h b/libguile/programs.h index 15457344c..26115509b 100644 --- a/libguile/programs.h +++ b/libguile/programs.h @@ -27,8 +27,9 @@ */ #define SCM_F_PROGRAM_IS_BOOT 0x100 -#define SCM_F_PROGRAM_IS_PRIMITIVE 0x100 -#define SCM_F_PROGRAM_IS_PRIMITIVE_GENERIC 0x200 +#define SCM_F_PROGRAM_IS_PRIMITIVE 0x200 +#define SCM_F_PROGRAM_IS_PRIMITIVE_GENERIC 0x400 +#define SCM_F_PROGRAM_IS_CONTINUATION 0x800 #define SCM_PROGRAM_P(x) (!SCM_IMP (x) && SCM_TYP7(x) == scm_tc7_program) #define SCM_PROGRAM_OBJCODE(x) (SCM_CELL_OBJECT_1 (x)) @@ -42,6 +43,7 @@ #define SCM_PROGRAM_IS_BOOT(x) (SCM_CELL_WORD_0 (x) & SCM_F_PROGRAM_IS_BOOT) #define SCM_PROGRAM_IS_PRIMITIVE(x) (SCM_CELL_WORD_0 (x) & SCM_F_PROGRAM_IS_PRIMITIVE) #define SCM_PROGRAM_IS_PRIMITIVE_GENERIC(x) (SCM_CELL_WORD_0 (x) & SCM_F_PROGRAM_IS_PRIMITIVE_GENERIC) +#define SCM_PROGRAM_IS_CONTINUATION(x) (SCM_CELL_WORD_0 (x) & SCM_F_PROGRAM_IS_CONTINUATION) SCM_API SCM scm_make_program (SCM objcode, SCM objtable, SCM free_variables); |