Skip to content

Commit

Permalink
Remove SCM_CONT_DYNWIND_MARKER
Browse files Browse the repository at this point in the history
It is introduced in commit 4fb47f9
The plan was to keep dynamic handler object in the stack frame rather
than a separate handler chain.  The marker is needed to distinguish what
is stored in the stack frame.  However, the idea didn't seem to work well,
and only the unused marker remained.
  • Loading branch information
shirok committed Sep 21, 2024
1 parent 1c37e1d commit d35a057
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/gauche/vm.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ SCM_EXTERN ScmObj Scm_ContinuationMarkSetToList(const ScmContinuationMarkSet *,
*
* | base |
* | pc | <-- PCont procedure
* | cpc | <-- CCont procedure, NULL, or #<dynamic-handler>
* | cpc | <-- CCont procedure or NULL
* | marker |
* | size=N |
* | denv |
Expand Down
11 changes: 2 additions & 9 deletions src/vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ struct ScmContinuationPromptRec {
/* bitflags for ScmContFrame->marker */
enum {
SCM_CONT_SHIFT_MARKER = (1L<<0),
SCM_CONT_RESET_MARKER = (1L<<1),
SCM_CONT_DYNWIND_MARKER = (1L<<2),
SCM_CONT_RESET_MARKER = (1L<<1)
};

static void push_prompt_cont(ScmVM*, ScmObj, ScmObj);
Expand All @@ -102,10 +101,6 @@ static void push_boundary_cont(ScmVM*, ScmObj, ScmObj);
/* return true if cont has the end marker of partial continuation */
#define MARKER_FRAME_P(cont) ((cont)->marker & SCM_CONT_SHIFT_MARKER)

/* return true if cont is of dynamic-wind body */
#define DYNWIND_FRAME_P(cont) ((cont)->marker & SCM_CONT_DYNWIND_MARKER)


/* A stub VM code to make VM return immediately */
static ScmWord return_code[] = { SCM_VM_INSN(SCM_VM_RET) };
#define PC_TO_RETURN return_code
Expand Down Expand Up @@ -1932,9 +1927,7 @@ ScmObj *Scm_pc_PushCC(ScmVM *vm, ScmPContinuationProc *after, int datasize)
static ScmObj *push_dynamic_handler_cc(ScmVM *vm, ScmPContinuationProc *after,
ScmObj dh, int datasize)
{
ScmObj *data = new_ccont(vm, after, (ScmWord*)dh, datasize);
CONT->marker |= SCM_CONT_DYNWIND_MARKER;
return data;
return new_ccont(vm, after, (ScmWord*)dh, datasize);
}

/*
Expand Down

0 comments on commit d35a057

Please sign in to comment.