pic->rescue is no longer used
This commit is contained in:
parent
8451bd5c19
commit
1821039e78
|
@ -77,9 +77,6 @@ typedef struct {
|
||||||
|
|
||||||
pic_code *ip;
|
pic_code *ip;
|
||||||
|
|
||||||
struct pic_proc **rescue;
|
|
||||||
size_t ridx, rlen;
|
|
||||||
|
|
||||||
pic_sym sDEFINE, sLAMBDA, sIF, sBEGIN, sQUOTE, sSETBANG;
|
pic_sym sDEFINE, sLAMBDA, sIF, sBEGIN, sQUOTE, sSETBANG;
|
||||||
pic_sym sQUASIQUOTE, sUNQUOTE, sUNQUOTE_SPLICING;
|
pic_sym sQUASIQUOTE, sUNQUOTE, sUNQUOTE_SPLICING;
|
||||||
pic_sym sDEFINE_SYNTAX, sDEFINE_MACRO;
|
pic_sym sDEFINE_SYNTAX, sDEFINE_MACRO;
|
||||||
|
|
|
@ -26,9 +26,6 @@ struct pic_cont {
|
||||||
|
|
||||||
pic_code *ip;
|
pic_code *ip;
|
||||||
|
|
||||||
struct pic_proc **rescue;
|
|
||||||
size_t ridx, rlen;
|
|
||||||
|
|
||||||
struct pic_object *arena[PIC_ARENA_SIZE];
|
struct pic_object *arena[PIC_ARENA_SIZE];
|
||||||
int arena_idx;
|
int arena_idx;
|
||||||
|
|
||||||
|
|
10
src/cont.c
10
src/cont.c
|
@ -119,11 +119,6 @@ save_cont(pic_state *pic, struct pic_cont **c)
|
||||||
|
|
||||||
cont->ip = pic->ip;
|
cont->ip = pic->ip;
|
||||||
|
|
||||||
cont->ridx = pic->ridx;
|
|
||||||
cont->rlen = pic->rlen;
|
|
||||||
cont->rescue = (struct pic_proc **)pic_alloc(pic, sizeof(struct pic_proc *) * cont->rlen);
|
|
||||||
memcpy(cont->rescue, pic->rescue, sizeof(struct pic_proc *) * cont->rlen);
|
|
||||||
|
|
||||||
cont->arena_idx = pic->arena_idx;
|
cont->arena_idx = pic->arena_idx;
|
||||||
memcpy(cont->arena, pic->arena, sizeof(struct pic_object *) * PIC_ARENA_SIZE);
|
memcpy(cont->arena, pic->arena, sizeof(struct pic_object *) * PIC_ARENA_SIZE);
|
||||||
|
|
||||||
|
@ -168,11 +163,6 @@ restore_cont(pic_state *pic, struct pic_cont *cont)
|
||||||
|
|
||||||
pic->ip = cont->ip;
|
pic->ip = cont->ip;
|
||||||
|
|
||||||
pic->rescue = (struct pic_proc **)pic_realloc(pic, pic->rescue, sizeof(struct pic_proc *) * cont->rlen);
|
|
||||||
memcpy(pic->rescue, cont->rescue, sizeof(struct pic_object *) * cont->rlen);
|
|
||||||
pic->ridx = cont->ridx;
|
|
||||||
pic->rlen = cont->rlen;
|
|
||||||
|
|
||||||
memcpy(pic->arena, cont->arena, sizeof(struct pic_object *) * PIC_ARENA_SIZE);
|
memcpy(pic->arena, cont->arena, sizeof(struct pic_object *) * PIC_ARENA_SIZE);
|
||||||
pic->arena_idx = cont->arena_idx;
|
pic->arena_idx = cont->arena_idx;
|
||||||
|
|
||||||
|
|
18
src/gc.c
18
src/gc.c
|
@ -406,8 +406,7 @@ gc_mark_object(pic_state *pic, struct pic_object *obj)
|
||||||
struct pic_cont *cont = (struct pic_cont *)obj;
|
struct pic_cont *cont = (struct pic_cont *)obj;
|
||||||
pic_value *stack;
|
pic_value *stack;
|
||||||
pic_callinfo *ci;
|
pic_callinfo *ci;
|
||||||
size_t i;
|
int i;
|
||||||
int j;
|
|
||||||
|
|
||||||
/* block */
|
/* block */
|
||||||
gc_mark_block(pic, cont->blk);
|
gc_mark_block(pic, cont->blk);
|
||||||
|
@ -424,14 +423,9 @@ gc_mark_object(pic_state *pic, struct pic_object *obj)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* exception handlers */
|
|
||||||
for (i = 0; i < cont->ridx; ++i) {
|
|
||||||
gc_mark_object(pic, (struct pic_object *)cont->rescue[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* arena */
|
/* arena */
|
||||||
for (j = 0; j < cont->arena_idx; ++j) {
|
for (i = 0; i < cont->arena_idx; ++i) {
|
||||||
gc_mark_object(pic, cont->arena[j]);
|
gc_mark_object(pic, cont->arena[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* result values */
|
/* result values */
|
||||||
|
@ -537,11 +531,6 @@ gc_mark_phase(pic_state *pic)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* exception handlers */
|
|
||||||
for (i = 0; i < pic->ridx; ++i) {
|
|
||||||
gc_mark_object(pic, (struct pic_object *)pic->rescue[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* error object */
|
/* error object */
|
||||||
if (pic->err) {
|
if (pic->err) {
|
||||||
gc_mark_object(pic, (struct pic_object *)pic->err);
|
gc_mark_object(pic, (struct pic_object *)pic->err);
|
||||||
|
@ -608,7 +597,6 @@ gc_finalize_object(pic_state *pic, struct pic_object *obj)
|
||||||
pic_free(pic, cont->stk_ptr);
|
pic_free(pic, cont->stk_ptr);
|
||||||
pic_free(pic, cont->st_ptr);
|
pic_free(pic, cont->st_ptr);
|
||||||
pic_free(pic, cont->ci_ptr);
|
pic_free(pic, cont->ci_ptr);
|
||||||
pic_free(pic, cont->rescue);
|
|
||||||
PIC_BLK_DECREF(pic, cont->blk);
|
PIC_BLK_DECREF(pic, cont->blk);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,11 +42,6 @@ pic_open(int argc, char *argv[], char **envp)
|
||||||
pic->cibase = pic->ci = (pic_callinfo *)calloc(PIC_STACK_SIZE, sizeof(pic_callinfo));
|
pic->cibase = pic->ci = (pic_callinfo *)calloc(PIC_STACK_SIZE, sizeof(pic_callinfo));
|
||||||
pic->ciend = pic->cibase + PIC_STACK_SIZE;
|
pic->ciend = pic->cibase + PIC_STACK_SIZE;
|
||||||
|
|
||||||
/* exception handlers */
|
|
||||||
pic->rescue = (struct pic_proc **)calloc(PIC_RESCUE_SIZE, sizeof(struct pic_proc *));
|
|
||||||
pic->ridx = 0;
|
|
||||||
pic->rlen = PIC_RESCUE_SIZE;
|
|
||||||
|
|
||||||
/* memory heap */
|
/* memory heap */
|
||||||
pic->heap = pic_heap_open();
|
pic->heap = pic_heap_open();
|
||||||
|
|
||||||
|
@ -136,7 +131,6 @@ pic_close(pic_state *pic)
|
||||||
/* clear out root objects */
|
/* clear out root objects */
|
||||||
pic->sp = pic->stbase;
|
pic->sp = pic->stbase;
|
||||||
pic->ci = pic->cibase;
|
pic->ci = pic->cibase;
|
||||||
pic->ridx = 0;
|
|
||||||
pic->arena_idx = 0;
|
pic->arena_idx = 0;
|
||||||
pic->err = NULL;
|
pic->err = NULL;
|
||||||
pic->glen = 0;
|
pic->glen = 0;
|
||||||
|
@ -152,7 +146,6 @@ pic_close(pic_state *pic)
|
||||||
/* free runtime context */
|
/* free runtime context */
|
||||||
free(pic->stbase);
|
free(pic->stbase);
|
||||||
free(pic->cibase);
|
free(pic->cibase);
|
||||||
free(pic->rescue);
|
|
||||||
|
|
||||||
/* free global stacks */
|
/* free global stacks */
|
||||||
free(pic->globals);
|
free(pic->globals);
|
||||||
|
|
Loading…
Reference in New Issue