diff options
author | Andy Wingo <wingo@pobox.com> | 2013-11-21 12:12:38 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2013-11-21 16:51:15 +0100 |
commit | 0bca90aac9a209b2ae06281b00d5c3b9939d605e (patch) | |
tree | 4d7e5f3c9d182644b815bda04bb5cd5e1a318ad2 /libguile/dynstack.c | |
parent | a3da449801895e3f61aa2e085e7f4ff27c0f202c (diff) |
The dynamic stack records SP and FP values as offsets
* libguile/dynstack.h:
* libguile/dynstack.c (PROMPT_FP, PROMPT_SP):
(scm_dynstack_push_prompt, scm_dynstack_find_prompt): Prompts on the
dynstack are recorded as offsets from the base stack address in this
thread.
* libguile/control.c (scm_c_abort):
* libguile/eval.c (eval):
* libguile/stacks.c (find_prompt, narrow_stack):
* libguile/throw.c (pre_init_catch):
* libguile/vm-engine.c (prompt): Adapt.
Diffstat (limited to 'libguile/dynstack.c')
-rw-r--r-- | libguile/dynstack.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/libguile/dynstack.c b/libguile/dynstack.c index 2d8895e08..9235ec495 100644 --- a/libguile/dynstack.c +++ b/libguile/dynstack.c @@ -36,8 +36,8 @@ #define PROMPT_WORDS 5 #define PROMPT_KEY(top) (SCM_PACK ((top)[0])) -#define PROMPT_FP(top) ((SCM *) ((top)[1])) -#define PROMPT_SP(top) ((SCM *) ((top)[2])) +#define PROMPT_FP(top) ((scm_t_ptrdiff) ((top)[1])) +#define PROMPT_SP(top) ((scm_t_ptrdiff) ((top)[2])) #define PROMPT_IP(top) ((scm_t_uint32 *) ((top)[3])) #define PROMPT_JMPBUF(top) ((scm_i_jmp_buf *) ((top)[4])) @@ -186,16 +186,16 @@ void scm_dynstack_push_prompt (scm_t_dynstack *dynstack, scm_t_dynstack_prompt_flags flags, SCM key, - SCM *fp, SCM *sp, scm_t_uint32 *ip, - scm_i_jmp_buf *registers) + scm_t_ptrdiff fp_offset, scm_t_ptrdiff sp_offset, + scm_t_uint32 *ip, scm_i_jmp_buf *registers) { scm_t_bits *words; words = push_dynstack_entry (dynstack, SCM_DYNSTACK_TYPE_PROMPT, flags, PROMPT_WORDS); words[0] = SCM_UNPACK (key); - words[1] = (scm_t_bits) fp; - words[2] = (scm_t_bits) sp; + words[1] = (scm_t_bits) fp_offset; + words[2] = (scm_t_bits) sp_offset; words[3] = (scm_t_bits) ip; words[4] = (scm_t_bits) registers; } @@ -442,8 +442,8 @@ scm_dynstack_unwind_fork (scm_t_dynstack *dynstack, scm_t_dynstack *branch) scm_t_bits* scm_dynstack_find_prompt (scm_t_dynstack *dynstack, SCM key, scm_t_dynstack_prompt_flags *flags, - SCM **fp, SCM **sp, scm_t_uint32 **ip, - scm_i_jmp_buf **registers) + scm_t_ptrdiff *fp_offset, scm_t_ptrdiff *sp_offset, + scm_t_uint32 **ip, scm_i_jmp_buf **registers) { scm_t_bits *walk; @@ -457,10 +457,10 @@ scm_dynstack_find_prompt (scm_t_dynstack *dynstack, SCM key, { if (flags) *flags = SCM_DYNSTACK_TAG_FLAGS (tag); - if (fp) - *fp = PROMPT_FP (walk); - if (sp) - *sp = PROMPT_SP (walk); + if (fp_offset) + *fp_offset = PROMPT_FP (walk); + if (sp_offset) + *sp_offset = PROMPT_SP (walk); if (ip) *ip = PROMPT_IP (walk); if (registers) |