summaryrefslogtreecommitdiff
path: root/libguile/frames.c
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.c
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.c')
-rw-r--r--libguile/frames.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libguile/frames.c b/libguile/frames.c
index 0fc0b9ec1..824f2c84e 100644
--- a/libguile/frames.c
+++ b/libguile/frames.c
@@ -37,8 +37,9 @@ verify (offsetof (struct scm_vm_frame, dynamic_link) == 0);
(((SCM *) (val)) + SCM_VM_FRAME_OFFSET (frame))
SCM
-scm_c_make_frame (SCM stack_holder, scm_t_ptrdiff fp_offset,
- scm_t_ptrdiff sp_offset, scm_t_uint32 *ip)
+scm_c_make_frame (enum scm_vm_frame_kind frame_kind, SCM stack_holder,
+ scm_t_ptrdiff fp_offset, scm_t_ptrdiff sp_offset,
+ scm_t_uint32 *ip)
{
struct scm_frame *p = scm_gc_malloc (sizeof (struct scm_frame),
"vmframe");
@@ -46,7 +47,7 @@ scm_c_make_frame (SCM stack_holder, scm_t_ptrdiff fp_offset,
p->fp_offset = fp_offset;
p->sp_offset = sp_offset;
p->ip = ip;
- return scm_cell (scm_tc7_frame, (scm_t_bits)p);
+ return scm_cell (scm_tc7_frame | (frame_kind << 8), (scm_t_bits)p);
}
void
@@ -282,7 +283,8 @@ SCM_DEFINE (scm_frame_previous, "frame-previous", 1, 0, 0,
SCM *stack_base = scm_i_frame_stack_base (frame);
new_fp = RELOC (frame, new_fp);
new_sp = SCM_FRAME_PREVIOUS_SP (this_fp);
- frame = scm_c_make_frame (SCM_VM_FRAME_STACK_HOLDER (frame),
+ frame = scm_c_make_frame (SCM_VM_FRAME_KIND (frame),
+ SCM_VM_FRAME_STACK_HOLDER (frame),
new_fp - stack_base, new_sp - stack_base,
SCM_FRAME_RETURN_ADDRESS (this_fp));
proc = scm_frame_procedure (frame);