summaryrefslogtreecommitdiff
path: root/libguile/frames.h
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2013-11-21 17:13:18 +0100
committerAndy Wingo <wingo@pobox.com>2013-11-21 17:13:18 +0100
commit050a40db5b0b09f0b00d4d68aac67827c7f9b1ac (patch)
treec15d8b83fd8fad5626d2e115e99c55229dbb3147 /libguile/frames.h
parent0bca90aac9a209b2ae06281b00d5c3b9939d605e (diff)
downloadguile-050a40db5b0b09f0b00d4d68aac67827c7f9b1ac.tar.gz
Heap frames have a "frame kind" bit
* libguile/frames.h (enum scm_vm_frame_kind, SCM_VM_FRAME_KIND) (scm_c_make_frame): Add a "frame kind" bit to the first word. This will allow the "stack holder" to be a non-SCM object. * libguile/continuations.c (scm_i_continuation_to_frame): * libguile/frames.c (scm_c_make_frame, scm_frame_previous) * libguile/stacks.c (scm_make_stack): * libguile/vm.c (vm_dispatch_hook): Adapt frame creators to set the frame kind bit.
Diffstat (limited to 'libguile/frames.h')
-rw-r--r--libguile/frames.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/libguile/frames.h b/libguile/frames.h
index 3876c2fc4..67130ad61 100644
--- a/libguile/frames.h
+++ b/libguile/frames.h
@@ -146,7 +146,14 @@ struct scm_frame
scm_t_uint32 *ip;
};
+enum scm_vm_frame_kind
+ {
+ SCM_VM_FRAME_KIND_VM,
+ SCM_VM_FRAME_KIND_CONT
+ };
+
#define SCM_VM_FRAME_P(x) (SCM_HAS_TYP7 (x, scm_tc7_frame))
+#define SCM_VM_FRAME_KIND(x) ((enum scm_vm_frame_kind) (SCM_CELL_WORD_0 (x) >> 8))
#define SCM_VM_FRAME_DATA(x) ((struct scm_frame*)SCM_CELL_WORD_1 (x))
#define SCM_VM_FRAME_STACK_HOLDER(f) SCM_VM_FRAME_DATA (f)->stack_holder
#define SCM_VM_FRAME_FP_OFFSET(f) SCM_VM_FRAME_DATA (f)->fp_offset
@@ -160,7 +167,8 @@ struct scm_frame
SCM_INTERNAL SCM* scm_i_frame_stack_base (SCM frame);
SCM_INTERNAL scm_t_ptrdiff scm_i_frame_offset (SCM frame);
-SCM_INTERNAL SCM scm_c_make_frame (SCM stack_holder, scm_t_ptrdiff fp_offset,
+SCM_INTERNAL SCM scm_c_make_frame (enum scm_vm_frame_kind vm_frame_kind,
+ SCM stack_holder, scm_t_ptrdiff fp_offset,
scm_t_ptrdiff sp_offset, scm_t_uint32 *ip);
#endif