123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219 |
- typedef struct scm_dynstack
- {
- scm_t_bits *base;
- scm_t_bits *top
- scm_t_bits *limit
- } scm_t_dynstack;
- typedef enum {
- SCM_DYNSTACK_TYPE_NONE = 0,
- SCM_DYNSTACK_TYPE_FRAME,
- SCM_DYNSTACK_TYPE_UNWINDER,
- SCM_DYNSTACK_TYPE_REWINDER,
- SCM_DYNSTACK_TYPE_WITH_FLUID,
- SCM_DYNSTACK_TYPE_PROMPT,
- SCM_DYNSTACK_TYPE_DYNWIND,
- SCM_DYNSTACK_TYPE_DYNAMIC_STATE,
- } scm_t_dynstack_item_type;
- ((type) | (flags) | ((len) << SCM_DYNSTACK_TAG_LEN_SHIFT))
- ((tag) & SCM_DYNSTACK_TAG_TYPE_MASK)
- ((tag) & SCM_DYNSTACK_TAG_FLAGS_MASK)
- ((tag) >> SCM_DYNSTACK_TAG_LEN_SHIFT)
- (SCM_DYNSTACK_PREV_OFFSET (top) \
- ? ((top) - SCM_DYNSTACK_PREV_OFFSET (top)) : NULL)
- (SCM_DYNSTACK_TAG (top) \
- ? ((top) + SCM_DYNSTACK_TAG_LEN (SCM_DYNSTACK_TAG (top)) \
- + SCM_DYNSTACK_HEADER_LEN) \
- : NULL)
- ((dynstack)->base + SCM_DYNSTACK_HEADER_LEN)
- ((dynstack)->limit - (dynstack)->base)
- ((dynstack)->limit - (dynstack)->top)
- ((dynstack)->top - (dynstack)->base)
- (SCM_DYNSTACK_SPACE (dynstack) >= n + SCM_DYNSTACK_HEADER_LEN)
- typedef enum {
- SCM_F_DYNSTACK_FRAME_REWINDABLE = (1 << SCM_DYNSTACK_TAG_FLAGS_SHIFT)
- } scm_t_dynstack_frame_flags;
- typedef enum {
- SCM_F_DYNSTACK_WINDER_EXPLICIT = (1 << SCM_DYNSTACK_TAG_FLAGS_SHIFT)
- } scm_t_dynstack_winder_flags;
- typedef enum {
- SCM_F_DYNSTACK_PROMPT_ESCAPE_ONLY = (1 << SCM_DYNSTACK_TAG_FLAGS_SHIFT)
- } scm_t_dynstack_prompt_flags;
- typedef void (*scm_t_guard) (void *)
- SCM_INTERNAL void scm_dynstack_push_frame (scm_t_dynstack *,
- scm_t_dynstack_frame_flags);
- SCM_INTERNAL void scm_dynstack_push_rewinder (scm_t_dynstack *,
- scm_t_dynstack_winder_flags,
- scm_t_guard, void *)
- SCM_INTERNAL void scm_dynstack_push_unwinder (scm_t_dynstack *,
- scm_t_dynstack_winder_flags,
- scm_t_guard, void *)
- SCM_INTERNAL void scm_dynstack_push_fluid (
- scm_t_dynstack *, SCM fluid, SCM value,
- scm_t_dynamic_state *dynamic_state)
- SCM_INTERNAL void scm_dynstack_push_dynamic_state (scm_t_dynstack *, SCM,
- scm_t_dynamic_state *)
- SCM_INTERNAL void scm_dynstack_push_prompt (scm_t_dynstack *,
- scm_t_dynstack_prompt_flags,
- SCM key,
- ptrdiff_t fp_offset,
- ptrdiff_t sp_offset,
- uint32_t *vra,
- uint8_t *mra,
- jmp_buf *registers)
- SCM_INTERNAL void scm_dynstack_push_dynwind (scm_t_dynstack *,
- SCM enter, SCM leave)
- SCM_INTERNAL void scm_dynstack_pop (scm_t_dynstack *)
- SCM_INTERNAL scm_t_dynstack* scm_dynstack_capture_all (scm_t_dynstack *dynstack)
- SCM_INTERNAL scm_t_dynstack* scm_dynstack_capture (scm_t_dynstack *dynstack,
- scm_t_bits *item)
- SCM_INTERNAL void scm_dynstack_wind_1 (scm_t_dynstack *, scm_t_bits *)
- SCM_INTERNAL scm_t_bits scm_dynstack_unwind_1 (scm_t_dynstack *)
- SCM_INTERNAL void scm_dynstack_wind (scm_t_dynstack *, scm_t_bits *)
- SCM_INTERNAL void scm_dynstack_unwind (scm_t_dynstack *, scm_t_bits *)
- SCM_INTERNAL scm_t_bits* scm_dynstack_unwind_fork (scm_t_dynstack *,
- scm_t_dynstack *)
- SCM_INTERNAL void scm_dynstack_unwind_frame (scm_t_dynstack *)
- SCM_INTERNAL void scm_dynstack_unwind_fluid
- (scm_t_dynstack *dynstack, scm_t_dynamic_state *dynamic_state)
- SCM_INTERNAL void scm_dynstack_unwind_dynamic_state
- (scm_t_dynstack *dynstack, scm_t_dynamic_state *dynamic_state)
- SCM_INTERNAL scm_t_bits* scm_dynstack_find_prompt (scm_t_dynstack *, SCM,
- scm_t_dynstack_prompt_flags *,
- ptrdiff_t *,
- ptrdiff_t *,
- uint32_t **,
- uint8_t **,
- jmp_buf **)
- SCM_INTERNAL SCM scm_dynstack_find_old_fluid_value (scm_t_dynstack *,
- SCM, size_t, SCM);
- SCM_INTERNAL void scm_dynstack_relocate_prompts (scm_t_dynstack *,
- ptrdiff_t)
- SCM_INTERNAL void scm_dynstack_wind_prompt (scm_t_dynstack *, scm_t_bits *,
- ptrdiff_t, jmp_buf *)
|