cv_tbl is no longer used

This commit is contained in:
Yuichi Nishiwaki 2014-03-22 20:06:20 +09:00
parent c9eb612561
commit cac31845d0
3 changed files with 0 additions and 11 deletions

View File

@ -62,7 +62,6 @@ struct pic_irep {
PIC_OBJECT_HEADER
pic_code *code;
int argc, localc, capturec;
unsigned *cv_tbl;
bool varg;
struct pic_irep **irep;
pic_value *pool;
@ -189,10 +188,6 @@ pic_dump_irep(struct pic_irep *irep)
printf("## irep %p\n", (void *)irep);
printf("[clen = %zd, argc = %d, localc = %d, capturec = %d]\n", irep->clen, irep->argc, irep->localc, irep->capturec);
printf(":: cv_tbl\n");
for (i = 0; i < (unsigned)irep->capturec; ++i) {
printf(": %d -> %d\n", irep->cv_tbl[i], i);
}
for (i = 0; i < irep->clen; ++i) {
printf("%02x ", i);
pic_dump_code(irep->code[i]);

View File

@ -817,8 +817,6 @@ typedef struct codegen_context {
bool varg;
/* rest args variable is counted as a local */
xvect args, locals, captures;
/* closed variable table */
unsigned *cv_tbl;
/* actual bit code sequence */
pic_code *code;
size_t clen, ccapa;
@ -905,7 +903,6 @@ create_cv_table(pic_state *pic, codegen_context *cxt)
}
/* closed variables */
cxt->cv_tbl = pic_calloc(pic, cxt->captures.size, sizeof(unsigned));
for (i = 0; i < cxt->captures.size; ++i) {
var = xv_get(&cxt->captures, i);
if ((n = xh_get_int(regs, *var)->val) <= cxt->args.size) {
@ -918,7 +915,6 @@ create_cv_table(pic_state *pic, codegen_context *cxt)
cxt->code[cxt->clen].insn = OP_PUSHNONE;
cxt->clen++;
}
cxt->cv_tbl[i] = n;
}
xh_destroy(regs);
@ -979,7 +975,6 @@ pop_codegen_context(codegen_state *state)
irep->argc = state->cxt->args.size + 1;
irep->localc = state->cxt->locals.size;
irep->capturec = state->cxt->captures.size;
irep->cv_tbl = state->cxt->cv_tbl;
irep->code = pic_realloc(pic, state->cxt->code, sizeof(pic_code) * state->cxt->clen);
irep->clen = state->cxt->clen;
irep->irep = pic_realloc(pic, state->cxt->irep, sizeof(struct pic_irep *) * state->cxt->ilen);

View File

@ -634,7 +634,6 @@ gc_finalize_object(pic_state *pic, struct pic_object *obj)
case PIC_TT_IREP: {
struct pic_irep *irep = (struct pic_irep *)obj;
pic_free(pic, irep->code);
pic_free(pic, irep->cv_tbl);
pic_free(pic, irep->irep);
pic_free(pic, irep->pool);
break;