Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Commit

Permalink
remove pic->iseq
Browse files Browse the repository at this point in the history
  • Loading branch information
nyuichi committed Feb 29, 2016
1 parent b0f05f5 commit ca4fb05
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion contrib/10.callcc/callcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ struct fullcont {
size_t ci_offset;
ptrdiff_t ci_len;

struct code *ip;
const struct code *ip;

struct object **arena;
size_t arena_size, arena_idx;
Expand Down
2 changes: 1 addition & 1 deletion extlib/benz/cont.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct cont {
ptrdiff_t sp_offset;
ptrdiff_t ci_offset;
size_t arena_idx;
struct code *ip;
const struct code *ip;

int retc;
pic_value *retv;
Expand Down
5 changes: 2 additions & 3 deletions extlib/benz/include/picrin/private/state.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ struct lib {

struct callinfo {
int argc, retc;
struct code *ip;
const struct code *ip;
pic_value *fp;
struct irep *irep;
struct context *cxt;
Expand All @@ -48,7 +48,7 @@ struct pic_state {
struct callinfo *ci;
struct callinfo *cibase, *ciend;

struct code *ip;
const struct code *ip;

const char *lib;

Expand All @@ -62,7 +62,6 @@ struct pic_state {
struct list_head ireps;

xFILE files[XOPEN_MAX];
struct code iseq[2]; /* for pic_apply_trampoline */

bool gc_enable;
struct heap *heap;
Expand Down
8 changes: 2 additions & 6 deletions extlib/benz/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -783,15 +783,11 @@ pic_apply(pic_state *pic, pic_value proc, int argc, pic_value *argv)
pic_value
pic_applyk(pic_state *pic, pic_value proc, int argc, pic_value *args)
{
static const struct code iseq[2] = { { OP_NOP, 0, 0 }, { OP_TAILCALL, -1, 0 } };
pic_value *sp;
struct callinfo *ci;
int i;

pic->iseq[0].insn = OP_NOP;
pic->iseq[0].a = 0;
pic->iseq[1].insn = OP_TAILCALL;
pic->iseq[1].a = -1;

*pic->sp++ = proc;

sp = pic->sp;
Expand All @@ -800,7 +796,7 @@ pic_applyk(pic_state *pic, pic_value proc, int argc, pic_value *args)
}

ci = PUSHCI();
ci->ip = pic->iseq;
ci->ip = iseq;
ci->fp = pic->sp;
ci->retc = (int)argc;

Expand Down

0 comments on commit ca4fb05

Please sign in to comment.